Skip to content
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

HA Core Failure after upgrade. #20

Open
Superzite opened this issue Mar 12, 2024 · 22 comments
Open

HA Core Failure after upgrade. #20

Superzite opened this issue Mar 12, 2024 · 22 comments

Comments

@Superzite
Copy link

Hi just a heads up..

I hade a failure after upgrading yesterday so had to manually remove the plugin to get HA Core to work.

See...
home-assistant/core#113127

@nitefly80
Copy link

Hello..
Having the same problem as you Superzite. Not sure what to remove from the core.entity.registry file.
I got results from running: jq -r '.data.entities[] | select(.unique_id | type == "array") | {unique_id, platform}' /config/.storage/core.entity_registry
What did you remove ?
Tnx

@torhaala
Copy link

torhaala commented Mar 13, 2024

Had the same issue here, caused by the unique_id for the sensors being an array instead of a string (ref home-assistant/core#109966 and home-assistant/core#113127).

I manually removed the 3 entries i had from this integration in .storage/core.entity_registry after which everything boots up fine again. Removed the custom component afterwards as it recreates the unique_id arrays.

example part causing the crash:
"unique_id": [
1,
"Restavfall",
"https://komteksky.norkart.no/minrenovasjon.api/Ikoner/restavfall.png",
"2024-03-18T00:00:00",
"2024-04-02T00:00:00"
],

@torhaala
Copy link

Had the same issue here, caused by the unique_id for the sensors being an array instead of a string (ref home-assistant/core#109966 (comment)).

I manually removed the 3 entries i had from this integration in .storage/core.entity_registry after which everything boots up fine again.

example part causing the crash:
"unique_id": [
1,
"Restavfall",
"https://komteksky.norkart.no/minrenovasjon.api/Ikoner/restavfall.png",
"2024-03-18T00:00:00",
"2024-04-02T00:00:00"
],

@remimikalsen
Copy link

Same problem here.

@larsactual
Copy link

Can someone please make a "howto" edit ".storage/core.entity_registry" from CLI to slove this? I have the samme issue.

Tried to remove minrenovasjon from configuration.yaml, but this did not work.

@torhaala
Copy link

torhaala commented Mar 17, 2024

Can someone please make a "howto" edit ".storage/core.entity_registry" from CLI to slove this? I have the samme issue.

Tried to remove minrenovasjon from configuration.yaml, but this did not work.

Not sure how comfortable you are with vim or nano? But basically you need to open that file in your editor of choice and search for (or find manually). Below how I would go about it in vim.

vim .storage/core.entity_registry

Press / and type "unique_id": [ and press Enter to run the search. Pressing n repeats the search for the next entry.

That should find the unique_id entries which uses an array - The whole corresponding entity should then be removed. Most likely you will find all from MinRenovasjon after eachother. Careful that the last entity ends with a ‘}’ and not ‘},’ if yours were at the end of your file.

Note - after this is done you have to ensure the integration is removed, if not it will create the entities again and you’ll have to redo the above.

@larsactual
Copy link

Worked, thanks! Managed to get in to UI and restore a backup. MinRenovasjon integration works with the previous version.

@torhaala
Copy link

Worked, thanks! Managed to get in to UI and restore a backup. MinRenovasjon integration works with the previous version.

Great - i’d still consider removing it though. Reading the various threads it seems like this is a permanent change which means MinRenovasjon won’t work with newer version of HA.

@larsactual
Copy link

Ok. So keeping the old version might still cause trouble? I hoped the developer would fix the issue.

@tortho
Copy link

tortho commented Mar 17, 2024

Ideally stop this update (take it away) before even more people crash their installation!

@torhaala
Copy link

The developer here can fix the addon but can’t do much about the home assistant (ha-core) change causing it.

@larsactual - not until you update home assistant again.

@larsactual
Copy link

Is it the HA Core Update or the MinRenovasjon update to avaoid?

@torhaala
Copy link

Is it the HA Core Update or the MinRenovasjon update to avaoid?

HA Core. They introduced a change that does not accept unique id to be an array anymore. Or alternatively disable MinRenovasjon and then you can update ;)

@kristianwh
Copy link

kristianwh commented Mar 19, 2024

