Can't upgrade from 11.0.6 to 11.0.8 - /seahub/media/avatars/*': No such file or directory

Hi,

i just tried to upgrade my docker seafile from 11.0.6 to 11.0.8 and got this error.

[upgrade]: The container was recreated, start fix the media symlinks
mv: cannot stat '/opt/seafile/seafile-server-11.0.6/seahub/media/avatars/*': No such file or directory
Traceback (most recent call last):
  File "/scripts/start.py", line 95, in <module>
    main()
  File "/scripts/start.py", line 61, in main
    check_upgrade()
  File "/scripts/upgrade.py", line 120, in check_upgrade
    fix_media_symlinks()
  File "/scripts/upgrade.py", line 104, in fix_media_symlinks
    call('mv -n %s/* %s' % (avatars_dir, dst_avatars_dir))
  File "/scripts/utils.py", line 70, in call
    return subprocess.check_call(*a, **kw)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'mv -n /opt/seafile/seafile-server-11.0.6/seahub/media/avatars/* /shared/seafile/seahub-data/avatars' returned non-zero exit status 1.
*** Shutting down /scripts/enterpoint.sh (PID 25)...
*** Shutting down runit daemon (PID 24)...
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
*** Init system aborted.
*** Killing all processes...

what is the solution for the issue?

Fixed. While recreating the container its important to change the env entry to the right version. I think everyone will encounter this issue in some case. Is it possible to abandoned this flag?

Which flag do you mean?


SEAFILE_VERSION env entry. Forgetting to update the version number during an update can lead to issues. In my opinion, this flag is unnecessary and can cause problems if users are unaware of the need to change it. The version should be hardcoded in the container depending on its version.

Edit: Sorry i meant entry not flag.

Even though the flag might trigger this error, the root cause in my opinion is the very strange construction regarding the media / avatars folders. For me, it was easy to deploy Seafile in a Docker environment, but it was hours of work to find out why avatars were not displayed, and I have to manually re-copy files and correct folder permissions after every update. So I would strongly wish for a revision of whatever makes this so special in contrast to all other data/database storage.

Just a selection of years-long problems with avatars, which in my opinion should not at all be an isolated factor that could cause any trouble: