I’m using Nextcloud 11.0.2 with Nginx 1.12.0 and PHP FPM 7.1.4 on Arch Linux. Also the Nextcloud App (version 2.17) on iOS.
Problem: from time to time the permissions on the “tmp” folder gets modified but I’ve no idea why.
In the Nextcloud log I see then many errors like:
{“reqId”:“WOxJrqhyAUr4+w5fT51z”,“remoteAddr”:“62.158.144.27”,“app”:“no app in context”,“message”:“Temporary directory /srv/http/www-u02042017/tmp is not present or writable”,“level”:2,“time”:“2017-04-22T17:06:01+00:00”,“method”:“GET”,“url”:"/ocs/v1.php/apps/files_sharing/api/v1/shares",“user”:"–",“version”:“11.0.2.7”}
Then, the permissions looks like:
drwxr-x— 15 www-u02042017 http 4096 Apr 22 10:53 data
drwxr-x— 5 www-u02042017 http 4096 Apr 22 10:54 datadir
drwxr-xr-x 2 root root 4096 Apr 22 09:39 logs
drwxr-x— 2 http http 4096 Apr 22 18:41 tmp
Normally, the folder “tmp” should have the same permissions as the “data” and “datadir” folder:
drwxr-x— 2 www-u02042017 http 4096 Apr 22 18:41 tmp
When I set the permissions back to “user:webserveruser” instead of “webserveruser:webserveruser”, these permissions gets changed frequently.
PHP-FPM is configured like:
user = www-u02042017
group = www-u02042017
listen.owner = http
listen.group = http
Permissions on the folders are set like:
drwxr-x— 15 www-u02042017 http 4096 Apr 22 10:53 data
drwxr-x— 5 www-u02042017 http 4096 Apr 22 10:54 datadir
drwxr-xr-x 2 root root 4096 Apr 22 09:39 logs
drwxr-x— 2 www-u02042017 http 4096 Apr 22 18:41 tmp
But, after a while, the permissions gets changed to
drwxr-x— 2 http http 4096 Apr 22 18:41 tmp
Why can this happen? There’s no cron job or else which change the permissions, ENV is correctly set and normally, everything works fine. How can I track down the cause for this? Is Nextcloud running a job for setting permissions?
Thank you.
Daniel