nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.79k stars 4k forks source link

[Bug]: OC\Authentication\Exceptions\InvalidTokenException: Token is too short for a generated token, should be the password during basic auth #41156

Closed MPTopper closed 10 months ago

MPTopper commented 11 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

Today I updated my Nextcloud server from 27.1.2 to 27.1.3. Immediately afterwards warnings came (every minute) but everything before worked smoothly - Android/Windows Nextcloud clients are connected - connection is succesful, but warnings come nevertheless. Log:

[core] Warnung: OC\Authentication\Exceptions\InvalidTokenException: Token is too short for a generated token, should be the password during basic auth at <<closure>>

0. /var/www/html/nextcloud/lib/private/Authentication/Token/Manager.php line 133
   OC\Authentication\Token\PublicKeyTokenProvider->getToken("*** sensitive parameters replaced ***")
1. /var/www/html/nextcloud/lib/private/User/Session.php line 782
   OC\Authentication\Token\Manager->getToken("*** sensitive parameters replaced ***")
2. /var/www/html/nextcloud/lib/private/User/Session.php line 352
   OC\User\Session->validateToken("*** sensitive parameters replaced ***")
3. /var/www/html/nextcloud/lib/private/User/Session.php line 452
   OC\User\Session->login("*** sensitive parameters replaced ***")
4. /var/www/html/nextcloud/lib/private/User/Session.php line 580
   OC\User\Session->logClientIn("*** sensitive parameters replaced ***")
5. /var/www/html/nextcloud/lib/base.php line 1150
   OC\User\Session->tryBasicAuthLogin()
6. /var/www/html/nextcloud/ocs/v1.php line 61
   OC::handleLogin()
7. /var/www/html/nextcloud/ocs/v2.php line 23
   require_once("/var/www/html/nextcloud/ocs/v1.php")

Steps to reproduce

  1. No idea

Expected behavior

Everything is working but log is blasted with warnings

Installation method

