Skip to content

telemetry configuration causes crash at startup #12439

Closed
@codeboten

Description

@codeboten

As noted by @skandragon in #12332, there is a bug in v0.119.0 and v0.120.0 that causes the following panic at start when more than one headers is configured:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xda8c5a]
goroutine 1 [running]:
go.opentelemetry.io/contrib/config/v0%2e3%2e0.toStringMap(...)
	go.opentelemetry.io/contrib/config@v0.14.0/v0.3.0/config.go:157
go.opentelemetry.io/contrib/config/v0%2e3%2e0.otlpGRPCMetricExporter({0x75e6e88, 0xb3cce60}, 0xc0005aa9a0)
	go.opentelemetry.io/contrib/config@v0.14.0/v0.3.0/metric.go:233 +0x61a
go.opentelemetry.io/contrib/config/v0%2e3%2e0.periodicExporter({0x75e6e88?, 0xb3cce60?}, {0x0?, 0xc0005aa9a0?, {0x0?, 0x0?}}, {0xc001421390, 0x1, 0x1})
	go.opentelemetry.io/contrib/config@v0.14.0/v0.3.0/metric.go:127 +0x1e6
go.opentelemetry.io/contrib/config/v0%2e3%2e0.metricReader({0x75e6e88, 0xb3cce60}, {0xc000e515c0, {0x0, 0x0, 0x0}, 0x0})
	go.opentelemetry.io/contrib/config@v0.14.0/v0.3.0/metric.go:88 +0x23a
go.opentelemetry.io/contrib/config/v0%2e3%2e0.meterProvider({{0x75e6e88, 0xb3cce60}, {0x0, 0x0, 0x0, 0x0, 0xc0014252e0, 0xc0015098c0, 0x0, 0xc001509920, ...}}, ...)
	go.opentelemetry.io/contrib/config@v0.14.0/v0.3.0/metric.go:50 +0x1bf
go.opentelemetry.io/contrib/config/v0%2e3%2e0.NewSDK({0xc00128f028?, 0x0?, 0x0?})
	go.opentelemetry.io/contrib/config@v0.14.0/v0.3.0/config.go:90 +0x1fe
go.opentelemetry.io/collector/service.New({_, _}, {{{0x6c1c2ff, 0x19}, {0x0, 0x0}, {0x0, 0x0}}, 0xc000ed7eb0, 0xc0009df9e0, ...}, ...)
	go.opentelemetry.io/collector/service@v0.119.0/service.go:140 +0x95c
go.opentelemetry.io/collector/otelcol.(*Collector).setupConfigurationComponents(0xc001086c60, {0x75e6e88, 0xb3cce60})
	go.opentelemetry.io/collector/otelcol@v0.119.0/collector.go:186 +0x588
go.opentelemetry.io/collector/otelcol.(*Collector).Run(0xc001086c60, {0x75e6e88, 0xb3cce60})
	go.opentelemetry.io/collector/otelcol@v0.119.0/collector.go:285 +0x55
go.opentelemetry.io/collector/otelcol.NewCommand.func1(0xc00080db08, {0x685a762?, 0x4?, 0x685a6da?})
	go.opentelemetry.io/collector/otelcol@v0.119.0/command.go:36 +0x94
github.com/spf13/cobra.(*Command).execute(0xc00080db08, {0xc000072050, 0x1, 0x1})
	github.com/spf13/cobra@v1.8.1/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc00080db08)
	github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(0x6dfcdc8?)
	github.com/spf13/cobra@v1.8.1/command.go:1041 +0x13
main.runInteractive({0x6dfcdc8, {{0x6c1c2ff, 0x19}, {0x0, 0x0}, {0x0, 0x0}}, 0x0, {{{0x0, 0x0, ...}, ...}}, ...})
	go.opentelemetry.io/collector/cmd/builder/main.go:55 +0x45
main.run(...)
	go.opentelemetry.io/collector/cmd/builder/main_others.go:10
main.main()
	go.opentelemetry.io/collector/cmd/builder/main.go:48 +0x365

The case here was using "headers" where it was a map[string]string rather than a list of objects with {name, value}

Originally posted by @skandragon in #12332

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions