tomaae/homeassistant-openmediavault

[Bug] OMV Integration gives "Unknown error occurred" when trying to add the integration after instalation. HA 23.11 + OMV6

greggo74 opened this issue · 3 comments

Describe the issue

"Unknown error occurred" when trying to add the OMV integration to my HA install, and failure to add the integration configuration.
I know this has been raised before but other earlier occurrences seem to have been resolved. I've tried periodically for months with no longer, after each HA and OMV upgrade. No luck.
No SSL involved.

How to reproduce the issue

Install the OMV integration via HACS.
Add the integration via Settings/Integrations.
Enter my data.

Expected behavior

Creation of the OMV integration and devices.

Screenshots

image

Software versions

  • Home Assistant version: HA Core 2023.11.0 HA Frontend 20231030.1
  • openmediavault integration version: 1.4.2
  • openmediavault software version: 6.9.6-2 (Shaitan) (Kernel Linux 5.19.17-2-pve)

But it's not worked for many months, even before I upgraded to OMV6. It worked fine previously, with HA always in a docker in the OMV machine.

Diagnostics data

N/A

Traceback/Error logs

HA logs from pressing Submit.

2023-11-03 10:32:13.336 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/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 85, 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/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, 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)
^^^^^^^^^^^^^^
EOFError: Ran out of input

Additional context

looks like a cookie of death.
try deleting file ".omv_cookies.json" in HA config directory

So simple!! :( Wish that was somewhere obvious in the helps or something so I didn't have to raise a bug. Maybe I missed it. I even saw someone's comment about the cookies file but didn't think it had any further extension so didn't find it. Stupid of me!
Thanks and solved.

dont worry about it. its just unfortunate that omv api works in this nonstandard way,