I had to do a full restore from backup a few days ago. Thought it was a combination of upgrade to 2024.3 or HA OS 12.1, so I stayed on 2024.2, but then it crashed again after a reboot. So it's not only 2024.3.

EDIT: The second time around I removed the offending lines in .storage/core.entity_registry, restarted ha successfully and then removed the integration.

@andebor
Copy link

andebor commented Mar 23, 2024

I added #21 yesterday to solve this. @Danielhiversen If you can merge it, we can avoid more broken installations

@kennethnilssen
Copy link

Any command via CLI to boot into safemode? Would be more easy to fix vs CLI/ terminal
Have the same crash and WAF is degraded to ZERO....

@Superzite
Copy link
Author

@kennethnilssen ssh did start up for me, so you can try that. if you have ssh add on installed.

@kennethnilssen
Copy link

@kennethnilssen ssh did start up for me, so you can try that. if you have ssh add-on installed.

I managed to start core_ssh, but it is not configured.

core won't update, nor rebuild. I also removed the config from core.entity_registry on min renovasjon, but can't remove it as it is not found by names as min_renovasjon when I try to uninstall the addon.

running cli command "addons" brings up a list that runs by too fast to read one by one...

Smells like reinstall and import backup.

Scary that one such a small config can crash the hole home assistant.

@torhaala
Copy link

torhaala commented Mar 23, 2024

@kennethnilssen ssh did start up for me, so you can try that. if you have ssh add-on installed.

I managed to start core_ssh, but it is not configured.

core won't update, nor rebuild. I also removed the config from core.entity_registry on min renovasjon, but can't remove it as it is not found by names as min_renovasjon when I try to uninstall the addon.

running cli command "addons" brings up a list that runs by too fast to read one by one...

Smells like reinstall and import backup.

Scary that one such a small config can crash the hole home assistant.

Depending on how you run your HA, you could remove the sd card/hard drive and plug it into your pc, or in the case of docker/vm mount the filesystem, manually removing the integration and entities in the config file causing the crash.

But i agree its a little concerning how a 3rd party integration can crash (and prevent boot up) of the system like this. Though i did see that HA is considering some options to make it "soft" fail instead of crash like this.

Edit: also if you are looking for the offending entries in the core.entity_registry, dont search for their name or the integration, search for "unique_id": [ as that indicates the entry has an array for unique_id (which is the core problem)

@kennethnilssen
Copy link

@kennethnilssen ssh did start up for me, so you can try that. if you have ssh add-on installed.

I managed to start core_ssh, but it is not configured.
core won't update, nor rebuild. I also removed the config from core.entity_registry on min renovasjon, but can't remove it as it is not found by names as min_renovasjon when I try to uninstall the addon.
running cli command "addons" brings up a list that runs by too fast to read one by one...
Smells like reinstall and import backup.
Scary that one such a small config can crash the hole home assistant.

Depending on how you run your HA, you could remove the sd card/hard drive and plug it into your pc, or in the case of docker/vm mount the filesystem, manually removing the integration and entities in the config file causing the crash.

But i agree its a little concerning how a 3rd party integration can crash (and prevent boot up) of the system like this. Though i did see that HA is considering some options to make it "soft" fail instead of crash like this.

Edit: also if you are looking for the offending entries in the core.entity_registry, dont search for their name or the integration, search for "unique_id": [ as that indicates the entry has an array for unique_id (which is the core problem)

Thx, so in the case where i.e. ""unique_id": [" states NULL will also make this issue?

@torhaala
Copy link

Thx, so in the case where i.e. ""unique_id": [" states NULL will also make this issue?

As far as i know HA now only accepts strings as unique_id, i dont think NULL should cause an issue though, unless its some variant of "unique_id": [ NULL ]. Essentially there should be no [ ] as part of the unique_id as that sets it as an array.

@kennethnilssen
Copy link

Thx, so in the case where i.e. ""unique_id": [" states NULL will also make this issue?

As far as i know HA now only accepts strings as unique_id, i dont think NULL should cause an issue though, unless its some variant of "unique_id": [ NULL ]. Essentially there should be no [ ] as part of the unique_id as that sets it as an array.

Thank you @torhaala , I´m back online again thx to your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants