Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-migration to Home Assistant OS, "Unexpected error occured" #301

Open
jeffbeale opened this issue Nov 30, 2024 · 2 comments
Open

Post-migration to Home Assistant OS, "Unexpected error occured" #301

jeffbeale opened this issue Nov 30, 2024 · 2 comments

Comments

@jeffbeale
Copy link

jeffbeale commented Nov 30, 2024

I migrated from TrueNAS scale into Proxmox and had to recreate and restore my Home Assistant setup from a backup. After the restoration, Hubitat completely broke and now I have no doors, buttons, or switches.

A part of this migration was migrating away from the janky setup I had on TrueNAS where I was using the x86 baremetal image as the base for a virtual machine -I am now using the Home Assistant OS as installed from here:
https://community-scripts.github.io/ProxmoxVE/scripts?id=haos-vm

When adding, the error on the integration page reads "Unexpected error occured" and it happens immediately.

To reliably reproduce this in my environment, do the following:

  1. Migrate from a janky half baked TrueNAS VM to a Proxmox VM using the Home Assistant OS image
  2. Restore from backup
  3. Configure network settings so that the new instance matches the same IP that the old instance had
  4. Hubitat breaks
  5. After deleting the app and integration, downloading a fresh install, and attempting to add it back the logs show this error:
    image

Error text:
This error originated from a custom integration.

Logger: custom_components.hubitat.config_flow
Source: custom_components/hubitat/config_flow.py:100
integration: Hubitat (documentation, issues)
First occurred: 6:22:10 AM (1 occurrences)
Last logged: 6:22:10 AM

Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/hubitat/hubitatmaker/hub.py", line 167, in check_config
await self._check_api()
File "/config/custom_components/hubitat/hubitatmaker/hub.py", line 307, in _check_api
await self._api_request("devices")
File "/config/custom_components/hubitat/hubitatmaker/hub.py", line 467, in _api_request
raise e
File "/config/custom_components/hubitat/hubitatmaker/hub.py", line 414, in _api_request
async with aiohttp.request(
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1391, in aenter
self._resp = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 690, in _request
await resp.start(conn)
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1059, in start
message, payload = await protocol.read() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 644, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/hubitat/config_flow.py", line 100, in async_step_user
info = await _validate_input(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hubitat/config_flow.py", line 474, in _validate_input
await hub.check_config()
File "/config/custom_components/hubitat/hubitatmaker/hub.py", line 169, in check_config
raise ConnectionError(str(e))
ConnectionError: Server disconnected

Environment

  • Home Assistant version:
    Core 2024.11.3
    Supervisor 2024.11.4
    Operating System 13.2
    Frontend 20241106.2
  • Integration version: Fresh download of 0.9.38
@jeffbeale
Copy link
Author

Multiple forum posts indicate this is definitely not an integration issue. This is likely an issue with the networking on my local environment, most likely a firewall issue within Proxmox (this is odd as I do not have the firewall enabled at any layer). Once I find the resolution, I will post a detailed writeup here and on the community forums

@jason0x43
Copy link
Owner

The main network considerations are

  • can a process running in the HA container/vm access Hubitat
  • can Hubitat access the event server running in the HA container/vm

HA must be able to send HTTP messages to "Hub address", and Hubitat must be able to send HTTP messages to "Event server URL" (and the event server must be able to receive things sent to the event server URL).

Screenshot 2024-12-01 at 17 44 15

If HA is behind a proxy, the proxy should forward things received at "event server URL" to the event server's port, so "event server port" and the port in "event server URL" could be different. If HA is not behind a proxy, and Hubitat is able to access it directly, then "event server port" and the port in "event server URL" should be the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants