-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: wrong directory for temporary PHP path (nc 28.0.5 and 29 / php-fpm) #45047
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
That value is coming from PHP's The There may be some room here to adjust this check a bit though it seems like. It's currently only checking server/lib/private/TempManager.php Lines 212 to 249 in acf8ea1
We only use the return value of EDIT: Even if the setup check gets adjusted, it would probably be a good idea to make sure your PHP environments |
@joshtrichards Thanks a lot! Setting |
Great, but I've no idea what to do exactly! Could you please provid me with more details? Which file? Which entry do I have to change or to add? I'm not realy experienced! |
How did it "broke" your setup? |
Me neither ... After update to 28.0.5 having the same message: @joshtrichards please explain - thank you! |
I have both parameters I have this issue with apache2 + nginx (php as apache mod_php) with NC 29, so the topic starter have this issue with php-fpm. It looks like a bug which appears on different systems. Other apps and sites which uses this parameter and write data to tmp have no issues with it. ONLY Nextcloud have this issue. |
Given the problem with setting up PHP access to system temp directory, I don't see why would not use upload_tmp_dir always? |
I have added to my php.ini: And I have added to Nextcloud's config.php: Directory root/tmp has these rights: PHP version: 8.2.19 Still getting this: Even 777 for /tmp does not make a difference to the problem. Please fix asap - thank you! Greetings, Gerald |
In the meantime my webhoster informed me about following: EDIT: |
So, I found a realy easy solution for me: I just createt that missing folder and the message disappears! |
Thanks for the note, @gersteba . |
Aaaandd… YES! Setting |
Then move your project to a hoster that did not lost its sanity. |
Why do you say this? |
Because function by itself is not a threat, no matter what parameters you pass to it. It MAY be an information disclosure, IF you display its output to the user. |
Doesn't work |
Then you did something wrong. |
Besides, this prolem appears after NC upgrade, without changes of my server by me. So, it’s more logical to assume that the NC developers did something wrong in one of the updates. With each new version there are more and more problems, because each new version requires more and more changes in the server infrastructure. It seems to me that development should not proceed this way. Changes of this kind must go through multiple stages of testing on various benches and systems. Don't show up unexpectedly and cause inconvenience. Now it goes something like this:
And the community be like this:
Please, let's look at the problem using an objective approach and find the correct and universal solution that will suit everyone. |
Dude. Don't set it to /tmp. That's why it complains. Your FPM don't have access to /tmp. |
|
intervisionlord is absolutely right. I got the same issue since NC 28 upwards on my test installation. My live installation is still on NC 27 and runs without any issues. NC development is heading the wrong way. They just bring in new issues with upgrades. This one is just one of them. I will never upgrade my live install until all the issues in the newer versions are resolved. |
Are you sure? I am asking because you make strange statements like access permissions and my web-server. So, as I suggested earlier, let’s still take a more objective approach to finding a solution to the problem, and not accuse each other of incompetence based only on our guesses and assumptions about the configurations of each other’s servers. If your web server is configured in one way and a specific solution works for you, do not assume that everyone is configured the same way. |
Again, that warning SPECIFICALLY happens, when your PHP process is unable to access sys_temp_dir (which is, by default, unless altered, is /tmp).
|
When a process cannot access a directory, this is displayed in the web server logs if the PHP is correctly configured in the error reporting parameter There is no need to confuse the web application message, (which can be displayed if the accessibility check method is incorrect (which is what is discussed in this thread) or because of errors in programming logic,) and the system message from the web server and its application components, such as PHP. If I put my script near to the NC installation, which will try to gain access to the /tmp and show that everything is working correctly, will you stop trying to prove to me that the error is on my side and join in an objective and unbiased discussion, a constructive and joint search for the problem? > cat temp_test.php
<?
$test_file = fopen("/tmp/test_file.txt", "w");
fwrite($test_file, "test message");
fclose($test_file);
?>
You will probably be very surprised, but I also have this directory /tmp and (surprise surprise) there are no problems or errors with it, which once again proves that the problem is precisely in the incorrect determination of the directory’s availability specifically for temporary files on the part of the NC How do you think why does NC have no problems in the case of upload_temp_dir, but in the case of sys_temp_dir there are? |
PHP CLI app and PHP run by Apache webserver are TWO DIFFERENT APPS. |
Another surprise for you, maybe, but my CLI version and WEB version are the same. ughhh... i am really tired to talk with you...
Think as you like, as I understand it, no one is going to solve the problem. Okay, whatever you want. I'm just tired of proving something to people who are sure that they know better than me how my server is configured and give advice based on their conjectures. |
Same version does not mean same executable and same configuration. |
The code for the setup check: https://github.com/nextcloud/server/blob/master/apps/settings/lib/SetupChecks/TempSpaceAvailable.php#L54 If you comment, please mention the exact error message to map it to the right code. The check looks at our temp manager, which uses a couple of available paths and php's sys_get_temp_dir. Most likely because our temp manager is only used in Nextcloud and 3rdparty libraries usually use sys_get_temp_dir. Actually, our temp manager should only look at sys_get_temp_dir and ignore the other options. However dropping those will likely break someone else's setup out there. However the most correct approach because most php libraries will follow, is to rely on sys_get_temp_dir. See https://github.com/php/php-src/blob/106581b1b6564971489e5b0ac80a760c6689fdd7/main/php_open_temporary_file.c#L235 to understand what php does internally. |
I'd probably break somebody's cardboard castle, but no PHP program should rely on sys_get_temp_dir, if it does not runs in CLI. |
Hi, I've prepared a pull request for 29.0.4 (2024-07-1) changing the check a bit: #46190
|
@kesselb Also, just to be sure, users with this error message can use their NC just as normal, including updating? |
Yes, this is merely a warning that the configuration is probably suboptimal, but otherwise, by itself it does not stop you from using your instance. |
Ok, thx for the info. |
Thank you for changing the error message into a warning message in version 29.0.4: Maybe a more informative explanation, what probable disadvantage or actually harmlessness of that function being disabled has, might be useful for non-involved users. |
Bug description
Error while checking the temporary PHP path - it was not properly set to a directory. Returned value: /tmp
The error seems to be plain wrong since php config was not changed.
Happens
in use:
Steps to reproduce
Expected behavior
Everything just works.
Installation method
Community Manual installation with Archive
Nextcloud Server version
28.0.5.1, 29.0.0
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
apache, nginx
Database engine version
MariaDB, postgresql
Is this bug present after an update or on a fresh install?
Both
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
The error disappears if
/tmp
is added toopen_basdir
The text was updated successfully, but these errors were encountered: