[pkg/stanza][receiver/filelog] panic: assignment to entry in nil map
when upgrading from v0.71.0
to v0.91.0
#30235
Labels
panic: assignment to entry in nil map
when upgrading from v0.71.0
to v0.91.0
#30235
Component(s)
pkg/stanza, receiver/filelog
What happened?
Description
When using the Filelog receiver with File Storage extension, upgrading the collector from
v0.71.0
tov0.91.0
results in a panic.Steps to Reproduce
receiver_filelog_panic
if it exists:rm ./receiver_filelog_panic
v0.71.0
with the below configuration, make sure the Filelog receiver reads thelogs.log
file and writes the metadata to the file storage. Stop the collector.v0.91.0
with the same configuration.Expected Result
Collector
v0.91.0
picks up the data from file storage and continues to watch the logs file.Actual Result
Collector
v0.91.0
crashes with a panic, see below for the logs output.Collector version
v0.91.0
Environment information
No response
OpenTelemetry Collector configuration
Log output
Additional context
It seems that running
v0.81.0
betweenv0.71.0
andv0.91.0
fixes the issue.From a quick look, it seems that this could be fixed by the checkpoint package verifying that the
reader.Metadata
structure is properly initialized before returning it in theLoad
function: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.91.0/pkg/stanza/fileconsumer/internal/checkpoint/checkpoint.go#L68?The text was updated successfully, but these errors were encountered: