lancachenet / monolithic

A monolithic lancache service capable of caching all CDNs in a single instance
https://hub.docker.com/r/lancachenet/monolithic
Other
726 stars 73 forks source link

failed (13: Permission denied) issues after copying cache Data to another cache #96

Closed Idefix0496 closed 3 years ago

Idefix0496 commented 4 years ago

Describe the issue you are having

Hi, recently I've had an issue with my Lancache running on a Docker Container in a Virtual Ubuntu 18.04 Machine. Since I've updated some Packages in Ubuntu, the cache completely stopped working. Therefore I've secured the complete /cache/data/cache folder to another Harddrive, in order to later Recover it, and build the System up from Scratch. In order to copy the Data to the new Virtual Machine I changed the Permissions of /cache/data/cache with the commands chmod and chown to my needs. The cache seems to work normally except for the fact that it's not getting any of the previously Copied Files from the old Cache. It's just downloading it straight from the Internet instead. In the Error.Log File are a lot of "Permission Denied" Listings. So I think it*s a permission Issue. Furthermore I don't understand why It states: "open() /data/cache/cache/72/b6....2. If I'm looking the file path up in the Filexplorer of Ubuntu they are located at /cache/data/cache and not /data/cache/cache. Can someone shade some light into the dark :-)

How are you running the container(s)?

export HOST_IP=`hostname -I | cut -d' ' -f1`
sudo docker run --restart unless-stopped --name lancache-dns --detach -p 53:53/udp -e USE_GENERIC_CACHE=true -e LANCACHE_IP=$HOST_IP lancachenet/lancache-dns:latest
sudo docker run --restart unless-stopped --name lancache --detach -v /cache/data:/data/cache -v /cache/logs:/data/logs -p 80:80  lancachenet/monolithic:latest
sudo docker run --restart unless-stopped --name sniproxy --detach -p 443:443 lancachenet/sniproxy:latest
echo Please configure your router/dhcp server to serve dns as $HOST_IP

DNS Configuration

The System runs in a Docker Container in a Virtual Ubuntu Machine on a QNAP System. The Lancache-dns runs directly in a Docker Container on the QNAP.

Output of container(s)

2020/02/01 16:50:57 [crit] 1345#1345: *2547 open() "/data/cache/cache/72/b6/55a27f8cbaf94b21d96b461529f0b672" failed (13: Permission denied), client: 192.168.16.119, server: , request: "GET /Builds/Org/o-hpdh9zjxpuz4quu95cagfzhgcavmjt/ArrowRoot/default/Gmt_3Ox29TNdlhxLakmBrfW4WXncXQ.manifest HTTP/1.1", host: "epicgames-download1.akamaized.net"
MathewBurnett commented 4 years ago

/data/cache inside your container should be mapped to where ever you have your files. In your run command that location is mapped to /cache/data on your drive. Anything inside that folder is as if it were in /data/cache inside your container, so it will see /data/cache/cache/00 etc.

If you changed the ownership of all those file then the process inside the container will not be able to access them. I believe the correct permissions are www-data:www-data.

Your containers output at start-up should include a line like Fast permissions check successful, if you have any permissions error try running with -e FORCE_PERMS_CHECK = true. Which, if memory serves, will correct the permissions of a mapped volume. This will take some time for a large cache.

VibroAxe commented 4 years ago

@Idefix0496 Did you manage to resolve this with forcing the perms check?

stale[bot] commented 3 years ago

This issue has been automatically closed after being inactive for 30 days. If you require further assistance please reopen the issue with more details or talk to us on discord