Werk #16431: omd restore: Fix RuntimeError: Failed to determine site version

Component Site management
Title omd restore: Fix RuntimeError: Failed to determine site version
Date Jun 11, 2024
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.4.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p11 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.2.0p29 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

Due to a regression introduced by Werk #16422, the command omd restore <NEW_SITE> <ARCHIVE_PATH> could fail:

  File "/omd/versions/2.3.0p6.cee/lib/python3/omdlib/main.py", line 3522, in _restore_backup_from_tar
    old_site.replacements(),
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/omd/versions/2.3.0p6.cee/lib/python3/omdlib/contexts.py", line 136, in replacements
    raise RuntimeError("Failed to determine site version")

The failure only occured, if the user provided a site name, which differed from the original name, and the original site did no longer exist. This crash also affected the Migrate existing Site function of the appliance.

If you are affected by this crash, but are unable to update, then you can start be restoring the site without a new name. The site can then be renamed with omd mv.

To the list of all Werks