Page MenuHomeVyOS Platform

`add system image` doesnt properly preserve user/group on files and directories when copy from old to new persistent directory
Open, Requires assessmentPublicBUG

Description

First bug...

When upgrading from VyOS Stream 2026.03 to 2026.11.

add system image doesnt properly preserve user/group on files and directories when copy from old to new persistent directory:

root@vyos:~# ls -la /usr/lib/live/mount/persistence/boot/2026.03/rw/opt/vyatta/etc/config/container/checkmk/LAB
total 48
drwxr-x--x 10 radius_user tacacs    4096 Nov 30 16:51 .
drwxr-sr-x  3 vyos        vyattacfg 4096 Nov  1 15:50 ..
-rw-r-----  1 radius_user tacacs    1091 Nov  1 15:50 .bashrc
lrwxrwxrwx  1 radius_user tacacs      11 Nov  1 15:50 bin -> version/bin
drwxr-x---  2 radius_user tacacs    4096 Nov  1 15:50 .cache
drwxr-x--x 25 radius_user tacacs    4096 Nov 30 18:19 etc
lrwxrwxrwx  1 radius_user tacacs      15 Nov  1 15:50 include -> version/include
lrwxrwxrwx  1 radius_user tacacs      11 Nov  1 15:50 lib -> version/lib
drwxr-x---  5 radius_user tacacs    4096 Nov  1 15:50 local
-rw-r-----  1 radius_user tacacs    3223 Nov  1 15:50 .profile
drwxr-x---  2 radius_user tacacs    4096 Nov  1 15:50 .restore_working_dir
drwx------  2 radius_user tacacs    4096 Nov  8 04:32 .rpmdb
lrwxrwxrwx  1 radius_user tacacs      13 Nov  1 15:50 share -> version/share
drwxr-sr-t  2 root        vyattacfg 4096 Nov  1 15:50 tmp
drwxr-x--- 14 radius_user tacacs    4096 Nov  2 00:00 var
lrwxrwxrwx  1 radius_user tacacs      27 Nov 30 16:51 version -> ../../versions/2.5.0p22.pro
drwx------  3 radius_user tacacs    4096 Nov 30 16:51 .version_meta
root@vyos:~# ls -la /usr/lib/live/mount/persistence/boot/2026.11/rw/opt/vyatta/etc/config/container/checkmk/LAB
total 48
drwxr-x--x 10 root        vyattacfg 4096 Nov 30 16:51 .
drwxr-sr-x  3 root        vyattacfg 4096 Nov  1 15:50 ..
-rw-r-----  1 radius_user vyattacfg 1091 Nov 30 18:26 .bashrc
lrwxrwxrwx  1 root        vyattacfg   11 Nov  1 15:50 bin -> version/bin
drwxr-x---  2 root        vyattacfg 4096 Nov  1 15:50 .cache
drwxr-x--x 25 root        vyattacfg 4096 Nov 30 18:29 etc
lrwxrwxrwx  1 root        vyattacfg   15 Nov  1 15:50 include -> version/include
lrwxrwxrwx  1 root        vyattacfg   11 Nov  1 15:50 lib -> version/lib
drwxr-x---  5 root        vyattacfg 4096 Nov  1 15:50 local
-rw-r-----  1 radius_user vyattacfg 3223 Nov 30 18:26 .profile
drwxr-x---  2 root        vyattacfg 4096 Nov  1 15:50 .restore_working_dir
drwx------  2 root        vyattacfg 4096 Nov  8 04:32 .rpmdb
lrwxrwxrwx  1 root        vyattacfg   13 Nov  1 15:50 share -> version/share
drwxr-sr-t  2 root        vyattacfg 4096 Nov  1 15:50 tmp
drwxr-x--- 14 root        vyattacfg 4096 Nov  2 00:00 var
lrwxrwxrwx  1 root        vyattacfg   27 Nov 30 16:51 version -> ../../versions/2.5.0p22.pro
drwx------  3 root        vyattacfg 4096 Nov 30 16:51 .version_meta

Note to self, I should define user/group in the container config but even so a system upgrade shouldnt break permissions.

Details

Version
Stream 2026.11
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)
Forum thread
https://forum.vyos.io/t/psa-vyos-stream-2026-11-have-been-released/17800

Event Timeline

I tried this as workaround:

rm -rf /config/container
cp -a /usr/lib/live/mount/persistence/boot/2026.03/rw/opt/vyatta/etc/config/container/ .

Now Im getting a different error from the CheckMK container (running 2.5.0p22):

