Web Interface forcing logout after upgrade to 28.0.5

I was running 28.0.3, and was noticing that some Apps were listing as having updates available, but my System was telling me that 29.0.0 was available and I didn’t have any app warnings. I upgraded from 28.0.3. > 28.0.5, and now I have four apps that are listed incompatible with 29.0.0, which is fine, I wasn’t planning on upgrading to it quite yet.

However, the issue I’m now facing is that my web login is being forced out. I normally login to my web interface in the morning and leave it running all day, as I interact with it during my workday for various apps and tasks. Since upgrading to 28.0.5, I’m noticing that Notes for instance was listing errors getting HTTP status, and then clicking on Dashboard or another app returned me to the login screen. Earlier, again, while it was idle, I went to do something and was presented with the login screen.

I’ve also been using Calendar or trying to get to Apps update page, and I get random errors that “An error occurred during the request. Unable to proceed” and then it logs me out. It acts like the Server stops responding or something and terminates the session. All mobile apps are working fine however, it’s just the Web interface that is giving me fits.

Nextcloud version 28.0.5
Operating system and version Ubuntu 20.04.1
Apache or nginx version Apache
PHP version 8.1.28

Is this the first time you’ve seen this error? (Y/N):Y

Steps to replicate it:

  1. Login to Web Interface
  2. Don’t interact with it for several minutes, not entirely sure what the threshold is
  3. Attempt to interact with an app or something, and returned to login screen.
  4. Have to login again, and with 2 Factor Auth it’s a little annoying to do it constantly all day long.

The output of your Nextcloud log in Admin > Logging:

Error	index	
TypeError Cannot assign null to property OCA\Mail\Controller\DraftsController::$userId of type string
Apr 25, 2024, 11:31:23 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:15 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:14 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:14 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:14 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:14 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:04 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:04 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:04 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:04 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:04 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:02 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:02 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:02 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:01 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:05:01 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:42 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:42 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:42 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:42 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:42 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:30 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:30 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:30 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:30 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 11:03:30 AM 	
Error	mail	
Exception OCA\Mail\Controller\DraftsController::update(): Argument #2 ($accountId) must be of type int, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 230 in file '/var/www/nextcloud/apps/mail/lib/Controller/DraftsController.php' line 155
Apr 25, 2024, 11:01:33 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:39 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:39 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:39 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:39 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:39 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:31 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:31 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:31 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:31 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:30 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:28 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:28 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:27 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:27 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:27 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:26 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:26 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:25 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:25 AM 	
Warning	collectives	
Collectives full-text search is not operational, because the PDO SQLite driver is not available.
Apr 25, 2024, 10:59:25 AM 	
Error	PHP	
Optional parameter $bcc declared before required parameter $body is implicitly treated as a required parameter at /var/www/nextcloud/apps/mail/lib/Model/NewMessageData.php#120
Apr 25, 2024, 10:52:51 AM 	
Error	mail	
ServiceException Could not load message
Apr 25, 2024, 10:51:13 AM 	
Error	mail	
ServiceException Could not load message
Apr 25, 2024, 10:51:09 AM 	
Error	PHP	
Optional parameter $knownIds declared before required parameter $partialOnly is implicitly treated as a required parameter at /var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php#111
Apr 25, 2024, 10:50:36 AM 	
Warning	mail	
itinerary file doesn't exist
Apr 25, 2024, 8:21:13 AM 	
Info	updater	
\OC\Updater::resetLogLevel: Reset log level to Warning(2)
Apr 25, 2024, 8:21:00 AM 	
Info	updater	
\OC\Updater::maintenanceDisabled: Turned off maintenance mode
Apr 25, 2024, 8:21:00 AM 	
Info	updater	
\OC\Updater::updateEnd: Update successful
Apr 25, 2024, 8:21:00 AM 	
Info	updater	
\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check
Apr 25, 2024, 8:20:59 AM 	
Info	updater	
\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...
Apr 25, 2024, 8:20:44 AM 	
Info	updater	
OC\Repair\Events\RepairStepEvent: Repair step: Queue a job to generate metadata
Apr 25, 2024, 8:20:44 AM 	
Info	updater	
OC\Repair\Events\RepairStepEvent: Repair step: Add AI tasks cleanup job
Apr 25, 2024, 8:20:44 AM 	
Info	updater	
OC\Repair\Events\RepairStepEvent: Repair step: Add possibly missing system config
Apr 25, 2024, 8:20:44 AM 	
Info	updater	
OC\Repair\Events\RepairStepEvent: Repair step: Clean up abandoned apps
Apr 25, 2024, 8:20:44 AM 	
Info	updater	
OC\Repair\Events\RepairStepEvent: Repair step: Add token cleanup j
3 Likes

