Found some possible bugs in seafile 12.06

I think I have found some bugs in seafile 12.06. I will post them as separate topics to keep things from getting confused. First some background; I am not familiar with docker, so I did some test deployments as a new install to get a sense of how things are supposed to work. Then I tried to clone existing seafile server (version 11.0.13, not docker) and upgrade the clone to the new version 12 docker.

I plan to make a post with my complete upgrade process later because it might help other people, so if you need additional information, I can reproduce these bugs to get more logs or whatever.

First bug-
The permissions are not set correctly on the log directory when it is created, causing failures to start the seafile service. This happens when using NON_ROOT=true. Here is the log:

seafile                | *** Running /etc/my_init.d/01_create_data_links.sh...
seafile                | *** Booting runit daemon...
seafile                | *** Runit started as PID 14
seafile                | *** Running /scripts/enterpoint.sh...
seafile                | 2024-12-23 04:19:58 Nginx ready 
seafile                | 2024-12-23 04:19:58 Create linux user seafile in container, please wait. 
seafile                | 2024-12-23 04:26:31 This is an idle script (infinite loop) to keep container running. 
seafile                | [2024-12-23 04:26:32] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.
seafile                | [2024-12-23 04:26:32] Running scripts /opt/seafile/seafile-server-12.0.6/upgrade/upgrade_11.0_12.0.sh
seafile                | [12/23/2024 04:26:32][upgrade]: Running script /opt/seafile/seafile-server-12.0.6/upgrade/upgrade_11.0_12.0.sh
seafile                | 
seafile                | -------------------------------------------------------------
seafile                | This script would upgrade your seafile server from 11.0 to 12.0
seafile                | Press [ENTER] to contiune
seafile                | -------------------------------------------------------------
seafile                | 
seafile                | 
seafile                | Updating seafile/seahub database ...
seafile                | 
seafile                | [INFO] You are using MySQL
seafile                | [INFO] updating seafile database...
seafile                | [INFO] updating seahub database...
seafile                | [INFO] updating seafevents database...
seafile                | Done
seafile                | 
seafile                | migrating avatars ...
seafile                | 
seafile                | Done
seafile                | 
seafile                | updating /opt/seafile/seafile-server-latest symbolic link to /opt/seafile/seafile-server-12.0.6 ...
seafile                | 
seafile                | 
seafile                | 
seafile                | -----------------------------------------------------------------
seafile                | Upgraded your seafile server successfully.
seafile                | -----------------------------------------------------------------
seafile                | 
seafile                | 
seafile                | Starting seafile server, please wait ...
seafile                | /opt/seafile/seafile-server-12.0.6/seafile.sh: line 178: /opt/seafile/logs/seafile-monitor.log: Permission denied
seafile                | Failed to start seafile server
seafile                | Traceback (most recent call last):
seafile                |   File "/scripts/start.py", line 94, in <module>
seafile                |     main()
seafile                |   File "/scripts/start.py", line 76, in main
seafile                |     call('su seafile -c "{} start"'.format(get_script('seafile.sh')))
seafile                |   File "/scripts/utils.py", line 70, in call
seafile                |     return subprocess.check_call(*a, **kw)
seafile                |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
seafile                |   File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
seafile                |     raise CalledProcessError(retcode, cmd)
seafile                | subprocess.CalledProcessError: Command 'su seafile -c "/opt/seafile/seafile-server-12.0.6/seafile.sh start"' returned non-zero exit status 1.

The /shared/seafile/logs directory is created without giving the seafile user permission to write to it. To work around I did ‘find -type d -exec chmod 777 “{}” ;’, then docker-compose down, and docker-compose up again.

1 Like

If you use non_root in 12.0, please refer to this manual to modify /opt/seafile-data/seafile/ permissions: Run Seafile as non root user inside docker - Seafile Admin Manual

Yes, I did that. The problem is that the log directory didn’t exist before starting the docker container for the first time. So it didn’t exist to get "chmod"ed. Later when the script created the directory, it created it with permissions that don’t let the seafile user create files in that directory.

This is a bit of a corner case as it will only be a problem if you do non-root for the first time you start the seafile docker. But it also should be easily fixed with a single line in one of the starting scripts.

Thanks for your feedback, using non_root on first boot can cause issues. We will fix and update the non_root manual.

1 Like