Duplicate System Generated Users for Home Assistant Cast

I am seeing duplicate entries for system-generated users named “Home Assistant Cast” – seven of them at last count (see screen snip below).

Is there any way to clean this up as I assume I only need one? When I click in to any of them they are tagged “System Generated” and “Active”. The Administrator switch is “on” and the “DELETE” and “UPDATE” buttons are greyed out so there’s no action possible via the UI as best I can tell.

(HA 0.108.3)

Were you able to solve this? I am having the same issue. I have 5 cast users, 3 cloud users, and 3 Hass.io users – all system generated. I would like to clean this up.

Same here. I think I’m going to look in storage. Maybe it needs a different user for every view?

I ended up manually editing the file that stores info about the HA users to remove the ones I didn’t need (after making a copy!).

I’m away from my HA instance right now and so can’t point to the exact location and it’s been a while since I did this so don’t remember details but will let you know.

That would be great! I definitely would like to know what the name of the file is

they are in .auth in the storage directory

FWIW, that turned out to be a bad idea lol…

Did anyone figure this out?

I have 3 cast users now. Are they all valid? How do I know which to delete from .storage files?

1 Like

OK

There is a bug in Home Assistant. If you delete the Google Cast Integration it does not delete the system user it created. If you rediscover it (which can happen for unknown reasons) it seems to recreate a new system user and leave the old behind. And because it is a system created user, you cannot delete it from the user interface.

So the first thing one thinks about is like when you have to remove a device from Deconz integration and others. You hack the JSON file, again.

If you go to the end of auth file in the .storage directory you find all the Home Assistant Cast users listed at the end.

If you delete the record you find there, and restart Home Assistant it never comes up and keep on flooding the log. It turns out that you also have to find the corresponding record further up in the same file and delete that.

A safer way is this. And this is a work around for a bug. It is horrible. But pretty safe to do.

  1. Delete the Home Assistant Cast integration. Don’t worry, all your devices come back when we re-add it.
  2. Stop Home Assistant.
  3. Take a safety copy of the .storage/auth file
  4. Edit the .storage/auth file and fine a record like this
            {
                "group_ids": [
                    "system-admin"
                ],
                "id": "c77737ea0ed3492989392015e6cd9665",
                "is_active": true,
                "is_owner": false,
                "name": "Home Assistant Cast",
                "system_generated": true
            },

For all of them change the system_generated from true to false. It is safer to just edit these simple strings then trying to delete the JSON records.

  1. Start Home Assistant.
  2. Go to Configuration -> Users. Now you can delete all the Home Assistant Cast users one by one
  3. In the notification area you should see that Home Assistant Cast is presenting itself as discovered. Go ahead and add it again. This creates a new Home Assistant Cast user and only one.

And then hope the bug that put so many of them there is gone.

I will raise a bug report on git hub that the Home Assistant Cast integration does not clean up its user when removed.

1 Like

Bug report ref

3 Likes