haiwen / seafile-docker

A Docker image for Seafile server
Other
544 stars 183 forks source link

Can not use NFS volume for /shared #241

Closed gabbersepp closed 3 years ago

gabbersepp commented 3 years ago

Hi, I tried several hours without success to start the image using this command:

docker run -d --name seafile \ -e SEAFILE_SERVER_HOSTNAME=biehler.speedport.ip \ -v /mnt/biehlercloud/seafile-data:/shared \ -p 8080:80 \ seafileltd/seafile:latest

Everything I tried ended in this error message:

/bin/chown: changing ownership of '/var/log': Operation not permitted *** /etc/my_init.d/10_syslog-ng.init failed with status 1

As far as I know due to reading through many articles, this happens due to permission issues with the NFS share. It should be possible to fix this by mounting the share with no_all_squash / no_root_squash options. But nothing worked.

Is there a solution for such a problem? I want to avoid to create my own image because this would induce much more work for updates, also this requires much more testing.

Best regards, Josef

aldenjenkins commented 3 years ago

you'll need to allow a wider range of address permissions in /etc/exports.

probably a * if you're using k8s with a different network prefix of 172 instead of 192, and you'll need no_root_squash as well

gabbersepp commented 3 years ago

you'll need to allow a wider range of address permissions in /etc/exports.

probably a * if you're using k8s with a different network prefix of 172 instead of 192, and you'll need no_root_squash as well

This is something I have to do on the NFS Server, I think? I have a NAS from Western Digital and don't want to use SSH for this (for some reasons). So I think, I have no chance to fix this problem?

aldenjenkins commented 3 years ago

if you have no access to the nfs server then there is nothing you can do.

gabbersepp commented 3 years ago

@aldenjenkins Hi thanks for the clarification. I have found a solution using CIFS instead of NFS.

For those who have the same problems:

I have a WD MyCloud Ext2 NAS. There I created a new file share. This can be mounted as CIFS share. In fstab you can assign the default username (the username as which the seafile process is running) for all file access requests.

Using this apporach I was able to start the Seafile docker image. Unfortunatelly it failed when the mysql user tries to access the same share. Maybe a second file share using the username of the mysql process would fix this issue. I have not tested it.

Because I needed a quick solution (I want to migrate away from google drive) I gave Nextcloud a try. In Nextcloud the mysql directory is on the linux host. The data directory is on the NAS. The line in fstab looks like this:

biehlercloud/nextcloud /mnt/nextcloud cifs username=username_of_wd_file_share,password=pwd_of_wd_file_share,uid=www-data 0 0

I think I will try the same (data directory on NAS, DB directory on host) with seafile in the future. But for now I follow the guideline: Never touch a running system :-P