Mkdir(): Permission denied ... CacheMountProvider.php#61

[details=“Support intro”]

NC 13 on Ubuntu 16.04 LTS

Log is filling up with:

CacheMountProvider.php#61 2018-07-14T23:28:27-0400
Error PHP mkdir(): Permission denied at /var/www/nextcloud/lib/private/Files/Mount/CacheMountProvider.php#60 2018-07-14T23:28:27-0400
Error PHP mkdir(): Permission denied at /var/www/nextcloud/lib/private/Files/Mount/CacheMountProvider.php#61

Looking at the source code it seems that the directory “/uploads” & “/cache” need to be created in the private store with permissions 0770. I’ve looked through my permissions for each user and do not see where they are off. What else could possibly be the issue here?

drwxrwx--- 11 www-data root        4096 Jul 14 22:39 .
drwxr-xr-x  6 root     root        4096 Jul 11 08:05 ..
drwxr-xr-x 10 www-data www-data    4096 Jan 29 18:04 appdata_ocyjjvkfscs7
drwxr-xr-x  7 www-data www-data    4096 Jul 14 23:18 cbo
drwxr-xr-x  2 www-data www-data    4096 Jul 14 23:11 files_external
-rw-r--r--  1 www-data www-data     324 Jul 14 23:11 .htaccess
-rw-r--r--  1 www-data www-data       0 Jul 14 23:11 index.html
drwxr-xr-x  7 www-data www-data    4096 Jul 14 22:57 matt
-rw-r-----  1 www-data www-data 3512554 Jul 14 23:32 nextcloud.log
drwxr-xr-x  5 www-data www-data    4096 Jul 12 10:47 norm
-rw-r--r--  1 www-data www-data       0 Jul 14 23:11 .ocdata
drwxr-xr-x  4 www-data www-data    4096 Feb 19 10:25 pos
drwxr-xr-x  4 www-data www-data    4096 Dec 28  2017 ruthie
drwxr-xr-x  6 www-data www-data    4096 Jul 12 10:47 stephanie
-rw-r--r--  1 www-data www-data   27282 Jul 14 23:01 updater.log
drwxr-xr-x  4 www-data www-data    4096 Jul 14 23:11 updater-ocyjjvkfscs7

root@cbo-s1:~# ls -la /storage/cbo-nextcloud-fs/matt/
total 28
drwxr-xr-x  7 www-data www-data 4096 Jul 14 22:57 .
drwxrwx--- 11 www-data root     4096 Jul 14 22:39 ..
drwxr-xr-x  2 www-data www-data 4096 Feb  1 12:13 cache
drwxr-xr-x  6 www-data www-data 4096 Dec 18  2017 files
drwxr-xr-x  3 www-data www-data 4096 Jul 14 22:57 files_trashbin
drwxr-xr-x  4 www-data www-data 4096 Dec 20  2017 files_versions
drwxr-xr-x  2 www-data www-data 4096 Apr 28 11:13 uploads

root@cbo-s1:~# ls -la /storage/cbo-nextcloud-fs/cbo/
total 28
drwxr-xr-x  7 www-data www-data 4096 Jul 14 23:18 .
drwxrwx--- 11 www-data root     4096 Jul 14 22:39 ..
drwxr-xr-x  2 www-data www-data 4096 Dec 18  2017 cache
drwxr-xr-x  6 www-data www-data 4096 Jul 12 14:35 files
drwxr-xr-x  5 www-data www-data 4096 Jul 13 14:48 files_trashbin
drwxr-xr-x  3 www-data www-data 4096 Dec 19  2017 files_versions
drwxr-xr-x  2 www-data www-data 4096 Jul 14 23:18 uploads

Anyone have an idea of what could be the source of this? It’s driving me nuts.

There is also a general tmp-folder where stuff is stored (by default /tmp??), you can change this if the webserver has not enough permissions or the storage is too limited:

/**

* Override where Nextcloud stores temporary files. Useful in situations where

* the system temporary directory is on a limited space ramdisk or is otherwise

* restricted, or if external storages which do not support streaming are in

* use.

*

* The Web server user must have write access to this directory.

*/

'tempdirectory' => '/tmp/nextcloudtemp',

Thank you for the suggestion. I did alter the temporary folder and made www-data owner and group and restarted Apache. Still no change. Thanks again for the suggestion.

I know this is pretty old, but I had the same issue (for my snap install) and solve it by removing my erroneous entry in the config.php: 'cache_path' => '/media/external/CloudDATA/cache'. I added that to try to solve another issue and ended up causing another one.

3 Likes

Damn, that was it for me too. Thanks for the tip.