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
Frequent session-related errors #24316
Comments
I am seeing this same issue on a shared host (IONOS) running PHP 7.4.12. We are encountering the issue most prominently in the Text app when editing a document. |
I just switched my IONOS account to PHP 7.3.24 and am still encountering the issue. |
Most interesting. I conducted another experiment and added an additional PHP handler to Plesk with PHP version 7.4 and configured it the same way I did with the (working) PHP 7.3 handler.
|
I did another experiment and added a FastCGI handler for the same PHP 7.4 installation and that worked as well. Then I had a closer look at the "misconfigured" PHP handler automatically added by Plesk via GUI (the one showing the issue). I realized it referenced a non-existing php.ini from a (formerly installed) PHP 7.2 installation. So if you are using Plesk, check the settings of the PHP handler using the above mentioned output. At least for me the issue is solved (or rather a Plesk issue than a Nextcloud issue). |
I believe I tracked down the cause of the issue on my instance. As recommended by Nextcloud, I had used a php.ini to enable the opcache. My settings were as follows:
It turns out on my particular shared web host (IONOS / 1&1), I must also need to override opcache to use a file cache only. With the above configuration in place, the described problem occurs. With the addition of the following two lines, I have yet to be able to reproduce the problem. If I remove these 2 lines, the problem is easily reproducible.
|
I have the same issues as described in this issue with a Nextcloud instance on Ionos webhosting with php 7.4. However, the two lines @EricKerby added to the opcache config I had already in place; for me they do not solve the issue. For reference, this is my php.ini of the NC 20.0.2 instance:
|
I found a solution for the problem in my case. This is not an issue with the Nextcloud implementation, this issue can be closed from my side. -- For other Ionos users, some background to my investigation: the session issue occured as soon as I had a custom php.ini for the nextcloud installation in place, even if it was just empty. This forum post (sorry, it's in German :/) seemed to point out the problem and solution: https://help.nextcloud.com/t/problems-with-web-interface-on-the-administrative-sites-apps-and-users/45370/10 In short, creating a directory
|
Thanks, @DSoko2. I commented out the file_cache lines and added the session.save_path setting you described. I can confirm that also alleviates my issue. Since my last post, I did encounter the described issue a couple times, so I'm hopeful this session.save_path setting will be the complete fix. Since IONOS and Nextcloud evidently have some partnerships, it seems they might want to collaborate on detecting/resolving this issue for clients. |
OK, I'll close this one, since it's obviously related to PHP session configuration and not a Nextcloud issue. |
See at the end of the post for an update - TLDR: this only occurs on PHP 7.4...
I recently upgrade my NC version 18.x to 19.0.4 and then to 20.0.1.
It's a manual installation on a Plesk-driven vServer running Ubuntu 18.04
In the course of the update I had to upgrade PHP as well and due to some PHP modules being not available for the Plesk provided PHP, I'm running Ubuntus
PHP version 7.4.12.
Apache version: 2.4.29-1ubuntu4.14
Since the update I'm constantly logged out, XHR calls result in HTTP 412 or HTTP 500 whith a stacktrace pointing to method calls with user parameter = null
All in all it looks like the session is invalidated or recreated frequently.
The time in between session invalidations is not fix/deterministic, so I don't think its PHPs session cleanup (although I checked that, too: session.gc_maxlifetime is set to 1440 per phpinfo).
Steps to replicate it:
message "CSRF check failed"
message "Current user is not logged in"
I observe a similar behavior in the News app: after a while (takes a little longer, bit after very few minutes the latest) I get the 412
The Files app shows 401s (with above mentioned error) for a couple of XHR requests and then redirects to the login page.
I moved the PHP session directory to a separate one for this instance (since Plesk manages multiple in parallel) to eliminate the possibility that another PHP session cleanup affects this PHP instance.
For the sake of completeness here's my config.php, although I had to anonymize quite a some entries:
Any help would be appreciated. I'm able to debug the PHP instance, but since I don't know the whole session handling infrastructure and how the apps play together, it's kind of hard for me to investigate further.
Originally posted here https://help.nextcloud.com/t/constant-logouts-after-nc-php-update/98671
Update
After reading that (although the Warnings in the Settings page state differently) NC 20.0.2 IS compatible with PHP 7.3, I switched to 7.3 and everything works as expected.
I tried two different PHP 7.3 versions, both worked.
Further info:
Database: MySQL
Results from http://example.com/index.php/settings/integrity/failed
List of activated apps:
App list
app:list result
Are you using external storage, if yes which one: NO
Are you using encryption: NO
Are you using an external user-backend, if yes which one: NO
Client configuration
Browser: Firefox & Chrome tested
Operating system: Ubuntu 20.10
The text was updated successfully, but these errors were encountered: