Closed Cronus89 closed 5 years ago
Interesting as this uses generic's cache engine under the box and others have it working fine, so probably a permissions error of some forms, lets see if we can debug it
can you try the following in a docker exec -it cache-monolithic bash
cat /data/logs/access.log
cat /data/logs/error.log
ls -al /data/cache
ls -al /data/cache/cache
touch /data/cache/test
touch /data/cache/cache/test
ls -al /data/cache
ls -al /data/cache/cache
And for good measure try the following on the host machine
ls -al /mnt/cache/data
touch /mnt/cache/data/test_host
ls -al /mnt/cache/data
All logs were readable, output of the others look great, see below
root@83a1eab75562:/scripts# ls -al /data/cache
total 12
drwxrwxrwx 3 www-data www-data 4096 Dec 20 03:07 .
drwxr-xr-x 1 www-data www-data 4096 Dec 19 21:58 ..
drwxrwxrwx 2 www-data www-data 4096 Dec 20 03:07 cache
root@83a1eab75562:/scripts# ls -al /data/cache/cache
total 8
drwxrwxrwx 2 www-data www-data 4096 Dec 20 03:07 .
drwxrwxrwx 3 www-data www-data 4096 Dec 20 03:07 ..
root@83a1eab75562:/scripts# touch /data/cache/test
root@83a1eab75562:/scripts# touch /data/cache/cache/test
root@83a1eab75562:/scripts# ls -al /data/cache
total 12
drwxrwxrwx 3 www-data www-data 4096 Dec 22 05:10 .
drwxr-xr-x 1 www-data www-data 4096 Dec 19 21:58 ..
drwxrwxrwx 2 www-data www-data 4096 Dec 22 05:10 cache
-rwxrwxrwx 1 root root 0 Dec 22 05:10 test
root@83a1eab75562:/scripts# ls -al /data/cache/cache
total 8
drwxrwxrwx 2 www-data www-data 4096 Dec 22 05:10 .
drwxrwxrwx 3 www-data www-data 4096 Dec 22 05:10 ..
-rwxrwxrwx 1 root root 0 Dec 22 05:10 test
root@docker:~# ls -al /mnt/cache/data
total 16
drwxrwxrwx 3 www-data www-data 4096 Dec 21 23:10 .
drwxrwxrwx 5 deploy deploy 4096 Dec 19 21:13 ..
drwxrwxrwx 2 www-data www-data 4096 Dec 21 23:10 cache
-rwxrwxrwx 1 root root 0 Dec 21 23:10 test
root@docker:~# touch /mnt/cache/data/test_host
root@docker:~#
root@docker:~# ls -al /mnt/cache/data
total 16
drwxrwxrwx 3 www-data www-data 4096 Dec 21 23:13 .
drwxrwxrwx 5 deploy deploy 4096 Dec 19 21:13 ..
drwxrwxrwx 2 www-data www-data 4096 Dec 21 23:10 cache
-rwxrwxrwx 1 root root 0 Dec 21 23:10 test
-rwxrwxrwx 1 root root 0 Dec 21 23:13 test_host
root@docker:~#
Sorry @cronus89 I missed your reply to this in the Christmas rush. I'll see if I can have another think in the morning
@Cronus89 Did you manage to find any solution to this, I cannot replicate this at all, even using another nfs share in the same manor you you appear to be using it. Can you try with the cache directories pointing to a local disk and see if you still have the same issues?
Only other test I can think of is the following (we've only tested as the root user and your user in both cases. Again inside the docker container docker exec -it cache-monolithic bash
:
su -s /bin/bash www-data
ls -al /data/cache
ls -al /data/cache/cache
touch /data/cache/test_user
touch /data/cache/cache/test_user
mkdir -p /data/cache/cache/testdir
touch /data/cache/cache/testdir/test_user
ls -al /data/cache
ls -al /data/cache/cache
ls -al /data/cache/cache/testdir
I ended up removing the nfs mount and it worked fine.
So its the mount somehow the issue.
I've tested your new command ideas, and the 2nd one fails on, is I cannot see the contents of /data/cache
I can see /data/ fine and also /data/cachedomains
The NFS Server is a Synology NAS and i have another nfs mount on this same VM that works fine (plex video files) Plex is also a docker container.
I'm lost as to why this one wouldnt work.
Got it!....
Had to squash root to admin :\ Thanks for all the helpful commands. Love this new monolithic container!
I didn't suggest root squash as I thought you had generic working in the same context. Also I'm slightly surprised the debug commands worked with root squash to nobody, but hey ho!
Glad to have got you sorted ;)
Sorry for jumping on this old topic, but:
Got it!....
Had to squash root to admin :\ Thanks for all the helpful commands. Love this new monolithic container!
@Cronus89 Can you describe how exactly you got the container to work on a NFS share? (For a Linux and Docker Beginner, please: Full commands for the share mount and the container start please.)
I'm having exactly the same issue with a shared volume on a Synology Server. The logs write fine, the folder structure in cache creates fine, but no files are stored. I cannot seem to fix it, no matter SMB or NFS share. Using the cache with local storage works just fine.
i know this is an old issue, but i faced this while having an smb share and a docker container.
i fixed the issue by changing the WEBUSER to root.
@lacion please be aware that is a terrible idea and incredibly bad security practice. Lancache do not recommend this course of action at all
@VibroAxe that is absolutely for a prod environment.
but my steam cache is part of a private VLAN not accessible to the outside world. so it works fine. (this is a DNS server on my home network not accessible externally.)
ideally, the user being run in the container should be able to use a custom UID and GID so we could match it to permissions on a user in the host. having to avoid running anything in root or just chmod 777 or 775 which is also a really bad idea.
but for now this works, i wish i had time to do something more or fork and PR... but i just blew out all my free time of the week trying to get this to work.
Describe the issue you are having
How are you running the container(s)?
DNS Configuration
Output of container(s)