Impact
When storage is configured for the Filebeat OTel receiver but the corresponding extension is not present, startup failure is silently swallowed. The receiver reports successful Start() (nil), so the collector can keep running while ingestion never starts.
This is user-impacting because a misconfigured deployment appears healthy at startup and only emits logs, instead of failing fast.
Reproduction Steps
- Create a new test file at
/tmp/gh-aw/agent/repro_start_swallow_test.go with the code in Failing Test below.
- Copy it into the package under test:
cp /tmp/gh-aw/agent/repro_start_swallow_test.go x-pack/filebeat/fbreceiver/zz_repro_start_swallow_test.go
- Run:
go test ./x-pack/filebeat/fbreceiver -run TestReproStartShouldFailWhenStorageExtensionMissing -count=1
Expected vs Actual
Expected: Start() returns an error because storage: elasticsearch_storage is configured but the extension is missing on the host.
Actual: Start() returns nil, and the test fails with:
--- FAIL: TestReproStartShouldFailWhenStorageExtensionMissing (0.06s)
zz_repro_start_swallow_test.go:33:
Error: An error is expected but got nil.
Messages: expected Start to fail when storage extension is configured but missing
FAIL
FAIL github.com/elastic/beats/v7/x-pack/filebeat/fbreceiver 0.092s
Failing Test
package fbreceiver
import (
"testing"
"github.com/elastic/beats/v7/x-pack/otel/oteltest"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/receiver"
"go.uber.org/zap"
)
func TestReproStartShouldFailWhenStorageExtensionMissing(t *testing.T) {
cfg := &Config{Beatconfig: map[string]any{
"filebeat": map[string]any{"inputs": []map[string]any\{\{
"type": "benchmark", "enabled": true, "message": "x", "count": 1,
}}},
"storage": "elasticsearch_storage",
"path.home": t.TempDir(),
}}
factory := NewFactoryWithSettings(Settings{Home: t.TempDir()})
set := receiver.Settings{
ID: component.NewIDWithName(factory.Type(), "r1"),
TelemetrySettings: component.TelemetrySettings{Logger: zap.NewNop()},
}
r, err := factory.CreateLogs(t.Context(), set, cfg, consumertest.NewNop())
require.NoError(t, err)
err = r.Start(t.Context(), &oteltest.MockHost{})
require.Error(t, err, "expected Start to fail when storage extension is configured but missing")
_ = r.Shutdown(t.Context())
}
Evidence
x-pack/filebeat/fbreceiver/receiver.go:23-33 returns nil from Start() immediately and only logs errors from BeatReceiver.Start(host) in a goroutine.
x-pack/libbeat/cmd/instance/receiver.go:149-158 now returns a hard error when configured storage extension lookup fails (error getting ES state store extension).
- This mismatch makes startup errors observable in logs but not propagated to receiver startup callers.
What is this? | From workflow: Bug Hunter
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Impact
When
storageis configured for the Filebeat OTel receiver but the corresponding extension is not present, startup failure is silently swallowed. The receiver reports successfulStart()(nil), so the collector can keep running while ingestion never starts.This is user-impacting because a misconfigured deployment appears healthy at startup and only emits logs, instead of failing fast.
Reproduction Steps
/tmp/gh-aw/agent/repro_start_swallow_test.gowith the code in Failing Test below.cp /tmp/gh-aw/agent/repro_start_swallow_test.go x-pack/filebeat/fbreceiver/zz_repro_start_swallow_test.gogo test ./x-pack/filebeat/fbreceiver -run TestReproStartShouldFailWhenStorageExtensionMissing -count=1Expected vs Actual
Expected:
Start()returns an error becausestorage: elasticsearch_storageis configured but the extension is missing on the host.Actual:
Start()returnsnil, and the test fails with:Failing Test
Evidence
x-pack/filebeat/fbreceiver/receiver.go:23-33returnsnilfromStart()immediately and only logs errors fromBeatReceiver.Start(host)in a goroutine.x-pack/libbeat/cmd/instance/receiver.go:149-158now returns a hard error when configured storage extension lookup fails (error getting ES state store extension).What is this? | From workflow: Bug Hunter
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.