mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-11 01:10:09 +03:00
Inconsistent User State Prevents Removal/Reset #622
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 @sempervictus on GitHub.
Subject of the issue
Deployment environment
Install method: Arch OS package
Clients used:
Reverse proxy and version:
MySQL/MariaDB or PostgreSQL version:
Other relevant details:
I have a user who's master password is not working and needs to be deleted. Attempting to delete them shows they are the owner of an org to which they do not actually have any access (i am also the owner of that org), verified in the main webui; this false ownership status prevents the user from being deleted so their account can be reset (if it even needs to be given the apparent corruption).
@BlackDex commented on GitHub:
That shows that the user
763ad395-42cd-4e7e-8173-bd1bfc4a8b44has owner access to organization6cc922d9-7303-40a3-ae34-daafaf2f6e9f. So that seems to validate the claim during the deletion process.If you filter the database for only that
org_uuid, are there any other users in there?@sempervictus commented on GitHub:
Sorry, to clarify:
users_organizationstable for org b as:@BlackDex commented on GitHub:
Of which org? That still doesn't answer the question if you have checked the
/admin/interface by going to the/admin/users/overviewendpoint, sohttps://my.domain.tld/admin/users/overview.@BlackDex commented on GitHub:
If there are multiple owners of an org, then you should be able to delete that person just fine. It just needs 1 single owner to exists.
Have you checked the
/admininterface if that user didn't created an organization it self?@sempervictus commented on GitHub:
The user is not even a member of the org, much less an owner.
@sempervictus commented on GitHub:
Interestingly no my membership (listed as owner in the non-admin UI) is not showing up even though i created the org and this other user has never had access to it. DB confuse the
user_uuids somehow?@BlackDex commented on GitHub:
So, then, what does the
/admininterface show you for that user?Do the org uuid's match for the orgs which you think that user is part of?
If you lookup that org_uuid in the organizations table, does that match?
@sempervictus commented on GitHub:
the
/adminview shows the user as amemberoforg Aand anownerinorg B.The user is not a
memberorownerororg Band was never granted rights to it, there was no invite email sent (MTA is internal, we have all the logs) granting them any role inorg B. Whats stranger is that i am the owner oforg Bin both UIs but i cannot remove that user because the removal check for "last owner" fails seemingly due to the weird way in which that user is related to the org. How do i re-create my ownership relationship in the database (i think his somehow replaced mine)? There seem to be cryptographic ties in there which do not suffer the user_uuid being changed.@sempervictus commented on GitHub:
I think it was some sort of corruption - i deleted the org in question, which allowed me to remove the user. Might be postgres time :)
@BlackDex commented on GitHub:
uuid's do not flip somehow. So either the database is corrupted. Or someone did some manual database changes which caused this strange behavior. But if what you say what you see in the database is the source of truth, then you shouldn't be able to login into your account have access to that org.
The problem here is, i do not have to full picture.
I would need at least a dump of the users, organizations and users_organizations tables (emails, keys and names excluded of course) to make s better guess.
@BlackDex commented on GitHub:
I'm running on sqlite for many many years already. No issues at all.
Every database could get corrupted in some way.
Just make sure you create backups in the right way, and use the correct storage. Sqlite for example doesn't work correctly via shared storage and could get corrupted.
@BlackDex commented on GitHub:
Btw, in glad it's solved