Synology DSM - entities failed to unload "ValueError: Config entry was never loaded!"

I’m facing a new issue since the upgrade to 2021.10

Seems to be related to synology

2021-10-06 21:08:38 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration audiconnect which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-10-06 21:08:38 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration spotcast which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-10-06 21:08:38 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration ble_monitor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-10-06 21:08:38 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-10-06 21:08:38 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hpprinter which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-10-06 21:09:15 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry DiskStation for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 443, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 154, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-10-06 21:09:15 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry DiskStation for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 443, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 368, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-10-06 21:09:15 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry DiskStation for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 443, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 134, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-10-06 21:09:15 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry DiskStation for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 443, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 85, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Any idea how to fix this?

could be in realtion with this?

Surveillance station was the culprit. I had to uninstall it for HA to update the entities correctly.

Update: actually not… I uninstalled Surveillance station and re-installed the DSM integration. I’m still facing the errors…

surveillance station is actually not the culprit… I fully uninstalled Surveillance Station as I don’t need it anymore.
I removed the integration of Synology fully from my HA and added it back again to ensure no entities related to Surveillance Station would pop up.
However, they do… well not in the integration, but the errors I get are related to those sensors

2021-11-04 16:12:08 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry 192.168.x.y for binary_sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 443, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 162, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-11-04 16:12:08 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry 192.168.x.y for camera
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 443, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 368, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-11-04 16:12:08 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry 192.168.x.y for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 443, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 134, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-11-04 16:12:08 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry 192.168.x.y for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 443, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 85, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

I believe it could be an error in the integration itself, where it attempts to parse entities that don’t exist…

How do you load the integration? Via configuration.yaml? Or via the U.I.?
I read somewhere else that loading via configuration.yaml can cause this error when the integration can be loaded via the UI, which is preferred.