New integrations don't survive a restart

Something rather baffling has started to happen. Not sure when it started, but the first time I noticed something was wrong is an odd 4 weeks ago when I added the Somfy integration.
After adding it and configuring it, I saw this intergration could not find any devices. Well, then perhaps it requires a restart, right? Well, after the restart, the whole integration was gone. Just, poof!
I tried three more times (yes, I’m stubborn) and every time this was the case. Well, seeing the amount of issues with Somfy cloud I reckoned this was entirely on the side of the integration itself.

However, today I find out something more is wrong, as this same issue occurs when I add any other integration. None of them stick and their entities, devices etc are gone after a reboot.
Also, removing an integration is also not possible…after a restart they’re back.

I have the feeling that this may be caused by some permission issue…but I don’t know why and how.

My question is now:
A ) Can this be solved/troubleshooted?
B ) Can I get a away with just backing up the current config, and restoring that on a fresh install ?

BTW, running the latest version.
core-2021.7.3
supervisor-2021.06.8
Home Assistant OS 6.1

1 Like

Running on a Pi with SD-card ?

No, Hyper-V VM, as per the provided OVA (a while ago already, I think last year)
BTW, the rest does stick; database changes, automation changes etc. So it’s not a simple read-only disk issue. It seems some files are read only.

Hows your disk space?

Disk space is plenty, only 40,1% in use.

Where are you seeing this hyperv or from within haos?

One other thing comes in mind, little far fetched but had similar issues in past, the cache of the browser…

In HASS itself; Supervisor - System - Host - Used space : 40.9%
Also from within SSH; see screenshot

The file core.config_entries seems to be locked or something. Not changed in months.

Something that I noticed today:

2021-07-23 11:30:52 ERROR (SyncWorker_1) [homeassistant.util.json] Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[23].data.scan_interval=0:10:01(<class 'datetime.timedelta'>

This last part seems to pinpoint at least the cause of the observed behaviour; changes to integrations and addition or removal of any is done by writing them to core.config_entries, but that is impossible because of some sort of an error somewhere in there. For the love of God, I cannot find out what’s wrong there.

Was this resolved. I have the issue

I have this same issue :frowning:
Raspberry Pi 4 8GB, HAOS, SSD with 445GB available.

Added DSMR and SMA integrations, and each time I need to restart HA they are gone :cry:

I have also the same problem… :frowning_face:

Raspberry Pi 4 - 8GB with 64GB SD-card.
I have tried to reinstall 3 times from the raspberry pi imager software, but every time I get this errors after an hour or two…

Logger: homeassistant.helpers.storage
Source: helpers/storage.py:280
First occurred: 12:04:01 AM (1 occurrences)
Last logged: 12:04:01 AM

Error writing config for core.config_entries: Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[7].data.devices.0b11000101fbf65a0a000070.device_id=DeviceTuple(packettype='11', subtype='0', id_string='1fbf65a:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>
1 Like

I am also facing the same problems using HA on a Raspberry Pi 3B. Getting the same error codes in the log.
I tried to check if this also happens on a virtual machine. So I installed HA running on a Virtualbox VM and I get the exact same result. Exactly the same error codes:

Logger: homeassistant.util.json
Source: util/json.py:76
First occurred: 9:21:06 PM (3 occurrences)
Last logged: 9:21:34 PM

Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[6].data.devices.0b11000001b0d2fa03000070.device_id=DeviceTuple(packettype='11', subtype='0', id_string='1b0d2fa:3')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[6].data.devices.0b11000101b0d2fa04000070.device_id=DeviceTuple(packettype='11', subtype='0', id_string='1b0d2fa:4')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>
Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[6].data.devices.0b11000001b0d2fa03000070.device_id=DeviceTuple(packettype='11', subtype='0', id_string='1b0d2fa:3')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[6].data.devices.0b11000101b0d2fa04000070.device_id=DeviceTuple(packettype='11', subtype='0', id_string='1b0d2fa:4')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[6].data.devices.0a520d02c80200d12e0179.device_id=DeviceTuple(packettype='52', subtype='d', id_string='c8:02')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>
Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[6].data.devices.0b11000001b0d2fa03000070.device_id=DeviceTuple(packettype='11', subtype='0', id_string='1b0d2fa:3')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[6].data.devices.0b11000101b0d2fa04000070.device_id=DeviceTuple(packettype='11', subtype='0', id_string='1b0d2fa:4')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[6].data.devices.0a520d02c80200d12e0179.device_id=DeviceTuple(packettype='52', subtype='d', id_string='c8:02')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[6].data.devices.0a520d03360200e9280179.device_id=DeviceTuple(packettype='52', subtype='d', id_string='36:02')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[6].data.devices.0a520d04fb0100e92a0179.device_id=DeviceTuple(packettype='52', subtype='d', id_string='fb:01')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>

I guess it has something to do with the RFXCOM Rfxtrx device. Since mine is from 2015-2016. Maybe a firmware update of the rfxtrx does the trick.

Yet another reinstallation of HA, and the error messages appear as soon as I add devices connected to RFXTRX.

Logger: homeassistant.helpers.storage
Source: helpers/storage.py:280
First occurred: 2:14:46 AM (4 occurrences)
Last logged: 2:18:28 AM

Error writing config for core.config_entries: Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[7].data.devices.0b110000014f4b660a010f50.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f4b66:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>
Error writing config for core.config_entries: Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[7].data.devices.0b110000014f4b660a010f50.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f4b66:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[7].data.devices.0b110004014f26060a010f60.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f2606:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>
Error writing config for core.config_entries: Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[7].data.devices.0b110000014f4b660a010f50.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f4b66:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[7].data.devices.0b110004014f26060a010f60.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f2606:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[7].data.devices.0b11000c015d72d20a010f50.device_id=DeviceTuple(packettype='11', subtype='0', id_string='15d72d2:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>
Logger: homeassistant.util.json
Source: util/json.py:76
First occurred: 2:14:46 AM (4 occurrences)
Last logged: 2:18:28 AM

Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[7].data.devices.0b110000014f4b660a010f50.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f4b66:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>
Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[7].data.devices.0b110000014f4b660a010f50.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f4b66:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[7].data.devices.0b110004014f26060a010f60.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f2606:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>
Failed to serialize to JSON: /config/.storage/core.config_entries. Bad data at $.data.entries[7].data.devices.0b110000014f4b660a010f50.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f4b66:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[7].data.devices.0b110004014f26060a010f60.device_id=DeviceTuple(packettype='11', subtype='0', id_string='14f2606:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>, $.data.entries[7].data.devices.0b11000c015d72d20a010f50.device_id=DeviceTuple(packettype='11', subtype='0', id_string='15d72d2:10')(<class 'homeassistant.components.rfxtrx.DeviceTuple'>

@bengt seems that we are facing the same problem here.
I did not update the firmware of the transceiver yet. I believe I am running version 1006. What is your version?
It could also be dependant on the type of devices added. I mainly use kaku stuff and a bunch of alecto temperature sensors.

same as me , what to do ?