mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Invalid or expired admin JWT #419
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rhd on GitHub (Sep 15, 2019).
Hi,
I recently had a drive failure and I had to restore the bitwarden data dir. I'm not using the
bitwardenrs/serverimage. I have 2FA enabled and I am unable to log in after I enter the token. It kicks me out saying the "login has expired". The logs say:Ok, so I figured I could enable the admin interface, I set the
ADMIN_TOKENand when I go to/adminand type in the token, it doesn't let me in. The log states:I've tried restoring several versions of the database all with the same result. I'm stuck here. Can anyone provide any guidance or have any thoughts? The FF extension is unable to log in as well - gives the same error after I type in the token. I have verified the
datein the VM is the same as my PC. I have also setDOMAIN=https://my.domain.com(with my actual domain) as I use a reverse proxy - doesn't help.Out of ideas...
Thanks!
@rhd commented on GitHub (Sep 15, 2019):
I just enabled signups and created a new user. The user creation works as expected but when when I tried to sign in with that user, I got the same failure. Obviously, the new user doesn't have 2FA enabled. The issue doesn't seem related to 2FA.
@rhd commented on GitHub (Sep 15, 2019):
A follow up. The original back I did was using crashplan. I restored from several different points in time - going back months. It turns out I also had a duplicati backup.
For some reason, the crashplan restore wasn't restoring the following files
Maybe it was a permissions problem - not sure. But the duplicati backup, thankfully, was able to restore all these files (although it took several hours - soooooooo slow). But now I can log in and all works fine.
My question is - should I have been able to recover from this? Or did the incomplete restore leave me in a state that should not be possible to recover from?
@dani-garcia commented on GitHub (Sep 15, 2019):
The error is weird but it might be caused by corrupted
rsa_keyfiles. Those handle the login token signing and can be deleted without any important side effects, it will just log out all users until they log back in again.The other two db files work in conjunction with the main
db.sqlitefile. The wal file contains the most recent data before its writen to the main db file, so deleting it might cause some data loss. Not sure what the shm file does but I assume something similar to the wal file.@rhd commented on GitHub (Sep 22, 2019):
@dani-garcia thanks. I guess we'll chalk this up to bad
rsa_keyfiles. I did a test where I deleted all of thersa_key.*(including the public) and things worked as expected. I'm going to close this issue.Thanks!