tomaae / homeassistant-openmediavault

OpenMediaVault integration for Home Assistant
Apache License 2.0
111 stars 16 forks source link

[Bug] Cannot add OMV integration. Error! #144

Closed lancercncs1 closed 11 months ago

lancercncs1 commented 11 months ago

Describe the issue

The OMV integration had worked well for a couple of months until one day my entities stopped working. When I removed the integration and tried to re-install it, I cannot. I get a non-descriptive error "Unknown error occurred." See screenshot below.

How to reproduce the issue

  1. Go to Settings ---> Integrations --.> Add Integration
  2. Try installing OMV

Expected behavior

The integration should install, as it has before.

Screenshots

image

Software versions

I am on HA 2023 12.3 and using the most recent OMV 6.9.10

Diagnostics data

I cannot even get the integration to install

Traceback/Error logs

Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421 First occurred: December 16, 2023 at 9:54:06 PM (10 occurrences) Last logged: 8:08:50 AM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, 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 233, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/openmediavault/config_flow.py", line 89, in async_step_user if not await self.hass.async_add_executor_job(api.connect): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/openmediavault/omv_api.py", line 130, in connect if cookies := load_cookies(self._cookie_jar_file): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/openmediavault/omv_api.py", line 25, in load_cookies return pickle_load(f)

Additional context

I am very confused by this because this started happening out of the blue one day. Does anybody know what the issue may be? I appreciate any help I can get on this matter. Thank you!

tomaae commented 11 months ago

look into HA log, there should be an error

lancercncs1 commented 11 months ago

Oh! There ARE logs. Thanks tomaae! I just updated my original post above with them... I cannot tell what the issue is.

tomaae commented 11 months ago

yea, thats cookie of death. related to OMV API design choices. delete file .omv_cookies.json in /config and readd your NAS to HA

lancercncs1 commented 11 months ago

Thanks Tomaae! I deleted the .omv_cookies.json in /config and was able to install the integration.. Unfortunately, the integration is not completely working yet. It is unable to fetch the entity data and my entities are now "unavailable." Any idea of what may be causing this?

Logger: custom_components.openmediavault.omv_api Source: custom_components/openmediavault/omv_api.py:302 Integration: OpenMediaVault (documentation, issues) First occurred: 12:45:31 PM (28 occurrences) Last logged: 12:58:02 PM

OpenMediaVault 192.168.1.70 unable to fetch data (500)

image

**EDIT: I disabled S.M.A.R.T. in the OMV configuration window. That seemed to fetch the entities (yeah!). However, what exactly is S.M.A.R.T. and why did it prevent my entities from getting fetched?**

tomaae commented 11 months ago

thats because OMV keeps changing API all the time. try installing master version using HACS. it will most likely get fixed.