-
Notifications
You must be signed in to change notification settings - Fork 537
Closed
Labels
Description
Component(s)
loki.process
What's wrong?
Hello,
Stumbled on a panic against a recently added loki.process stage, stage.truncate;
panic: reflect.Set: value of type string is not assignable to type stages.TruncateSourceType
Only occured when explicitly setting the argument source_type = "line"; "line" is the default value so its probably not commonly explicitly defined. After commenting out source_type = "line" it loaded up fine.
Steps to reproduce
Configure a stage.truncate rule with explicitly defined source_type = "line"
System information
Linux 5.4.0-216-generic aarch64
Software version
alloy, version v1.12.2 (branch: HEAD, revision: 477e314)
Configuration
stage.truncate {
rule {
limit = "31KiB"
source_type = "line"
suffix = "...[truncated]"
}
}
Logs
Feb 01 02:05:23 ubuntu20 alloy[187324]: panic: reflect.Set: value of type string is not assignable to type stages.TruncateSourceType
Feb 01 02:05:23 ubuntu20 alloy[187324]: goroutine 1 [running]:
Feb 01 02:05:23 ubuntu20 alloy[187324]: reflect.Value.assignTo({0x9817740?, 0x4001df1b60?, 0x4001be4218?}, {0xba87bad, 0xb}, 0x9822800, 0x0)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__t/go/1.25.5/x64/src/reflect/value.go:3146 +0x204
Feb 01 02:05:23 ubuntu20 alloy[187324]: reflect.Value.Set({0x9822800?, 0x4001dd7d40?, 0xa23d160?}, {0x9817740?, 0x4001df1b60?, 0x9822800?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__t/go/1.25.5/x64/src/reflect/value.go:2131 +0xcc
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/internal/value.(*decoder).decode(0x4001e2e6a8, {{0x9817740?, 0x4001df1b50?, 0xbac928?}, 0x38?}, {0x9822800, 0x4001dd7d40, 0x198})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/internal/value/decode.go:215 +0xe90
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/internal/value.Decode({{0x9817740?, 0x4001df1b50?, 0x4001e38270?}, 0x88?}, {0x94cd320?, 0x4001dd7d40?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/internal/value/decode.go:80 +0xcc
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*structDecoder).decodeAttr(0x4001be4f48, 0x4001d9cc48, {0xb0f0be0?, 0x4001dd7d10?, 0x93152fb?}, 0x4001be4718)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/struct_decoder.go:183 +0x4c4
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*structDecoder).Decode(0x4001be4f48, {0x4001c7fd00, 0x3, 0x4001dd7d10?}, {0xb0f0be0?, 0x4001dd7d10?, 0x4001dd7d10?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/struct_decoder.go:73 +0x5d4
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*Evaluator).evaluateDecode(0x40014d4030, 0x4001ddc468, 0x4001e38270, {0xd034840, 0x4001dad080}, {0x94cd360?, 0x4001dd7d10?, 0x94cd360?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/vm.go:171 +0x218
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*Evaluator).evaluateBlockOrBody(0x40014d4030, 0x4001ddc468, 0x4001e38270, {0xd034840, 0x4001dad080}, {0xb0f0be0?, 0x4001dd7d10?, 0x41f3f8?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/vm.go:95 +0xf0
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*structDecoder).decodeNormalBlock(0x4001be5b38, {0x4001daabc8, 0x4}, 0x4001dad080, {0xa5288e0?, 0x4001e26210?, 0x4001be5288?}, 0x4001be5308)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/struct_decoder.go:242 +0x3e8
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*structDecoder).decodeBlock(0x4001be5b38, 0x4001dad080, {0xa5288e0?, 0x4001e26210?, 0x9055c8a?}, 0x4001be5308)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/struct_decoder.go:203 +0x110
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*structDecoder).Decode(0x4001be5b38, {0x40012d6c70, 0x1, 0x4001e26210?}, {0xa5288e0?, 0x4001e26210?, 0x4001e26210?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/struct_decoder.go:79 +0x59c
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*Evaluator).evaluateDecode(0x40014d4030, 0x4001ddc468, 0x4001e38270, {0xd034840, 0x4001dad000}, {0x94cd3a0?, 0x4001e26210?, 0x94cd3a0?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/vm.go:171 +0x218
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*Evaluator).evaluateBlockOrBody(0x40014d4030, 0x4001ddc468, 0x4001e38270, {0xd034840, 0x4001dad000}, {0xa5288e0?, 0x4001e26210?, 0x4001be5880?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/vm.go:95 +0xf0
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*structDecoder).decodeEnumBlock(0x4001be6718, {0x4001e2e640?, 0x4001e2e640?}, 0x4001dad000, {0xa917d20?, 0x4001e38240?, 0x18?}, 0x4001be5ee8)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/struct_decoder.go:330 +0x298
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*structDecoder).decodeBlock(0x4001be6718, 0x4001dad000, {0xa917d20?, 0x4001e38240?, 0x1?}, 0x4001be5ee8)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/struct_decoder.go:201 +0xe0
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*structDecoder).Decode(0x4001be6718, {0x4001dad180, 0x5, 0x4001e38240?}, {0xa917d20?, 0x4001e38240?, 0x4001be6718?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/struct_decoder.go:79 +0x59c
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*Evaluator).evaluateDecode(0x40014d4030, 0x4001ddc468, 0x4001e38270, {0xd034400, 0x4001d9d530}, {0x946a2a0?, 0x4001e38240?, 0x47fb5c?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/vm.go:171 +0x218
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*Evaluator).evaluateBlockOrBody(0x40014d4030, 0x4001ddc468, 0x4001e38270, {0xd034400, 0x4001d9d530}, {0x946a2a0?, 0x4001e38240?, 0xba5c66e?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/vm.go:95 +0xf0
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/syntax/vm.(*Evaluator).Evaluate(0x40014d4030, 0x4001ddc468, {0x946a2a0, 0x4001e38240})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/syntax/vm/vm.go:60 +0x134
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*BuiltinComponentNode).evaluate(0x4001527688, 0x4001ddc468)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/node_builtin_component.go:280 +0xd4
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*BuiltinComponentNode).Evaluate(0x4001527688, 0x3f6f738?)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/node_builtin_component.go:263 +0x20
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).evaluate(0x4001db0680, {0xd0341c0, 0x4001dd6dc0}, {0xd122e88, 0x4001527688})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:890 +0x50
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).Apply.func2({0xffff486f9ff0, 0x4001527688})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:218 +0xb00
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/dag.WalkTopological(0x4000e7d7e0, {0x4001dd5080, 0x6, 0x142e4040?}, 0x4001be7428)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/dag/walk.go:83 +0x21c
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).Apply(0x4001db0680, {0x4001dde3f0, {0x4000e7d7c0, 0x3, 0x4}, {0x4001dc1900, 0x6, 0x8}, {0x0, 0x0, ...}, ...})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:201 +0x804
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime.(*Runtime).applyLoaderConfig(0x4001ddb0e0, {0x4001dde3f0, {0x4000e7d7c0, 0x3, 0x4}, {0x4001dc1900, 0x6, 0x8}, {0x0, 0x0, ...}, ...})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/alloy.go:357 +0xb4
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime.(*Runtime).loadSource(0x4001ddb0e0, 0x4001cfeace?, 0x4001dde3f0, 0x4001dc0a80)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/alloy.go:341 +0xcc
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime.(*module).LoadBody(0x40013d9eb0, {0x4000961e00?, 0x4001cfeace?, 0x40013d9be0?}, 0x4001dde3f0, 0x4001dc0a80)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/module.go:172 +0x6c
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*CustomComponentNode).evaluate(0x4001dc4c40, 0x4001ddc078)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/node_custom_component.go:210 +0x288
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*CustomComponentNode).Evaluate(0x4001dc4c40, 0x3f6f738?)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/node_custom_component.go:172 +0x20
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).evaluate(0x4001db04e0, {0xd0341c0, 0x4001dd6910}, {0xd122e50, 0x4001dc4c40})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:890 +0x50
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).Apply.func2({0xd037420, 0x4001dc4c40})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:218 +0xb00
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/dag.WalkTopological(0x4000e7d420, {0x4001be83a8, 0x2, 0x142e4040?}, 0x4001be8288)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/dag/walk.go:83 +0x21c
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).Apply(0x4001db04e0, {0x4001dc34a0, {0x4000e7d400, 0x3, 0x4}, {0x40013d9940, 0x2, 0x2}, {0x0, 0x0, ...}, ...})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:201 +0x804
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime.(*Runtime).applyLoaderConfig(0x4001dda000, {0x4001dc34a0, {0x4000e7d400, 0x3, 0x4}, {0x40013d9940, 0x2, 0x2}, {0x0, 0x0, ...}, ...})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/alloy.go:357 +0xb4
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime.(*Runtime).loadSource(0x4001dda000, 0x40014e6298?, 0x4001dc34a0, 0x4001dc09c0)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/alloy.go:341 +0xcc
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime.(*module).LoadBody(0x40013d9920, {0x4001d97c00?, 0x40014e6298?, 0x40013d84e0?}, 0x4001dc34a0, 0x4001dc09c0)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/module.go:172 +0x6c
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*CustomComponentNode).evaluate(0x40009df180, 0x4001525f70)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/node_custom_component.go:210 +0x288
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*CustomComponentNode).Evaluate(0x40009df180, 0x3f6f738?)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/node_custom_component.go:172 +0x20
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).evaluate(0x400140cb60, {0xd0341c0, 0x40014f2690}, {0xd122e50, 0x40009df180})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:890 +0x50
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).Apply.func2({0xd037420, 0x40009df180})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:218 +0xb00
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/dag.WalkTopological(0x4000d29600, {0x40014cf700, 0x6, 0x142e4040?}, 0x4001be90e8)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/dag/walk.go:83 +0x21c
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime/internal/controller.(*Loader).Apply(0x400140cb60, {0x0, {0x40000e3338, 0x1, 0x1}, {0x4000c54c70, 0x2, 0x2}, {0x0, 0x0, ...}, ...})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/internal/controller/loader.go:201 +0x804
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime.(*Runtime).applyLoaderConfig(0x4000e88a20, {0x0, {0x40000e3338, 0x1, 0x1}, {0x4000c54c70, 0x2, 0x2}, {0x0, 0x0, ...}, ...})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/alloy.go:357 +0xb4
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/runtime.(*Runtime).LoadSource(0x4000e88a20, 0x40014ee120, 0x0, {0xffffed41cc1f, 0x17})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/runtime/alloy.go:328 +0x2b0
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/alloycli.(*alloyRun).Run.func5()
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/alloycli/cmd_run.go:408 +0x1dc
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/alloycli.(*alloyRun).Run(0x40012be600, 0x4000886c08, {0xffffed41cc1f, 0x17})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/alloycli/cmd_run.go:441 +0xf70
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/alloycli.runCommand.func1(0x40006e5700?, {0x4000defe60?, 0x4?, 0xba59880?})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/alloycli/cmd_run.go:108 +0x38
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/spf13/cobra.(*Command).execute(0x4000886c08, {0x4000defdd0, 0x3, 0x3})
Feb 01 02:05:23 ubuntu20 alloy[187324]: /go/pkg/mod/github.com/spf13/cobra@v1.10.1/command.go:1015 +0x7d4
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/spf13/cobra.(*Command).ExecuteC(0x4000886308)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /go/pkg/mod/github.com/spf13/cobra@v1.10.1/command.go:1148 +0x350
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/spf13/cobra.(*Command).Execute(...)
Feb 01 02:05:23 ubuntu20 alloy[187324]: /go/pkg/mod/github.com/spf13/cobra@v1.10.1/command.go:1071
Feb 01 02:05:23 ubuntu20 alloy[187324]: github.com/grafana/alloy/internal/alloycli.Run()
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/internal/alloycli/alloycli.go:34 +0x308
Feb 01 02:05:23 ubuntu20 alloy[187324]: main.main()
Feb 01 02:05:23 ubuntu20 alloy[187324]: /__w/alloy/alloy/main.go:35 +0x1c
Tip
React with 👍 if this issue is important to you.
Reactions are currently unavailable