-
-
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]: Tried to log in "username" but could not verify token #33919
Comments
Whohoo. I've rarely been so happy to see an error in the logs. So, this is from #33772. My suspicion is that this happens when the users open their browser in the morning. Over night the server's php session has expired and the user probably had more than one tab open. The browser then sends off multiple concurrent requests and each of them tries to recover the session from cookies. But then only one request actually wins because it will take the valid token. The other requests show up too late, when the valid token had already been cleared from the database. Just a theory but curios to hear if this could have been the case for you or your users. |
#33930 adds more debugging insights. If you can, apply the patch on your instance, set the log level to debug for a day and then check if |
I think your right because I believe I did have alot of tabs open from the night and in the morning I open a few sessions and accessed the server but the other tabs where closed. Once I get in the office I will test and let you know |
@ChristophWurst I think we're good i applied the #33930 seen this in the debug logs
|
Okay but do you see a bunch of One single |
Just tried it and it comes up under the error level
|
Tried it from a different pc
But should that error be under debug ? |
We can lower to warning. Nevertheless this is an error in the auth flow and likely leads to a defunct browser window. |
Yea I think either warring or info since it really giving you info and technically since its not something to worry about . What do you think ? Id suggest info but what ever you think is best :) |
The bigger picture is that once I have clear insight into the token verification errors and what leads up to them, I want to actually fix them. They shouldn't be part of the auth flow. A token mismatch should only be detected for malicious users, not for someone who opened their browser in the morning with Nextcloud pages open. |
Ahhh i see that makes a lot more sense if you need any testing from my end I'm happy to help. |
having the same issue on my NC25 in the log i have one error
one solution which worked for me is to delete login_token entries in the oc_preferences table |
I am on beta 6 - and this should have been merged, correct? |
It is not merged. Right now this is an optional patch. |
Just wanted to chime in that I am facing the same issue. Some accounts straight up can not login at all on their Browsers, and need to use temporary accounts to get into the drive. |
Could you ask one of the affected users to clear their cookies and see if that helps? |
Uhh, I was physically at his PC earlier, so when that happens again, I'll make sure to try that. On another note, it even happened to me on my main, super admin (owner) account. My interface sometimes opened for a quick sec before it gave me a countdown for logging me out, and when I went quickly into settings from there, it stopped and fixed it. Truly weird. |
If you have that optional patch readily available for install, maybe you can let me know quickly how to install it so I can give it a try on our system, see if that solves it permanently. If it does, it means the patch is also fully functional. |
I am also affected by that and cookie cleaning/private window did not help. Server reboot/PHP cache clean helped though |
That's what I did as well as soon as 3 accounts had that issue (and I can't create hundreds of temporary accounts as a workaround), and it solved it. But I also can't reboot the server daily really. |
This is not a v25 thing only (as it has been backported); I get this same error on v23.0.10 (after upgrade from v23.0.9). As far as i can see, it triggers for every user.
|
I got it on |
Yes, same got the errors on 24.0.6 |
I just had to apply #35419 because some who could not login also did not want to clear his complete browsing history on his iPhone. I could still login after applying, and it seems to work for those who got stuck in the login loop. |
I ran into this bug on Debian 11 using php7.4-fpm 7.4.33 and nextcloud 25.0.2 connecting with Firefox 108.0. I manually applied the patch in #35419 and was able to log in. |
Sorry, I've been really busy. But wanted to chime in that I had also applied the patch soon after, and it seems that so far there's been no case of login issues. To me, the bug seems fixed (or at least mitigated). |
Interesting enough the login loops happened a lot for me on two instances around November 2022. For the past few weeks the issue has not shown once. |
I updated to Nextcloud 25.0.3.2 two days ago and I am facing this issue once again on iOS in Safari. Unfortunately, deleting the website data does not fix the issue for me (Settings --> Safari --> Advanced --> Website Data --> deleted data from my NC domain and restarted safari). Which logs should I provide? |
Same error on 25.0.1 ... really annoying, no bruteforce data in database, varnish cache refreshed on my gandi hosting ... |
Install the suggested fix, it works. It's not implemented into any public release yet as far as I'm concerned, so gotta wait until that happens. |
Another temporary fix that worked for me at least was to run a occ maintenance:repair After this, I could log in without any problems |
OK the fiwx works f22101d#diff-af67c083dc101bd3457884ce98ffe78e12f24150e1962d78bdbbe452173df3b9 |
I'm having this all of a sudden on an up-to-date 25.0.3 after upgrading php from pph7 to php8. |
The fix has been mentioned a quadrillion times here now. Apply that one and see if it works for you :) |
Did that already, it works, it should be RELEASED is what I'm saying. |
Well I mean in that case it ain't a huge problem for us, but I agree, I don't understand why it hasn't made it into the main release somehow yet when it seems to be working fine with no side effects to speak of. Makes you wonder 🤔 |
I'm sorry to break your negativity spiral but the fix went into stable25 and is the QA pipeline for 25.0.4. RC1 has the fix, if you want to upgrade early. Cheers. |
that's great, all I wanted to know ! |
Not a negativity spiral, merely an observation. But good to know that it'll be out in the next one then ^^ |
This is a really good news, thx for the fix and all the work ;) |
Hello, I'm using NC 26 and still the same problem in safari only. Does anyone have an idea? Same error in logs: [Tried to log in "username" but could not verify token]. Have to re-login every time, also on mobile (iOS Safari). It was working fine with NC25... |
This problem does not seem to have been solved in v26.0.0.11 - even though #35419 was merged - seeing how as I'm currently unable to login using Firefox/Android on a device which had a single tab open yesterday. Deleting site data does not change this, nor does running occ maintenance:repair. I can login using a different browser but not with Firefox, all I get is an empty page showing the site logo and the footer - there is no error message but no login/password request either. This does not work:
This does work:
The error message in the log is the one which has been shown countless times already:
The really annoying thing is that I do not get a chance to login at all since the login/password request does not show up - only the site logo and the footer on an otherwise empty page. Move: #37492 |
@Yetangitu check if your observations match with #37492 or file a new ticket please. |
Apart from the list of enabled/disabled apps that description seems to match, as does this one. |
This has started happening again for me |
Still happening with NC27 as described here: #37492 |
I have something like this also in 27.1.3. It started some months ago. I don't leave any tabs open ever, but when I fire up the browser (with only one empty tab) and request https://mynextcloud/apps/news, about twice a day messages start to appear on the upper right corner (I don't remember the text, but something like I'm not logged in) and I have to login again. But if I'm fast enough to close this tab, I can reopen the same url and I'm in. If I let it go, i will be logged out. Then I have to login twice to get to the TOTP dialog. I have the same in the logs when this occures (see below). Please solve this, as it is very annoying, as I have to find my phone for the TOTP on daily basis just to read the news.
By the way is it ok to require login for css data? Thanks in advance. |
Bug description
Not sure what's causing this the user is LDAP backend
Steps to reproduce
1.Open brower
2.go to server.domain.com
3.takes to me dashboard
Expected behavior
Should not see this error in logs
Installation method
Community Manual installation with Archive
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.0
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Updated to a major version (ex. 22.2.3 to 23.0.1)
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
Nextcloud Signing status
No response
Nextcloud Logs
Additional info
The text was updated successfully, but these errors were encountered: