jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
198 stars 48 forks source link

Integration not loading missing ATTR_ALARM #197

Closed jiveman closed 1 year ago

jiveman commented 1 year ago

Good morning,

Hoping someone can help with an issue that started yesterday. The integration stopped working and started reporting this error in the logs.

cannot import name 'ATTR_ALARM' from 'hubitatmaker.const' (/usr/local/lib/python3.10/site-packages/hubitatmaker/const.py)

I haven't touched my HE setup, and am on the latest HA core. I also updated this integration from 8.5 to 8.6, still no change. I thought to uninstall the integration then reinstall it if something was broken/corrupt but I don't seem to be able to remove it either. I did try to "redownload" it from the HACS integration point. Any assistance would be greatly appreciated as this integration is the main reason I even have HA. Thanks for the awesome integration!!

Log Details (ERROR)

This error originated from a custom integration. Logger: aiohttp.server Source: custom_components/hubitat/alarm_control_panel.py:3 Integration: Hubitat (documentation, issues) First occurred: 11:39:11 AM (3 occurrences) Last logged: 11:41:31 AM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 145, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 86, in delete result = await hass.config_entries.async_remove(entry_id) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1043, in async_remove await entry.async_remove(self.hass) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 569, in async_remove component = integration.get_component() File "/usr/src/homeassistant/homeassistant/loader.py", line 730, in get_component cache[self.domain] = importlib.import_module(self.pkg_path) File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/config/custom_components/hubitat/init.py", line 8, in from custom_components.hubitat.services import ( File "/config/custom_components/hubitat/services.py", line 11, in from .alarm_control_panel import HubitatSecurityKeypad File "/config/custom_components/hubitat/alarm_control_panel.py", line 3, in from hubitatmaker.const import ( ImportError: cannot import name 'ATTR_ALARM' from 'hubitatmaker.const' (/usr/local/lib/python3.10/site-packages/hubitatmaker/const.py)

jiveman commented 1 year ago

I ended up getting a working system again by backing up my HA setup, downloading it, then rolling back a proxmox snapshot I had created and then restoring that backup.

jason0x43 commented 1 year ago

I’ve heard of that happening one other time, but I’ve never been able to reproduce it. The fact that the issue occurs rarely and seems to self-resolve makes it tricky to nail down.

jiveman commented 1 year ago

Another contributing factor may have been that while experimenting with "motioneye" NVR add-on, I accidently let my HAOS disk fill up. Kinda seems like that put it in some sort of broken state. Wondering if some values weren't able to be written to the db or something to cause that. After uninstalling the HACS integration and reinstalling didn't fix it so there must be some state left behind (files or db maybe)? Well, glad I had a snapshot and didn't loose much because of backups. Thanks for the reply and again thanks for your awesome integration!

jason0x43 commented 1 year ago

I'm closing this since the issue seems to be a fluke. The next update won't use any external modules, so this (the root issue of not being able to find an import) hopefully shouldn't come up again.