Community Manual installation with Archive

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated from a MINOR version (ex. 22.1 to 22.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

solracsf commented 11 months ago

See https://github.com/nextcloud/server/issues/38674#issuecomment-1580687625

mellow2012 commented 11 months ago

hi here same problem. log is full with this entry and log level is 2

IPolarisI commented 11 months ago

Same for me. My setup is the same (except for php being 8.2), log level is 2.

What seems to trigger it is any access made via caldav (Windows/Android calendar) and webdav. Everything works though, tasks and files sync both ways.

MPTopper commented 11 months ago

@IPolarisI yes, was also my assumption that CalDav access could be the problem

j-ed commented 11 months ago

After updating Nextcloud to the latest version several users have reported the same issue. See here:

https://help.nextcloud.com/t/token-is-too-short-for-a-generated-token-should-be-the-password-during-basic-auth/173064

m-i-k-e-y commented 11 months ago

I have my log filled with these messages too, alternating with this token does not exist message:

[core] Warnung: OC\Authentication\Exceptions\InvalidTokenException: Token does not exist: token does not exist at <<closure>>

 0. /var/www/nextcloud/lib/private/Authentication/Token/Manager.php line 133
    OC\Authentication\Token\PublicKeyTokenProvider->getToken("*** sensitive parameters replaced ***")
 1. /var/www/nextcloud/lib/private/User/Session.php line 782
    OC\Authentication\Token\Manager->getToken("*** sensitive parameters replaced ***")
 2. /var/www/nextcloud/lib/private/User/Session.php line 257
    OC\User\Session->validateToken("*** sensitive parameters replaced ***")
 3. /var/www/nextcloud/lib/private/User/Session.php line 232
    OC\User\Session->validateSession()
 4. /var/www/nextcloud/lib/private/legacy/OC_App.php line 228
    OC\User\Session->getUser()
 5. /var/www/nextcloud/lib/private/App/AppManager.php line 198
    OC_App::getEnabledApps()
 6. /var/www/nextcloud/lib/private/legacy/OC_App.php line 126
    OC\App\AppManager->loadApps()
 7. /var/www/nextcloud/lib/private/legacy/OC_User.php line 128
    OC_App::loadApps()
 8. /var/www/nextcloud/lib/base.php line 770
    OC_User::setupBackends()
 9. /var/www/nextcloud/lib/base.php line 1196
    OC::init()
10. /var/www/nextcloud/remote.php line 119
    require_once("/var/www/nextcloud/lib/base.php")

Caused by:

OCP\AppFramework\Db\DoesNotExistException: token does not exist at <<closure>>

 0. /var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php line 168
    OC\Authentication\Token\PublicKeyTokenMapper->getToken("*** sensitive parameters replaced ***")
 1. /var/www/nextcloud/lib/private/Authentication/Token/Manager.php line 133
    OC\Authentication\Token\PublicKeyTokenProvider->getToken("*** sensitive parameters replaced ***")
 2. /var/www/nextcloud/lib/private/User/Session.php line 782
    OC\Authentication\Token\Manager->getToken("*** sensitive parameters replaced ***")
 3. /var/www/nextcloud/lib/private/User/Session.php line 257
    OC\User\Session->validateToken("*** sensitive parameters replaced ***")
 4. /var/www/nextcloud/lib/private/User/Session.php line 232
    OC\User\Session->validateSession()
 5. /var/www/nextcloud/lib/private/legacy/OC_App.php line 228
    OC\User\Session->getUser()
 6. /var/www/nextcloud/lib/private/App/AppManager.php line 198
    OC_App::getEnabledApps()
 7. /var/www/nextcloud/lib/private/legacy/OC_App.php line 126
    OC\App\AppManager->loadApps()
 8. /var/www/nextcloud/lib/private/legacy/OC_User.php line 128
    OC_App::loadApps()
 9. /var/www/nextcloud/lib/base.php line 770
    OC_User::setupBackends()
10. /var/www/nextcloud/lib/base.php line 1196
    OC::init()
11. /var/www/nextcloud/remote.php line 119
    require_once("/var/www/nextcloud/lib/base.php")

PROPFIND /remote.php/dav/calendars/nc_user/personal/
from [IPv6] by nc_user at 2023-10-27T11:31:03+00:00

The last line (PROPFIND...), which can be found in the Token too short messages too, makes me believe, this is related to calendar.

solracsf commented 11 months ago

This was already happening before, it was just not logged before 27.1.3 / 26.0.8, it is now after @ChristophWurst PR https://github.com/nextcloud/server/pull/40785

This is not an Error, but a Warning.

IPolarisI commented 11 months ago

@solracsf Well the situation's still not ideal, as it makes the log unuseable :/

solracsf commented 11 months ago

Make it loglevel 3 as I do. I don't care about Warnings in production (I care if I try to debug something).

IPolarisI commented 11 months ago

@solracsf Doesn't make it any more usable. There have been problems I've corrected after seeing warnings about it. Having the log filled to the brim with issues nothing can be done about will only people not use the warning level.

brianjmurrell commented 11 months ago

This was already happening before, it was just not logged before 27.1.3 / 26.0.8, it is now after @ChristophWurst PR #40785

This is not an Error, but a Warning.

A warning of what though? What should I do to mitigate what is being warned about?

And I don't mean just how do I hide the warning by setting log level to 3. The question is how do I correct the actual situation the warning is being logged about?

m-i-k-e-y commented 10 months ago

This is not restricted to calendar, seems to be a general issue accessing nextcloud throu dav. I'm using dav2fs on linux and it causes this warning, but seems to work fine otherwise:

[core] Warnung: OC\Authentication\Exceptions\InvalidTokenException: Token is too short for a generated token, should be the password during basic auth at <<closure>>

 0. /var/www/nextcloud/lib/private/Authentication/Token/Manager.php line 133
    OC\Authentication\Token\PublicKeyTokenProvider->getToken("*** sensitive parameters replaced ***")
 1. /var/www/nextcloud/lib/private/User/Session.php line 782
    OC\Authentication\Token\Manager->getToken("*** sensitive parameters replaced ***")
 2. /var/www/nextcloud/lib/private/User/Session.php line 352
    OC\User\Session->validateToken("*** sensitive parameters replaced ***")
 3. /var/www/nextcloud/lib/private/User/Session.php line 452
    OC\User\Session->login("*** sensitive parameters replaced ***")
 4. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php line 114
    OC\User\Session->logClientIn("*** sensitive parameters replaced ***")
 5. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Backend/AbstractBasic.php line 103
    OCA\DAV\Connector\Sabre\Auth->validateUserPass("*** sensitive parameters replaced ***")
 6. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php line 232
    Sabre\DAV\Auth\Backend\AbstractBasic->check()
 7. /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php line 139
    OCA\DAV\Connector\Sabre\Auth->auth()
 8. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php line 179
    OCA\DAV\Connector\Sabre\Auth->check()
 9. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php line 135
    Sabre\DAV\Auth\Plugin->check()
10. /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\Auth\Plugin->beforeMethod()
11. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 456
    Sabre\DAV\Server->emit()
12. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod()
13. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
14. /var/www/nextcloud/apps/dav/lib/Server.php line 365
    Sabre\DAV\Server->exec()
15. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
16. /var/www/nextcloud/remote.php line 172
    require_once("/var/www/nextcl ... p")

PROPFIND /remote.php/dav/files/nc_user/
from [IPv6] at 2023-10-30T10:01:01+00:00
ChristophWurst commented 10 months ago

The log level can be lowered to debug :+1:

Anyone up for a simple PR to address that?

brianjmurrell commented 10 months ago

The log level can be lowered to debug 👍

Or we could correct the situation that the WARNING is warning us about. What is that situation? How do we correct it?

Surely a warning is there to warn you about something you need to fix right? If it's not something that needs fixing then it should not be a warning.

MPTopper commented 10 months ago

Hi Christoph. I adjusted loglevel from 2 to 0 (Debug) and noticed that my initial log entry comes as a pair together with that one:

[no app in context] Fehlersuche: OC\Authentication\Exceptions\InvalidTokenException: Token is too short for a generated token, should be the password during basic auth at <>

  1. /var/www/html/nextcloud/lib/private/Authentication/Token/Manager.php line 133 OC\Authentication\Token\PublicKeyTokenProvider->getToken(" sensitive parameters replaced ")
  2. /var/www/html/nextcloud/lib/private/User/Session.php line 528 OC\Authentication\Token\Manager->getToken(" sensitive parameters replaced ")
  3. /var/www/html/nextcloud/lib/private/User/Session.php line 438 OC\User\Session->isTokenPassword(" sensitive parameters replaced ")
  4. /var/www/html/nextcloud/lib/private/User/Session.php line 580 OC\User\Session->logClientIn(" sensitive parameters replaced ")
  5. /var/www/html/nextcloud/lib/base.php line 1150 OC\User\Session->tryBasicAuthLogin()
  6. /var/www/html/nextcloud/ocs/v1.php line 61 OC::handleLogin()
  7. /var/www/html/nextcloud/ocs/v2.php line 23 require_once("/var/www/html/nextcloud/ocs/v1.php")

Nothing else noticed. Is this what you wanted?

ChristophWurst commented 10 months ago

Token is too short for a generated token, should be the password during basic auth

is the topic of this ticket. What other log entry does it come as a pair with?

MPTopper commented 10 months ago

This pair comes together:

[core] Warnung: OC\Authentication\Exceptions\InvalidTokenException: Token is too short for a generated token, should be the password during basic auth at <>

  1. /var/www/html/nextcloud/lib/private/Authentication/Token/Manager.php line 133 OC\Authentication\Token\PublicKeyTokenProvider->getToken(" sensitive parameters replaced ")
  2. /var/www/html/nextcloud/lib/private/User/Session.php line 782 OC\Authentication\Token\Manager->getToken(" sensitive parameters replaced ")
  3. /var/www/html/nextcloud/lib/private/User/Session.php line 352 OC\User\Session->validateToken(" sensitive parameters replaced ")
  4. /var/www/html/nextcloud/lib/private/User/Session.php line 452 OC\User\Session->login(" sensitive parameters replaced ")
  5. /var/www/html/nextcloud/lib/private/User/Session.php line 580 OC\User\Session->logClientIn(" sensitive parameters replaced ")
  6. /var/www/html/nextcloud/lib/base.php line 1150 OC\User\Session->tryBasicAuthLogin()
  7. /var/www/html/nextcloud/ocs/v1.php line 61 OC::handleLogin()
  8. /var/www/html/nextcloud/ocs/v2.php line 23 require_once("/var/www/html/nextcloud/ocs/v1.php")

[no app in context] Fehlersuche: OC\Authentication\Exceptions\InvalidTokenException: Token is too short for a generated token, should be the password during basic auth at <>

/var/www/html/nextcloud/lib/private/Authentication/Token/Manager.php line 133
OC\Authentication\Token\PublicKeyTokenProvider->getToken("*** sensitive parameters replaced ***")
/var/www/html/nextcloud/lib/private/User/Session.php line 528
OC\Authentication\Token\Manager->getToken("*** sensitive parameters replaced ***")
/var/www/html/nextcloud/lib/private/User/Session.php line 438
OC\User\Session->isTokenPassword("*** sensitive parameters replaced ***")
/var/www/html/nextcloud/lib/private/User/Session.php line 580
OC\User\Session->logClientIn("*** sensitive parameters replaced ***")
/var/www/html/nextcloud/lib/base.php line 1150
OC\User\Session->tryBasicAuthLogin()
/var/www/html/nextcloud/ocs/v1.php line 61
OC::handleLogin()
/var/www/html/nextcloud/ocs/v2.php line 23
require_once("/var/www/html/nextcloud/ocs/v1.php")
ChristophWurst commented 10 months ago

Fehlersuche: O..

That must be the Denglisch translation for Debug: O..

Could you please post the raw versions of the two entries?

MPTopper commented 10 months ago

First:

{"reqId":"I5Mfg3Dh6t45vq3PhbHo","level":2,"time":"2023-10-30T15:30:28+01:00","remoteAddr":"172.20.20.20","user":"--","app":"core","method":"GET","url":"/ocs/v2.php/apps/serverinfo/api/v1/info","message":"Session token is invalid because it does not exist","userAgent":"Mozilla/5.0 (Windows NT; Windows NT 10.0; de-DE) WindowsPowerShell/5.1.20348.2031","version":"27.1.3.2","exception":{"Exception":"OC\\Authentication\\Exceptions\\InvalidTokenException","Message":"Token is too short for a generated token, should be the password during basic auth","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/Authentication/Token/Manager.php","line":133,"function":"getToken","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":782,"function":"getToken","class":"OC\\Authentication\\Token\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":352,"function":"validateToken","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":452,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":580,"function":"logClientIn","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/base.php","line":1150,"function":"tryBasicAuthLogin","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/html/nextcloud/ocs/v1.php","line":61,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/html/nextcloud/ocs/v2.php","line":23,"args":["/var/www/html/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","Line":155,"message":"Session token is invalid because it does not exist","user":"PRTGMonitor","exception":[],"CustomMessage":"Session token is invalid because it does not exist"},"id":"653fbe0560943"}

Second:

{"reqId":"I5Mfg3Dh6t45vq3PhbHo","level":0,"time":"2023-10-30T15:30:28+01:00","remoteAddr":"172.20.20.20","user":"--","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/serverinfo/api/v1/info","message":"Token is not valid: Token is too short for a generated token, should be the password during basic auth","userAgent":"Mozilla/5.0 (Windows NT; Windows NT 10.0; de-DE) WindowsPowerShell/5.1.20348.2031","version":"27.1.3.2","exception":{"Exception":"OC\\Authentication\\Exceptions\\InvalidTokenException","Message":"Token is too short for a generated token, should be the password during basic auth","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/Authentication/Token/Manager.php","line":133,"function":"getToken","class":"OC\\Authentication\\Token\\PublicKeyTokenProvider","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":528,"function":"getToken","class":"OC\\Authentication\\Token\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":438,"function":"isTokenPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/private/User/Session.php","line":580,"function":"logClientIn","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/lib/base.php","line":1150,"function":"tryBasicAuthLogin","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/html/nextcloud/ocs/v1.php","line":61,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/html/nextcloud/ocs/v2.php","line":23,"args":["/var/www/html/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","Line":155,"message":"Token is not valid: Token is too short for a generated token, should be the password during basic auth","exception":[],"CustomMessage":"Token is not valid: Token is too short for a generated token, should be the password during basic auth"},"id":"653fbe056096c"}
brianjmurrell commented 10 months ago

Still no hint on what the situation is that this is warning about and how we rectify it rather than just burying the warning message?

MPTopper commented 10 months ago

Just for the sake of completeness: Today I found out that (in my individual case) the warning is throwed when a custom PRTG sensor (powershell) is pulling a web request towards my Nextcloud instance - when I am stopping this sensor no more warnings appear. I am not sure what exactly is causing this, therefore I am linking the GitHub repository where it comes from:

https://github.com/dwydler/Powershell-Skripte/blob/master/Paessler/PRTG/paessler-prtg_monitor-nextcloud-instance.ps1

zero0cool0 commented 10 months ago

Not an explanation as to what this warning is exactly about, but if it helps anyone:

I have a user that belongs to a group that is not enforcing two factor authentication. The user is using rclone (v1.65.0-beta) to upload / delete files in an automated way and was using username / password login. After changing the user to use 2FA and helping to create an app-specific password, the log entries were gone.

ChristophWurst commented 10 months ago

One can authenticate against Nextcloud with a login password or an app password. App passwords are checked first. To prevent useless lookups of passwords that can't semantically be an app password an exception for an unknown app password is thrown. This is absolutely nothing to worry about. The request is simply using a login password.

Therefore, the logging level can be dropped to debug safely.

IPolarisI commented 10 months ago

@ChristophWurst How come it was brought to warnings ?

ChristophWurst commented 10 months ago

Read the ticket: https://github.com/nextcloud/server/issues/41156#issuecomment-1784043446.

IPolarisI commented 10 months ago

@ChristophWurst Ah, it wasn't logged at all before ? Thanks ^_^

andreaskernke commented 10 months ago

I don't know if it helps. After I uninstalled the Caldav sync app from my Android devices, no more alerts appeared in the log.

IPolarisI commented 10 months ago

@andreaskernke Well if you don't use the function that triggers the warning, the warning doesn't get triggered of course x)

i-B4se commented 10 months ago

Hello, is there any solution for this bug? We don't have Android in our household.

Thank you in advance.

andreaskernke commented 10 months ago

@andreaskernke Well if you don't use the function that triggers the warning, the warning doesn't get triggered of course x)

Of course. I use DavX5 instaed. What I mean ist, when you know what triggers the warning, then you might be able to replace it.

IPolarisI commented 10 months ago

Oh, I use DavX5 and still have the message :/

@i-B4se : This gets trigger when you access your server vie Cladav or Webdav, not necessarily on Android. It's on Nextcloud's side, the next release should fix it.

AndyXheli commented 9 months ago

Issues back on NC 28.0.1

ChristophWurst commented 9 months ago

At which error level?

AndyXheli commented 9 months ago

Error

{"reqId":"TKNfkzrrfzsdmFzwgstq","level":3,"time":"2023-12-21T16:09:48-06:00","remoteAddr":"10.241.202.37","user":"--","app":"core","method":"GET","url":"/","message":"Renewing session token failed: Token does not exist: token does not exist","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","version":"28.0.1.1","exception":{"Exception":"OC\Authentication\Exceptions\InvalidTokenException","Message":"Token does not exist: token does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":225,"function":"getToken","class":"OC\Authentication\Token\PublicKeyTokenProvider","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OC\Authentication\Token\{closure}","class":"OC\Authentication\Token\PublicKeyTokenProvider","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":224,"function":"atomic","class":"OC\Authentication\Token\PublicKeyTokenProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/Manager.php","line":170,"function":"renewSessionToken","class":"OC\Authentication\Token\PublicKeyTokenProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":906,"function":"renewSessionToken","class":"OC\Authentication\Token\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1151,"function":"loginWithCookie","class":"OC\User\Session","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/base.php","line":1058,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","Line":177,"Previous":{"Exception":"OCP\AppFramework\Db\DoesNotExistException","Message":"token does not exist","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":168,"function":"getToken","class":"OC\Authentication\Token\PublicKeyTokenMapper","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":225,"function":"getToken","class":"OC\Authentication\Token\PublicKeyTokenProvider","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OC\Authentication\Token\{closure}","class":"OC\Authentication\Token\PublicKeyTokenProvider","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php","line":224,"function":"atomic","class":"OC\Authentication\Token\PublicKeyTokenProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/Authentication/Token/Manager.php","line":170,"function":"renewSessionToken","class":"OC\Authentication\Token\PublicKeyTokenProvider","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":906,"function":"renewSessionToken","class":"OC\Authentication\Token\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1151,"function":"loginWithCookie","class":"OC\User\Session","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/lib/base.php","line":1058,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenMapper.php","Line":98},"message":"Renewing session token failed: Token does not exist: token does not exist","user":"axheli","exception":[],"CustomMessage":"Renewing session token failed: Token does not exist: token does not exist"},"id":"65858318ad4d8"}

ChristophWurst commented 9 months ago

Renewing session token failed: Token does not exist: token does not exist

This ticket was about Token is too short for a generated token, which has been addressed.

AndyXheli commented 9 months ago

Sorry I'm not understanding this is a different error? Or should I just ignore it ?

ChristophWurst commented 9 months ago

It's different and probably worth a ticket. That condition can happen when two requests race for the same token. The request with the error lost the race.

AndyXheli commented 9 months ago

Ahh okay! Thank you very much sir.

brianjmurrell commented 9 months ago

@AndyXheli Can you please post the ticket number for the ticket you filed here so that people that come across this ticket see that there is a new ticket and don't keep piling on this one for the wrong issue? Thanks in advance.

AndyXheli commented 9 months ago

You got it!! Give me a little I'll create a new issue and link it 😃

brianjmurrell commented 8 months ago

@AndyXheli Did you ever create that new issue? If so, could you post the link here please?

t0rb3n commented 7 months ago

Maybe useful for someone else. In my case this log entry was triggered by my hassio instance via the Nextcloud integration. Deleting and re-adding it with an app password seems to not trigger the log entry anymore.

AndyXheli commented 7 months ago

@brianjmurrell sorry for the late response heres the ticket on that #43214