I have the same issue, although I would add that you don’t even have to stop interacting with the interface, it will log me out even if I am actively doing something.

It started with the update to 28.0.5.
I am running PHP 8.2.

Essentially the same thing happens on my Nextcloud instance, as described above.

Sadly I also can’t upgrade to version 29 because of incompatible apps, downgrading is unfortunately also not an option, as my database backups were disabled for some reason… :sweat_smile:

I don’t get any errors when it happens, only indirect ones like the following. I don’t know if it is relevant, but here it is:

Request ID: [REQ_ID]
Level: 3
Time: 2024-04-26T00:22:01+00:00
Remote Address: [REMOTE_ADDR]
User: --
App: core
Method: GET
URL: /apps/memories/api/clusters/recognize/preview?name=5233&cover=64491&cover_etag=fe4a5ad21b612988a3503a47fb999e71
Message: Renewing session token failed: Token does not exist: [TOKEN]
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0
Version: 28.0.5.1
Exception:
  - Exception: OC\Authentication\Exceptions\InvalidTokenException
  - Message: Token does not exist: [TOKEN]
  - Code: 0
  - Trace:
    - File: /var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php
      Line: 167
      Function: getTokenFromCache
    - File: /var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php
      Line: 248
      Function: getToken
    - File: /var/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php
      Line: 63
      Function: OC\Authentication\Token\{closure}
    - File: /var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php
      Line: 247
      Function: atomic
    - File: /var/www/nextcloud/lib/private/Authentication/Token/Manager.php
      Line: 172
      Function: renewSessionToken
    - File: /var/www/nextcloud/lib/private/User/Session.php
      Line: 929
      Function: renewSessionToken
    - File: /var/www/nextcloud/lib/base.php
      Line: 1151
      Function: loginWithCookie
    - File: /var/www/nextcloud/lib/base.php
      Line: 1058
      Function: handleLogin
    - File: /var/www/nextcloud/index.php
      Line: 39
      Function: handleRequest
File: /var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php
Line: 197
Message: Renewing session token failed: Token does not exist: [TOKEN]
User: [USERNAME]
Exception: []
Custom Message: Renewing session token failed: Token does not exist: [TOKEN]
ID: [ID]

1 Like

It’s happening for me as well. It was happening on my nc29 RC, but I assumed it wouldn’t be part of the update to 28. So, now it’s happening on my mc29 test installation, as well as my nc28 that I use more seriously, and it’s becoming annoying. It just logged me out of a video call and I had to log back in and re-join.

If there are settings that need to be set for a work-around, I would gladly set them. Maybe there are some to try that relate to session expiration? Although it seems a little more idiosyncratic than that.

1 Like

I just tried to login to my interface this morning, it didn’t even fully load my dashboard before an error on the top right popped and said “You are not logged in”, followed by “reloading page in 5” and that refreshed until 0 and then I was back at the login screen.

These are the only logs entries I see since my login attempt:

Warning mail itinerary file doesn’t exist

Apr 27, 2024, 7:42:30 AM

|Error|core|InvalidTokenException Token does not exist: (cleared listed token in case it’s senstive)

Renewing session token failed: Token does not exist: (cleared listed token in case it’s senstive)

Did anyone experiencing this issue A. Have Memories app installed and B. Had some sort of error with it during 28.0.5 upgrade? I remember I glanced at my console while it was upgrading and there was a couple yellow warnings regarding Memories, but it moved on before I could read it or capture it. I just disabled my Memories app to see if that helps with my situation at all.

Not saying it’s the cause, but right now I’m just trying stuff.

Well, although disabling Memories seemed to make it a little more stable, this weekend I tried to edit a Calendar event and it failed and logged me out, and just this morning I logged in, acknowledged 2 factor auth, and it logged me out and returned me to the login screen again before the dashboard could fully load.

Any ideas on what to check? It’s obviously not a idle timer, it occurs when trying to work, as indicated by previous people as well.

After the failed login, this was the only new Log entry:

[PHP] Error: TypeError: OCA\UserStatus\Controller\UserStatusController::__construct(): Argument #3 ($userId) must be of type string, null given at /var/www/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#54
GET /ocs/v2.php/apps/user_status/api/v1/user_status
from 19x.x.x.x by – at Apr 29, 2024, 7:47:13 AM

I’m having a similar experience. While it may appear to be related to errors (exceptions?), after disabling a bunch of non-critical apps on my NC29 test server, the spontaneous logout is still occurring. Thanks for your post, although where this will lead I don’t know.

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.

3 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.

2 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