Seahub is crashing (cannot remove avatars)

Hello,

I’ve a problem with the restart of my seafile server. The Migration from an older version works, but with the following error:

migrating avatars …
rm: cannot remove ‘/opt/seafile/seafile-pro-server-9.0.16/seahub/media/avatars’: Directory not empty
ln: failed to create symbolic link ‘/opt/seafile/seafile-pro-server-9.0.16/seahub/media/avatars’: File exists

If i now restart the container, seahub is crashing.

[04/25/2023 08:45:36][upgrade]: The container was recreated, start fix the media symlinks
rm: cannot remove ‘/opt/seafile/seafile-pro-server-9.0.16/seahub/media/avatars’: Directory not empty
[2023-04-25 08:45:36] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.
Traceback (most recent call last):
File “/scripts/start.py”, line 95, in
main()
File “/scripts/start.py”, line 61, in main
check_upgrade()
File “/scripts/upgrade.py”, line 95, in check_upgrade
fix_media_symlinks()
File “/scripts/upgrade.py”, line 80, in fix_media_symlinks
call(‘rm -rf %s’ % avatars_dir)
File “/scripts/utils.py”, line 70, in call
return subprocess.check_call(*a, **kw)
File “/usr/lib/python3.8/subprocess.py”, line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘rm -rf /opt/seafile/seafile-pro-server-9.0.16/seahub/media/avatars’ returned non-zero exit status 1.

If i downgrade now to an older version, or upgrade, seahub is starting fine with the above error, but not when i normally restart the container. How can i fix this?

I have the same issue, but I wasn’t upgrading. I simply upgraded my MariaDB container for a minor version upgrade. I’m running Seafile Server 9.0.9 Community.