temp directory of PHP - nextcloud  [SOLVED]

Locked
User avatar
keyhelpuser
Posts: 20
Joined: Sat 13. Mar 2021, 21:56
Location: ...earth
Contact:

temp directory of PHP - nextcloud

Post by keyhelpuser »

I have a problem with a temporary folder for PHP. Server specification: KeyHelp 20.3.2 (Build 2131) , Debian 10.8 (64-bit) ,PHP 7.4. The problem concerns Nextcloud which uses s3 storage. Everything works as it should, but I have one error regarding OpenBasedir:

This instance uses an S3 based object store as primary storage. The uploaded files are stored temporarily on the server and thus it is recommended to have 50 GB of free space available in the temp directory of PHP. Check the logs for full details about the path and the available space. To improve this please change the temporary directory in the php.ini or make more space available in that path.

I do not know how to deal with it?! It is possible that configuration: disable_functions blocks to check a specific request by the nextcloud?

OpenBasedir: ##DOCROOT##/www:##DOCROOT##/files:##DOCROOT##/tmp
Assuming that nextcloud is in the directory: /home/user/nextcloud/www/
User avatar
keyhelpuser
Posts: 20
Joined: Sat 13. Mar 2021, 21:56
Location: ...earth
Contact:

Re: temp directory of PHP - nextcloud

Post by keyhelpuser »

When I turn off disable_functions the problem disappears, I just need to find which function from the list

Code: Select all

dl, disk_free_space, diskfreespace, stream_socket_sendto, proc_get_status, proc_nice, proc_open, proc_terminate, proc_close, popen, curl_multi_exec, pcntl_exprill, pcntl_fork, pcntl_fork, pcntl_fec, pcntl_set, posix_setsid, posix_setuid, posix_setpgid, posix_getpwuid, show_source, highlight_file, syslog, error_log, openlog, define_syslog_variables, apache_child_terminate, apache_setenv, apache_note
is responsible for this message. Very interesting situation, I wouldn't care about this nextcloud message but this problem prevents me from updating nextcloud. Although I will transfer data from S3 storage to my own resources, before doing so, I will be happy to solve this problem for other users. any idea?
tab-kh
Posts: 450
Joined: Thu 22. Apr 2021, 23:06

Re: temp directory of PHP - nextcloud

Post by tab-kh »

While I don't use s3 storage in my Nextcloud 21.0.1, I'm also using Debian 10 and PHP 7.4 with it. My guess would be disk_free_space (+ its alias diskfreespace). Anyway, like they say: "Check the logs for full details about the path and the available space". So you should find both the path and the available space in the logs and can double check the available space. When the Nextcloud checks the free space, it might try to use one of the functions mentioned above. So it might even be a non issue, because there could be enough space available in the temp directory, but Nextcloud can't know it. The 50GB are also just a recommendation.

Edit: the problem going away with no functions disabled seconds my speculation. In this case Nextcloud successfully checks the available space and finds enough of it to be satisfied.
User avatar
keyhelpuser
Posts: 20
Joined: Sat 13. Mar 2021, 21:56
Location: ...earth
Contact:

Re: temp directory of PHP - nextcloud

Post by keyhelpuser »

You're right, I deleted disk_free_space from disable_functions and the problem is gone.
I have one more error in the nextcloud logs:

Code: Select all

Error: is_readable(): open_basedir restriction in effect. File(/home/users/nextcloud//.aws/config) is not within the allowed path(s): (/home/users/nextcloud/www:/home/users/nextcloud/files:/home/users/nextcloud/tmp) at /home/users/nextcloud/www/nextcloud/3rdparty/aws/aws-sdk-php/src/S3/UseArnRegion/ConfigurationProvider.php#134
User avatar
Alexander
Keyweb AG
Posts: 3809
Joined: Wed 20. Jan 2016, 02:23

Re: temp directory of PHP - nextcloud  [SOLVED]

Post by Alexander »

Your path "/home/users/nextcloud//.aws/config" seems wrong because of the double "/".

Of course one can also update the openbase_dir ...
  • "User Administraion" -> Select the user -> Go into the "PHP" tab -> Edit the open_basedir option by adding ":##DOCROOT##"
... but I would first check the path above and the cause why it seems off.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
keyhelpuser
Posts: 20
Joined: Sat 13. Mar 2021, 21:56
Location: ...earth
Contact:

Re: temp directory of PHP - nextcloud

Post by keyhelpuser »

Hi, this is my configuration:

Code: Select all

##DOCROOT##/www:##DOCROOT##/files:##DOCROOT##/tmp
Session files are saved in the tmp directory, as recommended, I changed to:

Code: Select all

##DOCROOT##
Problem is gone I consider the topic to be resolved . Thank you for your help!

A small note: for other users who will want to use Object Storage from vultr for nextcloud, I recommend that you carefully analyze storage configuration file. Object Storage is currently used by over 300 users. The server works great on the KeyHelp panel,
except DNS, but this problem requires a new forum topic. If anyone has any questions, I am happy to help.
Locked