Log permanently gives a warning .../data/tmp missing

Hi, i have for a while moved my data directory to my external hdd, however, today i realized that in nextcloud logs there is a repettitve warning:

Temporary directory /var/www/nextcloud/data/tmp is not present or writable

In my /media/USBdrive/ncdata/ there is a tmp folder, why is nectcloud looking for it in /var/www/…?

Have you checked who owns the location? E.g. in Ubuntu, you can use:

ls -la /var/www/nextcloud/data/tmp

If it’s not owned by user www-data then you need to fix it. Again, in Ubuntu the command is:

sudo chown www-data:www-data -R /var/www/nextcloud/data/tmp

Your OS might have different instructions, but the requirements will be the same. www-data needs to have ownership before it can write to that directory.

Or you could change the location of the tmp directory to your /media folder.

Hope that helps.

There isnt even a /data folder in /var/www/nextcloud this makes me think it isnt there because of the move to usbdrive and the tmp dir is somehow set to the wrong path

(/tmp location is a config.php parameter that you can change - go here and search for /tmp. It’s the second hit on the page:


And don’t forget to restart your apache or nginx server after any changes.


Thanx, but i checked config.sample.php and there is no tmp directory to be configured:
E486: Pattern not found: tmp
E486: Pattern not found: temp

You can add it to your config.php

‘tempdirectory’ =/media/USBdrive/ncdata/tmp

1 Like

That did the trick, however, i think this should be taken care of by the ncp pannel when moving the data directory, wht do u think @nachoparker

Unless they changed something in Nextcloud, this is taken care of in nc-datadir

hmm, this creates the folder as far as i can see, which has been done, but where is it set in config.php?

that didn’t use to be necessary, unless it has changed

I tried moving the datadir with nc-datadir and then uploading files and I see no warnings. I will add the tempdirectory setting in any case

If anybody can share the steps to reproduce consistently we can look at it again

I had moved data dir while on a version 13.x of nextcloud, i actually didnt care about log output back then as everything seemed to work fine. Eventually after updating to 14.x i recently looked into logs and found that warning. However, i am not sure if this affected anything, there actually was no obvious problem before repair and i could not see any difference after that except of the warning disappeared from logs…

thanks for the info, this probably was fixed after you moved the datadir

1 Like

Just after updating to Nextcloud 20.0.8 via ncp-config this happened to me as well. Nextcloud continues to spam my log-file with the message Temporary directory /var/www/nextcloud/data/tmp is not present or writable. My quick-fix was to create that folder. However, it is probably desirable to have its path correctly set in config.php. Just wanted to let you know this “bug” still occurs.

1 Like

Uniek is correct, this issue also happened to me after updating to 20.0.8
It seems the news app is the one checking and writing to /var/www/nextcloud/data/tmp

Sorry to be a newbie, but where is this config.php located, or what is the full path?

Its in your nc install dir, depending on the webserver/os you use…
in debian based systems it should be /var/www/nextcloud/config/config.php

Seemingly out of nothing (or maybe because of the 20.0.11 update?) I got this same error, and I can’t sync files any more. The desktop client shows Connection Closed

The log is going crazy and is flooded with this output:

[no app in context] Warning: Temporary directory /var/www/nextcloud/data/tmp is not present or writable

PROPFIND /remote.php/dav/files/USERNAME/
from by USERNAME at 2021-07-06T08:03:48+00:00

this seems the solution, but, I need a bit more help.

What does “tempdirectory” stand for?
the rest is the path to my data on the drive, as I understand.


tempdirectory = Where Nextcloud saves files temporarily, until they are fully uploaded.


so I actually input ‘tempdirectory’ =/media/MYDIRECTORY/ncdata/tmp