-
-
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]: OC\Authentication\Exceptions\InvalidTokenException: Token is too short for a generated token, should be the password during basic auth #41156
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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. |
@IPolarisI yes, was also my assumption that CalDav access could be the problem |
After updating Nextcloud to the latest version several users have reported the same issue. See here: |
I have my log filled with these messages too, alternating with this token does not exist message:
The last line (PROPFIND...), which can be found in the Token too short messages too, makes me believe, this is related to calendar. |
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. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
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? |
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:
|
The log level can be lowered to debug 👍 Anyone up for a simple PR to address that? |
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. |
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 <>
Nothing else noticed. Is this what you wanted? |
is the topic of this ticket. What other log entry does it come as a pair with? |
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 <>
[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 <>
|
That must be the Denglisch translation for Debug: O.. Could you please post the raw versions of the two entries? |
First:
Second:
|
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? |
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: |
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. |
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. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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. |
@andreaskernke Well if you don't use the function that triggers the warning, the warning doesn't get triggered of course x) |
Hello, Thank you in advance. |
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. |
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. |
Issues back on NC 28.0.1 |
At which error level? |
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"} |
This ticket was about |
Sorry I'm not understanding this is a different error? Or should I just ignore it ? |
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. |
Ahh okay! Thank you very much sir. |
@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. |
You got it!! Give me a little I'll create a new issue and link it 😃 |
@AndyXheli Did you ever create that new issue? If so, could you post the link here please? |
Maybe useful for someone else. |
@brianjmurrell sorry for the late response heres the ticket on that #43214 |
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:
Steps to reproduce
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
The text was updated successfully, but these errors were encountered: