diff --git a/x-pack/elastic-agent/pkg/agent/application/application.go b/x-pack/elastic-agent/pkg/agent/application/application.go index c13157e02f52..c88cca8fc3c6 100644 --- a/x-pack/elastic-agent/pkg/agent/application/application.go +++ b/x-pack/elastic-agent/pkg/agent/application/application.go @@ -78,6 +78,9 @@ func createApplication( // not in standalone; both modes require reading the fleet.yml configuration file var store storage.Store store, cfg, err = mergeFleetConfig(rawConfig) + if err != nil { + return nil, err + } if IsFleetServerBootstrap(cfg.Fleet) { log.Info("Agent is in Fleet Server bootstrap mode")