Werk #15421: Improve agent updater logging

Component Agent bakery
Title Improve agent updater logging
Date Mar 23, 2023
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.3.0b1 Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.2.0b1 Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.1.0p26 Checkmk Enterprise (CEE), Checkmk MSP (CME)

Previously, the agent updater reported many errors coming from the agent bakery with this unhelpful log output:

Unexpected answer from Checkmk server: Missing json data.
Maybe we are talking to an agent bakery from before Checkmk 2.0?

This happened for all errors that can not be interpreted by the agent bakery in a meaningful way.

Starting with this Werk, the agent updater will instead propagate the unknown error, e.g.:

Agent Bakery: Unhandled exception: KeyError: 'Signatures'
See ~/var/log/web.log on site 'mysite' for details.

As a last resort, if the agent updater still receives a response that it can't parse, it will still log Unexpected answer from Checkmk server: Missing json data., but this time without the note about an old agent bakery, as this was not helpful at all.

Bonus:
The error from the above example is now handled correctly:

The deployment server provides an agent but that is not signed.

To the list of all Werks