Web Interface forcing logout after upgrade to 28.0.5

Just got a new error when using the Web, but nothing new in the Logging at all.

This is really getting annoying, I’ve been trying to disable random apps but nothing seems to affect it. What else should I be looking at, or is this just purely a bug with NC 28.0.5?

1 Like

In the past, I’ve generally been told to report stuff on GitHub. However, there are several problems with that, including the fact that the system is exploded into many different projects and I don’t usually know which project the problem is happening in.

1 Like

Yes I can’t really submit to GitHub because I don’t know which app, if any, is causing it. Just got back to my system and again it logged me out.

I’m hesitant to upgrade to 29 because it doesn’t seem like it’s fixed there either.

Blockquote

If it’s a bug impacting Server, report it in the server repository.

However I’d expect a ton of reports if this was happening across the board and I’m not seeing that.

One of the easiest ways I’m aware of to generate the behavior you’re seeing is to have a reverse proxy in place with inappropriate caching. A common one is NPM w/ the Asset Caching option on (it needs to be off).

What’s your reverse proxy situation?

My test system (NC29) is proxied via my “production” system (NC28) via Apache. Neither had a problem (at least a year old or more) until the recent round of changes.

Can someone try to apply fix(session): Avoid race condition for cache::get() vs. cache::hasKey() by nickvergessen · Pull Request #45093 · nextcloud/server · GitHub ? It’s for 29, not sure if it cleanly applies to 28, but shouldn’t be too hard to try.

4 Likes

Had the same problem which started immediately after updating to 28.0.5. That fix (PR 45093) seems to be working for me–no forced log-offs in over 30 minutes whereas before it was logging me off at least every 5 minutes

Nevermind–just after posting that it knocked me off

So, I don’t know what you mean by “apply” exactly, but I replaced the “lib/private/Authentication/Token/PublicKeyTokenProvider.php” file with the file from the GitHub repo that has the fix and for now it seems to be working. Thanks for the suggestion.

How would I copy this file to my server? Mine is a virtual machine running on VMware Player. Since the ubuntu server has no GUI, just command line, I can’t download a file from a browser.

Also, as I’m not as experienced with obtaining the files, I don’t even see how to acquire it from the GitHub link

You could use curl:

curl https://raw.githubusercontent.com/nextcloud/server/bugfix/noid/avoid-getKey-race-condition/lib/private/Authentication/Token/PublicKeyTokenProvider.php -o /home/.../file.php

Don’t forget to replace the output path with the path where you want to save the file.

Or alternatively you could use SFTP through WinSCP on Windows or similar.

Also don’t forget to apply correct permissions and owner to the file.

And don’t forget to restart php, apache, nginx services respectively.

3 Likes

I apologize for not being well versed with ubuntu. SFTP worked well to get me connected, however even though I logged in with my Ubuntu admin account, lib/private doesn’t exist for me, and some folders I can’t seem to access due to SFTP reporting access denied.

I’m not logging in as ‘root’ which I suspect is the issue. But I don’t recall ever being prompted for a password for the root user when I deployed my Nextcloud VM.

You can generate a patch file from GitHub pull requests and apply the changes locally: Patching Nextcloud — Nextcloud latest Administration Manual latest documentation
But replacing should work in this case I guess

Same problem here, on three different Nextclouds working on 29.0

1 Like

Please see above and try the PR

Patch seems to have helped me as well so far. Noticed the session logouts happening almost immediately after updating to 28.05 from 28.04

1 Like

I managed to replace my file with the PR file, and so far it seems stable. I was hit with the logout multiple times this AM prior to the PR, but hoping this clears the issue.

Many thanks to @SysKeeper for pointing out the PR in the first place. Hopefully that will solve it for other people experiencing the issue as well.

For me it is working at the moment in NC 29 :clap:

I hand-modified the files for NC28 and NC29 based on the patches listed above. Things are working great (like normal) for the past day or so. :smile:

We experienced the logout problem too after the update from 28.0.4 to 28.0.5.
After reading a lot of articles I restored a backup version of 28.0.4 of
lib/private/Authentication/Token/PublicKeyTokenProvider.php file. Downside is that php occ integrity:check-core is raising a problem with this file, Right now I have no solution for that.