diff --git a/libbeat/cmd/instance/beat.go b/libbeat/cmd/instance/beat.go index 19a233ba3cb8..e6596106b83c 100644 --- a/libbeat/cmd/instance/beat.go +++ b/libbeat/cmd/instance/beat.go @@ -1039,7 +1039,7 @@ func (b *Beat) registerESVersionCheckCallback() error { esVersion := conn.GetVersion() beatVersion, err := libversion.New(b.Info.Version) if err != nil { - return fmt.Errorf("error fetching version from elasticsearch") + return fmt.Errorf("error fetching version from elasticsearch: %w", err) } if esVersion.LessThanMajorMinor(beatVersion) { return fmt.Errorf("%w ES=%s, Beat=%s", elasticsearch.ErrTooOld, esVersion.String(), b.Info.Version)