Werk #19884: Fix crash in REST API host endpoints when inventory data is JSON-encoded
| Component | REST API | ||
| Title | Fix crash in REST API host endpoints when inventory data is JSON-encoded | ||
| Date | Jul 8, 2026 | ||
| Level | Trivial Change | ||
| Class | Bug Fix | ||
| Compatibility | Compatible - no manual interaction needed | ||
| Checkmk versions & editions |
|
Since Werk #18032, inventory trees are saved as JSON. However, some hosts may still have inventory data stored in the older Python-repr format.
The REST API host endpoints (cmk/list and cmk/show) always parsed the
mk_inventory column with ast.literal_eval, which cannot handle JSON's
true/false/null literals. As a result, requesting this column crashed for
hosts whose inventory data was already stored as JSON.
The endpoints now understand both formats: they first try to parse the column as
JSON, and only fall back to ast.literal_eval for hosts that still carry
inventory data in the legacy Python-repr format.