fix(filer.meta.tail): fail fast when -es is used without elastic build tag (#9191)

fix(filer.meta.tail): error instead of silently dropping events when -es is used without elastic build tag

The default chrislusf/seaweedfs image builds without the `elastic` build
tag, so sendToElasticSearchFunc was a no-op that returned a function
discarding every event. Users passing -es saw the subscription wire up
in filer logs but nothing ever reached Elasticsearch.

Return an error explaining the binary wasn't built with ES support and
pointing at the build flag. The caller already prints the error and
exits, so users now get an immediate, actionable message.

Fixes #9190
This commit is contained in:
Chris Lu authored and GitHub committed 2026-04-22 09:44:43 -07:00
1 parent 1220468a33
commit 0f5e99f423
1 file changed
+3 -3
+3 -3
View File
@@ -3,11 +3,11 @@
package command
import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
func sendToElasticSearchFunc(servers string, esIndex string) (func(resp *filer_pb.SubscribeMetadataResponse) error, error) {
return func(resp *filer_pb.SubscribeMetadataResponse) error {
return nil
}, nil
return nil, fmt.Errorf("this weed binary was built without Elasticsearch support. Rebuild with `-tags elastic` (see docker/Dockerfile.go_build) to use -es/-es.index")
}