You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to set filelog receiver to delete_after_read, I get the panic runtime error described here.
Steps to Reproduce
Just run the app container (loki in this case), and docker.io/otel/opentelemetry-collector-contrib next to it, with an access to the volume where 1st container writes it's logs (/var/log/loki in this case).
Expected Result
otel collector to read content of every /var/log/loki/loki.log and delete that file when processed.
Actual Result
otel collector encounters an error (output copied below) and deletes the log file (which is probably the root cause for the repeated warn messages).
Note
The setup works before adding filelog.allowFileDeletion feature gate and:
2024-02-23T13:53:47.886Z warn localhostgate/featuregate.go:63 The default endpoints forall serversin components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default. {"feature gate ID": "component.UseLocalHostAsDefaultHost"}
2024-02-23T13:53:48.286Z warn fileconsumer/file.go:132 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x41d3ddc]
goroutine 115 [running]:
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/reader.(*Reader).ReadToEnd(0xc002a7ff10, {0x9191978, 0xc0029d3860})
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.95.0/fileconsumer/internal/reader/reader.go:49 +0x3c
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer.(*Manager).preConsume.func1(0xc0029d3720?)
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.95.0/fileconsumer/file_other.go:47 +0x51
created by github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer.(*Manager).preConsume in goroutine 96
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza@v0.95.0/fileconsumer/file_other.go:45 +0x193
2024-02-23T13:53:48.785Z warn fileconsumer/file.go:46 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
2024-02-23T13:53:48.786Z warn localhostgate/featuregate.go:63 The default endpoints forall serversin components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default. {"feature gate ID": "component.UseLocalHostAsDefaultHost"}
2024-02-23T13:53:48.986Z warn fileconsumer/file.go:132 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
2024-02-23T13:53:49.186Z warn fileconsumer/file.go:132 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
2024-02-23T13:53:49.386Z warn fileconsumer/file.go:132 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
2024-02-23T13:53:49.586Z warn fileconsumer/file.go:132 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
2024-02-23T13:53:49.787Z warn fileconsumer/file.go:132 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
2024-02-23T13:53:49.987Z warn fileconsumer/file.go:132 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
2024-02-23T13:53:50.186Z warn fileconsumer/file.go:132 finding files: no files match the configured criteria {"kind": "receiver", "name": "filelog", "data_type": "logs", "component": "fileconsumer"}
Additional context
No response
The text was updated successfully, but these errors were encountered:
Component(s)
receiver/filelog
What happened?
Description
Trying to set filelog receiver to
delete_after_read
, I get the panic runtime error described here.Steps to Reproduce
Just run the app container (loki in this case), and docker.io/otel/opentelemetry-collector-contrib next to it, with an access to the volume where 1st container writes it's logs (
/var/log/loki
in this case).Expected Result
otel collector to read content of every
/var/log/loki/loki.log
and delete that file when processed.Actual Result
otel collector encounters an error (output copied below) and deletes the log file (which is probably the root cause for the repeated
warn
messages).Note
The setup works before adding
filelog.allowFileDeletion
feature gate and:Collector version
0.95.0
Environment information
Environment
OS: Rocky 9
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: