kerberos-io / agent

An open and scalable video surveillance system for anyone making this world a better and more peaceful place.
https://kerberos.io
MIT License
640 stars 78 forks source link

Permission denied #80

Closed ACCGAGTT closed 1 year ago

ACCGAGTT commented 1 year ago

When trying to attach volumes , both docker and docker compose options throw the following error: docker run -p 8081:80 --name mycamera -v $(pwd)/config:/home/agent/data/config -v $(pwd)/recordings:/home/agent/data/recordings-d --restart=always kerberos/agent:latest {"level":"fatal","msg":"Problem creating a file: open ./data/config/.test: permission denied","time":"2023-03-06T05:54:22+01:00"}

when launching without mounted volumes the container comes up

cedricve commented 1 year ago

hello @ACCGAGTT, make sure the permissions of the mounted directories (on your host system) are open enough to be consumed by the docker container (Kerberos Agent).

Hooch76 commented 1 year ago

My Linux knowledge is limited but I was running into the same issue the day before. The user running the container is: uid=100(agent) gid=101(kerberosio)

I was able to solve it by changing ownership and permissions on the mounted directory on the host (using bind mounts):

chmod -R 755 kerberos-agent/
chown 100:101 kerberos-agent/ -R

This might not be the best solution but worked for me and might give you an idea about fixing it in a better way ;-)

cedricve commented 1 year ago

Thanks for helping out @Hooch76 !!

ORIOLESFan02 commented 1 year ago

My Linux knowledge is limited but I was running into the same issue the day before. The user running the container is: uid=100(agent) gid=101(kerberosio)

I was able to solve it by changing ownership and permissions on the mounted directory on the host (using bind mounts):

chmod -R 755 kerberos-agent/
chown 100:101 kerberos-agent/ -R

This might not be the best solution but worked for me and might give you an idea about fixing it in a better way ;-)

Apologies for this, but I don't understand this. There's no file called kerberos-agent/ for me. Where are you doing this, and does the file name have to be called kerberos-agent/?

cedricve commented 1 year ago

@ORIOLESFan02 the kerberos-agent/ directory is on the host system, and can be whatever name you prefer. @ACCGAGTT and @Hooch76 have created their own directory, kerberos-agent/ on the host system, give it the required permissions and then inject it into the container.

docker run -p 8081:80 --name mycamera -v $(pwd)/config:/home/agent/data/config -v $(pwd)/recordings:/home/agent/data/recordings-d --restart=always kerberos/agent:latest
HDTS1 commented 1 day ago

How is this closed? I dont understand who should own the files. 100 and 101 are totally different users on my system.