-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: runtime error: invalid memory address or nil pointer dereference #4335
Comments
It looks like your Tracer Provider has a nil resource. opentelemetry-go/sdk/trace/span.go Line 628 in f6a658c
Could you give us a short reproduction example? The way you configure your SDK is probably related to the error here. |
Thanks for the suggestion, I will check that. Shouldn't there be nil check here? https://github.com/open-telemetry/opentelemetry-go/blob/main/exporters/otlp/otlptrace/internal/tracetransform/span.go#L47 |
Usually, a provider with a nil resource would be considered an error. There should always be one, even if it's empty. |
@0michalsokolowski0 Any update? |
|
Can you please provide a working example? |
No, I cannot. It randomly killed two pods out of N and happened at least once.
Triggering this seems like the easiest way to reproduce it to me. |
Have you tried it? I do not think it is possible in the latest version. |
I am afraid I don't follow. |
I have finally found the bug. See bb0f44f. Thanks for reporting 👍 |
Description
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x78 pc=0xb7e584]
goroutine 46 [running]:
go.opentelemetry.io/otel/sdk/trace.(*forceFlushSpan).Resource(0x1217600?)
:1 +0x24
go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform.Spans({0xc0002d6000, 0x2, 0xc0000966c0?})
/go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlptrace@v1.16.0/internal/tracetransform/span.go:47 +0x183
go.opentelemetry.io/otel/exporters/otlp/otlptrace.(*Exporter).ExportSpans(0xc0000a9d10, {0x164ebf0, 0xc003d17650}, {0xc0002d6000?, 0xc0002d9160?, 0xc00081ec00?})
/go/pkg/mod/go.opentelemetry.io/otel/exporters/otlp/otlptrace@v1.16.0/exporter.go:44 +0x3a
go.opentelemetry.io/otel/sdk/trace.(*batchSpanProcessor).exportSpans(0xc0002072c0, {0x164eb80, 0xc0039680f0?})
/go/pkg/mod/go.opentelemetry.io/otel/sdk@v1.16.0/trace/batch_span_processor.go:269 +0x264
go.opentelemetry.io/otel/sdk/trace.(*batchSpanProcessor).drainQueue(0xc0002072c0)
/go/pkg/mod/go.opentelemetry.io/otel/sdk@v1.16.0/trace/batch_span_processor.go:330 +0x275
go.opentelemetry.io/otel/sdk/trace.NewBatchSpanProcessor.func1()
/go/pkg/mod/go.opentelemetry.io/otel/sdk@v1.16.0/trace/batch_span_processor.go:129 +0x6f
created by go.opentelemetry.io/otel/sdk/trace.NewBatchSpanProcessor
/go/pkg/mod/go.opentelemetry.io/otel/sdk@v1.16.0/trace/batch_span_processor.go:126 +0x2ea
Environment
Expected behavior
No panic.
The text was updated successfully, but these errors were encountered: