Upgrade docker from 2.2p29 to 2.3p8 fails with stacktrace

Hi,
when I try to upgrade my docker image from ‘checkmk/check-mk-raw:2.2.0-latest’ to ‘checkmk/check-mk-raw:2.3.0-latest’ I got the following stacktrace:

checkmk  | ### UPDATING SITE
checkmk  | Saving temporary filesystem contents...OK
checkmk  | Cleaning up tmp directory...OK
checkmk  | 2024-07-04 08:18:01 - Updating site 'mva' from version 2.2.0p29.cre to 2.3.0p8.cre...
checkmk  | 
checkmk  | Traceback (most recent call last):
checkmk  |   File "/usr/bin/omd", line 53, in <module>
checkmk  |     omdlib.main.main()
checkmk  |   File "/omd/versions/2.3.0p8.cre/lib/python3/omdlib/main.py", line 4799, in main
checkmk  |     command.handler(version_info, site, global_opts, args, command_options)
checkmk  |   File "/omd/versions/2.3.0p8.cre/lib/python3/omdlib/main.py", line 2989, in main_update
checkmk  |     with ManageUpdate(
checkmk  |   File "/omd/versions/2.3.0p8.cre/lib/python3/omdlib/update.py", line 181, in __enter__
checkmk  |     store(self.site_dir, relpath, self.backup_dir)
checkmk  |   File "/omd/versions/2.3.0p8.cre/lib/python3/omdlib/update.py", line 29, in store
checkmk  |     shutil.copy2(source, destination)
checkmk  |   File "/omd/versions/2.3.0p8.cre/lib/python3.12/shutil.py", line 475, in copy2
checkmk  |     copyfile(src, dst, follow_symlinks=follow_symlinks)
checkmk  |   File "/omd/versions/2.3.0p8.cre/lib/python3.12/shutil.py", line 262, in copyfile
checkmk  |     with open(dst, 'wb') as fdst:
checkmk  |          ^^^^^^^^^^^^^^^
checkmk  | FileNotFoundError: [Errno 2] No such file or directory: '/omd/sites/mva/.update_backup/var/check_mk/core/config'

I was able to save the .update-backup folder and found out that the folder ‘.update_backup/var/check_mk/core’ was not created.
My ‘/opt/omd/sites’ volume is linked to a real folder outside of the container.
Do I have to prepare something before I can upgrade?

Hello
I have exactly the same error when updating from 2.2.0p30.cre to version 2.3.0p9.cre. However, I am not using a Docker container but Ubuntu 24.04. I have already tried the whole thing with different Checkmk 2.2.0pXX versions but always got this error. I already had this error when I was still on Ubuntu 22.04. No idea why it doesn’t create the core folder in the backup. So the problem exists not only with Docker installations but also with normal Debian based installations. I have also created a complete backup of the site with omd backup and tested this on a fresh Ubuntu 22.04 / 24.04 VM with the same result. If there is a way to skip the backup part of the update, this would be an acceptable workaround for me. I make a VM snapshot myself before the update and as an emergency I would have complete VM backups.

Traceback (most recent call last):
  File "/omd/versions/2.3.0p9.cre/bin/omd", line 53, in <module>
    omdlib.main.main()
  File "/omd/versions/2.3.0p9.cre/lib/python3/omdlib/main.py", line 4799, in main
    command.handler(version_info, site, global_opts, args, command_options)
  File "/omd/versions/2.3.0p9.cre/lib/python3/omdlib/main.py", line 2989, in main_update
    with ManageUpdate(
  File "/omd/versions/2.3.0p9.cre/lib/python3/omdlib/update.py", line 181, in __enter__
    store(self.site_dir, relpath, self.backup_dir)
  File "/omd/versions/2.3.0p9.cre/lib/python3/omdlib/update.py", line 29, in store
    shutil.copy2(source, destination)
  File "/omd/versions/2.3.0p9.cre/lib/python3.12/shutil.py", line 475, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/omd/versions/2.3.0p9.cre/lib/python3.12/shutil.py", line 262, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/omd/sites/IT/.update_backup/var/check_mk/core/config'

I found the solution; i had an (old) file called ‘config’ in var/check_mk/core. After deleting those file the upgrade works as expected. My config file was from 2021 and seems not longer be used anymore.
TL;DR
The update.py file tries to store the ‘var/check_mk/core/config’ file but fortunately the parent destination folder ‘core’ is not existing and neither the script itself nor the python function shutil.copy() is creating the parentfolder and so the update will of course fail.