Seafile errors while trying to fix media symlinks

i’m currently running v13.0.9 but this was happening in v12.0.14 too.

i also have an NFS share mounted at /shared inside the seafile container, could that be the cause?

seafile-1  | *** Running /etc/my_init.d/01_create_data_links.sh...
seafile-1  | rm: cannot remove '/var/log': Directory not empty
seafile-1  | *** Booting runit daemon...
seafile-1  | *** Runit started as PID 19
seafile-1  | *** Running /scripts/enterpoint.sh...
seafile-1  | 2025-09-09 19:17:40 Nginx ready
seafile-1  | 2025-09-09 19:17:40 This is an idle script (infinite loop) to keep container running.
seafile-1  | [2025-09-09 19:17:40] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.
seafile-1  | [09/09/2025 19:17:40][upgrade]: The container was recreated, start fix the media symlinks
seafile-1  | mv: not replacing '/shared/seafile/seahub-data/avatars/default-non-register.jpg'
seafile-1  | mv: not replacing '/shared/seafile/seahub-data/avatars/default.png'
seafile-1  | mv: not replacing '/shared/seafile/seahub-data/avatars/groups'
seafile-1  | rm: cannot remove '/opt/seafile/seafile-server-13.0.9/seahub/media/avatars': Directory not empty
seafile-1  | Traceback (most recent call last):
seafile-1  |   File "/scripts/start.py", line 94, in <module>
seafile-1  |     main()
seafile-1  |   File "/scripts/start.py", line 61, in main
seafile-1  |     check_upgrade()
seafile-1  |   File "/scripts/upgrade.py", line 120, in check_upgrade
seafile-1  |     fix_media_symlinks()
seafile-1  |   File "/scripts/upgrade.py", line 105, in fix_media_symlinks
seafile-1  |     call('rm -rf %s' % avatars_dir)
seafile-1  |   File "/scripts/utils.py", line 71, in call
seafile-1  |     return subprocess.check_call(*a, **kw)
seafile-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
seafile-1  |   File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
seafile-1  |     raise CalledProcessError(retcode, cmd)
seafile-1  | subprocess.CalledProcessError: Command 'rm -rf /opt/seafile/seafile-server-13.0.9/seahub/media/avatars' returned non-zero exit status 1.

here’s an alternate run where i’ve cleared out the contents of the avatars folder

seafile-1  | *** Running /etc/my_init.d/01_create_data_links.sh...
seafile-1  | rm: cannot remove '/var/log': Directory not empty
seafile-1  | *** Booting runit daemon...
seafile-1  | *** Runit started as PID 19
seafile-1  | *** Running /scripts/enterpoint.sh...
seafile-1  | 2025-09-09 19:42:45 Nginx ready
seafile-1  | 2025-09-09 19:42:45 This is an idle script (infinite loop) to keep container running.
seafile-1  | [2025-09-09 19:42:45] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.
seafile-1  | [09/09/2025 19:42:45][upgrade]: The container was recreated, start fix the media symlinks
seafile-1  | mv: cannot remove '/opt/seafile/seafile-server-13.0.9/seahub/media/avatars/groups': Invalid argument
seafile-1  | rm: cannot remove '/opt/seafile/seafile-server-13.0.9/seahub/media/avatars': Directory not empty
seafile-1  | Traceback (most recent call last):
seafile-1  |   File "/scripts/start.py", line 94, in <module>
seafile-1  |     main()
seafile-1  |   File "/scripts/start.py", line 61, in main
seafile-1  |     check_upgrade()
seafile-1  |   File "/scripts/upgrade.py", line 120, in check_upgrade
seafile-1  |     fix_media_symlinks()
seafile-1  |   File "/scripts/upgrade.py", line 105, in fix_media_symlinks
seafile-1  |     call('rm -rf %s' % avatars_dir)
seafile-1  |   File "/scripts/utils.py", line 71, in call
seafile-1  |     return subprocess.check_call(*a, **kw)
seafile-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
seafile-1  |   File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
seafile-1  |     raise CalledProcessError(retcode, cmd)
seafile-1  | subprocess.CalledProcessError: Command 'rm -rf /opt/seafile/seafile-server-13.0.9/seahub/media/avatars' returned non-zero exit status 1.

turns out it’s probably because i installed zfs as root on my debian machine. (see XiMA4’s reply in redd.it 10c36u8) and my zfs version (2.1.11-deb12u1) does not (fully?) support overlay2. weirdly it manages to host other docker containers just fine.

Haha, another one for my list of issues caused by the weird handling of avatars in the Seafile installation … Can't upgrade from 11.0.6 to 11.0.8 - /seahub/media/avatars/*': No such file or directory - #5 by mehlkopf