Closed HedgeShot closed 5 years ago
It has to be permissions in your volumes.
volumes:
- /nfs/Multimedia/Cam/data:/var/lib/unifi-video
- /nfs/Multimedia/Cam/videos:/var/lib/unifi-video/videos
Can you put an ls -alh /nfs/Multimedia/Cam/data
and ls -alh /nfs/Multimedia/Cam/videos
here? And tell us what PUID and PGID you're passing in and the user/group that is on your system.
@HedgeShot I had the same scenario, my volumes are on NFS, running the container as the same user as the permissions on them:
Running the container with:
-e PUID=1000 \
-e PGID=1000 \
-v /path/to/unifi:/var/lib/unifi-video \
-v /path/to/unifi/videos:/var/lib/unifi-video/videos \
The container logs:
2019-03-31 12:43:13.961494 [info] PUID defined as '1000'
2019-03-31 12:43:13.998544 [info] PGID defined as '1000'
mkdir: cannot create directory ‘/var/lib/unifi-video/logs’: Permission denied
Permissions for the volumes are:
$ ls -nd /path/tounifi/{,videos}
drwxrwxr-x 1 1000 1000 12 Mar 31 12:34 /path/to/unifi/
drwxrwxr-x 1 1000 1000 0 Mar 31 12:07 /path/to/unifi/videos
To allow ownership changes on the NFS you have to export your NFS share with no_root_squash
(more details https://linux.die.net/man/5/exports), please be aware that from a security perspective this is not desirable as any client with root is able to write files in the share.
Ah, yes I think the software does some silly things as root before dropping down to the uid/gid provided. :(
@HedgeShot, it has been a long time... I'm just going to assume you got things sorted out and forgot to come back and tell us. :)
Ah, yes I think the software does some silly things as root before dropping down to the uid/gid provided. :(
Tried to run it under kubernetes with:
securityContext:
runAsUser: 99
runAsGroup: 100
And it fails.
It runs happily as root but this is a bit disappointing as the plan was to keep it as the UID and GID provided.
Hi,
I struggle to fix permission issues. I read the various issues already raised but can't fix it. I am running the docker container on Ubuntu and my NFS shares are on Synology. On the first build I get this message:
On the second run, the error is on /videos. And on the third run, no error but container is constantly restarting and the error logs is the one below. Here is my docker-compose:
and here is the log:
Any ideas?