I deleted an account, now I can't recreate it.. error: "username_exists"

So… how do I recreate the account after deleting it if I’m getting the error “username_exists”? The whole reason I deleted the account was because I couldn’t remember the password.

I read somewhere that I have to delete files from the .storage folder. I’m not sure what file(s) to delete. I am very motivated to use the same username… however, I don’t want to lose all my other users and their respective passwords.

Is there a reason why administrators can’t just change passwords for regular users?

Very good question.

I found the users in auth and auth_provider.homeassistant in the .storage directory.

I was able to resolve the issue… but, man… it was a bit extreme…

I had to carefully remove the json entries related to the username in both auth and auth_provider.homeassistant files under .storage.

I just hope this doesn’t cause problems in the future.

I’m hoping Home Assistant will make it possible to allow real user account management by administrators in the GUI.

2 Likes

I was able to remove/recreate users with the same usernames before, not sure why you got an error.

lol it absolutely caused problems in the future, bricked my entire installation.

2 Likes

I delete a user and tried to recreate the user with the same name but no luck.

“Username already exists”

I found no reference to the user in both auth and auth_provider.homeassistant

Any other suggestions?

I have the same issue, can;t add a new ‘user’ as already exists. But nothing shows under user or people for that name or display name. Keen to not break anything, and would rather not create a bastardised name to work around.

I feel like this is kind of a security breach. I’ll describe my findings:

  1. As admin: Settings → Users → Create new user (popup 1 opens)
  2. Tick “allow user to log in”
  3. (Popup 2 opens) that asks me for a username and password. I enter the username and password
  4. I get sent back to popup 1 but press “Cancel”, assuming that Popup 2 created the user
  5. I get sent back to the user list. After refreshing the newly created user does not exist.

I later find out that there is a difference between a “person” and a “user”. I can now use the username and password that I just created to login, even though the person is not listed in the user list.

I also figured out there is no way to delete this username and password through the UI. Instead you have to check all files in the .storage folder for references to the UUID of the username and password and then restart the docker image.

1 Like