Gronis / docker-seafile

A seafile server docker container
MIT License
33 stars 12 forks source link

gunicorn.conf.py Permissions Prevent Container From Starting #11

Closed airfrog7 closed 2 years ago

airfrog7 commented 2 years ago

When starting the container I get the following error in the logs: _Starting seahub at port 8000 ... Failed to read config file: /opt/haiwen/conf/gunicorn.conf.py Traceback (most recent call last): File "/opt/haiwen/seafile-server-9.0.2/seahub/thirdpart/gunicorn/app/base.py", line 111, in get_config_from_filename spec.loader.exec_module(mod) File "", line 724, in exec_module File "", line 859, in get_code File "", line 916, in getdata PermissionError: [Errno 13] Permission denied: '/opt/haiwen/conf/gunicorn.conf.py' Error:Seahub failed to start.

This is the permission of the file in the Docker volume: _root@dockerhost:/media/data/files/conf# ll total 7 drwxrwxrwx 1 seauser seauser 496 Feb 28 09:41 ./ drwxrwxrwx 1 seauser seauser 4096 Feb 28 09:37 ../ -rwxrwxrwx 1 seauser seauser 10 Feb 28 09:37 ccnet.conf lrwxrwxrwx 1 seauser seauser 13 Feb 28 09:41 conf -> /seafile/conf ---------- 1 seauser seauser 295 Feb 28 09:41 gunicorn.conf.py -rwxrwxrwx 1 seauser seauser 52 Feb 28 09:37 seafdav.conf -rwxrwxrwx 1 seauser seauser 23 Feb 28 09:37 seafile.conf -rwxrwxrwx 1 seauser seauser 90 Feb 28 09:37 seahub_settings.py_

Changing the permissions in Docker volume has no effect. Changing the permissions on the linked folder as Seahub tries to start does work: docker container exec seafile chmod -R 777 /opt/haiwen/conf/gunicorn.conf.py

Seahub will then start and I can access the Seafile web interface. However, if the container restarts then the permission issue returns.

Is it possible to fix the permissions on the gunicorn.conf.py file?

Gronis commented 2 years ago

Hi, thanks for reporting. The container startup script modifies gunicorn.conf.py file. Maybe this is the cause of incorrect file permission. I don't have this problem myself but I will take a look at it when I have time.

Gronis commented 2 years ago

The weird thing is that the same file modification happens to seahub_settings.py so it's strange that you don't have permission issues with that file.

Gronis commented 2 years ago

Because I cannot replicate the issue, I'm not sure how to get it working. For now, I've changed so that the gunicorn config is edited using the seafile user rather than the (default) root user when starting up. This might solve it for you. Let me know if this works.

airfrog7 commented 2 years ago

Thanks! I'll give it another go.

Gronis commented 2 years ago

Thanks! I'll give it another go.

Any luck?