diff --git a/.changelog/11353.txt b/.changelog/11353.txt new file mode 100644 index 000000000000..b519e599d49e --- /dev/null +++ b/.changelog/11353.txt @@ -0,0 +1,3 @@ +```release-note:improvement +agent: Log the cause of failure if agent failed to start +``` diff --git a/command/agent/command.go b/command/agent/command.go index f803d880b45b..558e63ee120e 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -492,6 +492,8 @@ func (c *Command) setupAgent(config *Config, logger hclog.InterceptLogger, logOu c.Ui.Output("Starting Nomad agent...") agent, err := NewAgent(config, logger, logOutput, inmem) if err != nil { + // log the error as well, so it appears at the end + logger.Error("error starting agent", "error", err) c.Ui.Error(fmt.Sprintf("Error starting agent: %s", err)) return err }