From b54ae2105664aa8cd9091bf5fc7709cb60974520 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Thu, 12 May 2022 09:11:45 +0100 Subject: [PATCH 1/2] agent: fix panic when logging about protocol version config use. The log line comes before the agent logger has been setup, therefore we need to use the UI logging to avoid panic. --- command/agent/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/agent/command.go b/command/agent/command.go index 74cbb7ef0127..42aa4a553a40 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -436,7 +436,7 @@ func (c *Command) IsValidConfig(config, cmdConfig *Config) bool { // ProtocolVersion has never been used. Warn if it is set as someone // has probably made a mistake. if config.Server.ProtocolVersion != 0 { - c.agent.logger.Warn("Please remove deprecated protocol_version field from config.") + c.Ui.Warn("Please remove deprecated protocol_version field from config.") } return true From b85e15c73823f9669170902c6962be6d9044f7ac Mon Sep 17 00:00:00 2001 From: James Rasell Date: Thu, 12 May 2022 09:39:12 +0100 Subject: [PATCH 2/2] changelog: add entry for #12962 --- .changelog/12962.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/12962.txt diff --git a/.changelog/12962.txt b/.changelog/12962.txt new file mode 100644 index 000000000000..d8a2e2c81a83 --- /dev/null +++ b/.changelog/12962.txt @@ -0,0 +1,3 @@ +```release-note:bug +agent: fixed a panic on startup when the `server.protocol_version` config parameter was set +```