Nov 30 19:24:16 vyos checkmk[11363]: ### STARTING SITE
Nov 30 19:24:17 vyos checkmk[11363]: Traceback (most recent call last):
Nov 30 19:24:17 vyos checkmk[11363]:   File "/usr/bin/omd", line 54, in <module>
Nov 30 19:24:17 vyos checkmk[11363]:     omdlib.main.main()
Nov 30 19:24:17 vyos checkmk[11363]:     ~~~~~~~~~~~~~~~~^^
Nov 30 19:24:17 vyos checkmk[11363]:   File "/omd/versions/2.5.0p22.pro/lib/python3/omdlib/main.py", line 3363, in main
Nov 30 19:24:17 vyos checkmk[11363]:     _run_command(command, site, global_opts, args, options)
Nov 30 19:24:17 vyos checkmk[11363]:     ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 30 19:24:17 vyos checkmk[11363]:   File "/omd/versions/2.5.0p22.pro/lib/python3/omdlib/main.py", line 3301, in _run_command
Nov 30 19:24:17 vyos checkmk[11363]:     main_init_action(version_info, site, global_opts, "start", args, command_options)
Nov 30 19:24:17 vyos checkmk[11363]:     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 30 19:24:17 vyos checkmk[11363]:   File "/omd/versions/2.5.0p22.pro/lib/python3/omdlib/main.py", line 2687, in main_init_action
Nov 30 19:24:17 vyos checkmk[11363]:     exit_status = init_action(version_info, site, config, global_opts, command, args, options)
Nov 30 19:24:17 vyos checkmk[11363]:   File "/omd/versions/2.5.0p22.pro/lib/python3/omdlib/main.py", line 1673, in init_action
Nov 30 19:24:17 vyos checkmk[11363]:     prepare_and_populate_tmpfs(
Nov 30 19:24:17 vyos checkmk[11363]:     ~~~~~~~~~~~~~~~~~~~~~~~~~~^
Nov 30 19:24:17 vyos checkmk[11363]:         config,
Nov 30 19:24:17 vyos checkmk[11363]:         ^^^^^^^
Nov 30 19:24:17 vyos checkmk[11363]:     ...<6 lines>...
Nov 30 19:24:17 vyos checkmk[11363]:         skelroot,
Nov 30 19:24:17 vyos checkmk[11363]:         ^^^^^^^^^
Nov 30 19:24:17 vyos checkmk[11363]:     )
Nov 30 19:24:17 vyos checkmk[11363]:     ^
Nov 30 19:24:17 vyos checkmk[11363]:   File "/omd/versions/2.5.0p22.pro/lib/python3/omdlib/tmpfs.py", line 304, in prepare_and_populate_tmpfs
Nov 30 19:24:17 vyos checkmk[11363]:     create_skeleton_files(site_home, replacements, skelroot, skel_permissions, "tmp")
Nov 30 19:24:17 vyos checkmk[11363]:     ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 30 19:24:17 vyos checkmk[11363]:   File "/omd/versions/2.5.0p22.pro/lib/python3/omdlib/utils.py", line 122, in create_skeleton_files
Nov 30 19:24:17 vyos checkmk[11363]:     create_skeleton_file(
Nov 30 19:24:17 vyos checkmk[11363]:     ~~~~~~~~~~~~~~~~~~~~^
Nov 30 19:24:17 vyos checkmk[11363]:         skelroot, site_dir, dirpath + "/" + entry, replacements, skel_permissions
Nov 30 19:24:17 vyos checkmk[11363]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 30 19:24:17 vyos checkmk[11363]:     )
Nov 30 19:24:17 vyos checkmk[11363]:     ^
Nov 30 19:24:17 vyos checkmk[11363]:   File "/omd/versions/2.5.0p22.pro/lib/python3/omdlib/utils.py", line 96, in create_skeleton_file
Nov 30 19:24:17 vyos checkmk[11363]:     user_path.mkdir(parents=True)
Nov 30 19:24:17 vyos checkmk[11363]:     ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
Nov 30 19:24:17 vyos checkmk[11363]:   File "/omd/versions/2.5.0p22.pro/lib/python3.13/pathlib/_local.py", line 722, in mkdir
Nov 30 19:24:17 vyos checkmk[11363]:     os.mkdir(self, mode)
Nov 30 19:24:17 vyos checkmk[11363]:     ~~~~~~~~^^^^^^^^^^^^
Nov 30 19:24:17 vyos checkmk[11363]: PermissionError: [Errno 13] Permission denied: '/omd/sites/LAB/tmp/nagvis'
Nov 30 19:24:17 vyos conmon[11363]: conmon f1778395bc78e077771b <nwarn>: stdio_input read failed Input/output error

Container config is unchanged in VyOS between 2026.03 and 2026.11:

set container name checkmk allow-host-networks
set container name checkmk capability 'net-raw'
set container name checkmk environment CMK_PASSWORD value 'CHANGEME'
set container name checkmk environment CMK_SITE_ID value 'LAB'
set container name checkmk environment TZ value 'Europe/Stockholm'
set container name checkmk image 'docker.io/checkmk/check-mk-pro:2.5.0p22'
set container name checkmk memory '8192'
set container name checkmk restart 'on-failure'
set container name checkmk tmpfs tmp destination '/opt/omd/sites/LAB/tmp'
set container name checkmk tmpfs tmp size '2048'
set container name checkmk volume monitoring destination '/omd/sites'
set container name checkmk volume monitoring source '/config/container/checkmk'

Should I use different "cp" syntax?

As it seems workaround that also solved the tmpfs issue:

rm -rf /config/container
cp -a /usr/lib/live/mount/persistence/boot/2026.03/rw/opt/vyatta/etc/config/container/ .
rm -rf /config/container/checkmk/LAB/tmp

And then restart the container (there is probably a better way?)

conf
set container name checkmk disable
commit
del container name checkmk disable
commit
save
exit

Check logs using monitor log container checkmk.

Ok this is a bit odd...

I removed the tmp-dir and started the container and the container was happy.

I can see that it now created the tmp directory on its own:

drwxr-xr-x  2 root        root      4096 Nov 30 19:48 tmp

But comparing with how this looked in 2026.03 there is a difference:

drwxr-sr-t  2 root        vyattacfg 4096 Nov  1 15:50 tmp

So I then restart VyOS and now the container fails to start until I manually remove that tmp-dir again.

I tried to "cp -a" just the original tmp-directory aswell as after copying it change it to "root:root" as permission but still no go.

So anyone with any ideas on what is going on?

It seems to be related to tmpfs where it works if I delete the /config/container/checkmk/LAB/tmp directory before container starts.

But if this directory somehow already exists the container will fail to start...

I filed that tmpfs issue as separate task at T9745.