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


#1

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/…?


NCP "Temporary directory is not present or writable"
#2

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.


#3

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


#4

(/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:

https://docs.nextcloud.com/server/9/admin_manual/configuration_server/config_sample_php_parameters.html

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

Regards).


#5

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


#6

You can add it to your config.php

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


#7

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


#8

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


#9

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


#10

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


#11

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


NCP "Temporary directory is not present or writable"
#12

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…


#13

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