home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.83k stars 30.91k forks source link

HomeKit Device failed setup (Error while connecting to device Data too long.) on 32-bit systems running 2023.10.4 #102474

Closed triglav-modular closed 1 year ago

triglav-modular commented 1 year ago

The problem

I've been using the Dirigera Hub with the Homekit Device integration for many months without issues but after updating HomeAssistant Core to 2023.10.4 it's completely broken. It displays an error message saying:

Failed setup, will retry Error while connecting to device Data too long. Max 2**32 bytes (OverflowError)

What version of Home Assistant Core has the issue?

core-2023.10.4

What was the last working version of Home Assistant Core?

core-2023.10.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

HomeKit Device

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homekit_controller/

Diagnostics information

homekit_controller_log.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @jc2k, @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit_controller) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `homekit_controller` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign homekit_controller` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


homekit_controller documentation homekit_controller source (message by IssueLinks)

bdraco commented 1 year ago

Looks similar to https://github.com/home-assistant/core/issues/102473

Which architecture/hardware are you using?

triglav-modular commented 1 year ago

I'm running it on a Raspberry Pi 4.

bdraco commented 1 year ago

Is its 64bit or 32bit ?

bdraco commented 1 year ago

https://github.com/bdraco/chacha20poly1305-reuseable/actions/runs/6598620732/job/17926787396 is building with a prospective fix.
I'll get some wheels up for HA shortly so you can try installing them in your container

bdraco commented 1 year ago

HA wheels are building here https://github.com/home-assistant/core/actions/runs/6598661986

I'll give you a command to update once its done.

In the mean time, please install the community ssh addon, as you'll need to be able to access the container without protection mode turned on to update the library

bdraco commented 1 year ago

https://community.home-assistant.io/t/home-assistant-community-add-on-ssh-web-terminal/33820

triglav-modular commented 1 year ago

Thanks, much appreciated!

bdraco commented 1 year ago

New build to follow since the first once got canceled https://github.com/home-assistant/core/actions/runs/6598698115

bdraco commented 1 year ago

The wheels are up and can be installed using the community ssh addon with protected mode disable by running:

docker exec -it homeassistant /bin/bash
pip3 install --upgrade chacha20poly1305-reuseable==0.10.2 --find-links=https://wheels.home-assistant.io/musllinux/

Than restart

bdraco commented 1 year ago

I just finished building a 32bit RPi, I confirmed the issue and the fix

triglav-modular commented 1 year ago

Also working here, thanks very much for the super quick fix!

MattWestb commented 1 year ago

Dirigra and also all Thread device that is Home kit is broken (EVE Energ and Nanolieaf lights) but the thread network is working OK. Was upgrading 2 test network with RCP (32 bits) and all with homekit i have rolling back and the Armbian 64 with matterserver is not then its looks working OK but its have not Homekit devices installed on it

PS: ESPHome BTProxy is also having the same problems as in the liked issue.

bdraco commented 1 year ago

@MattWestb Can you try the steps above?

https://github.com/home-assistant/core/issues/102474#issuecomment-1773876816

MattWestb commented 1 year ago

I starting updating the 32bits RCP with OTBR and trying patching it as you have written. Can i running the bash command in the HA containers CLI from prtainer ?

Edit: The system dont like installing the latest update only 2023.10.3 so looks not working.

root@RK322X-Box:~# ha refresh-updates
Command completed successfully.
root@RK322X-Box:~# ha  available-updates
available_updates:
- panel_path: /update-available/core
  update_type: core
  version_latest: 2023.10.3
root@RK322X-Box:~#
bdraco commented 1 year ago

Can i running the bash command in the HA containers CLI from prtainer ? If you are already in the container

pip3 install --upgrade chacha20poly1305-reuseable==0.10.2 --find-links=https://wheels.home-assistant.io/musllinux/

Edit: The system dont like installing the latest update only 2023.10.3 so looks not working.

ha core update --version 2023.10.3 will downgrade to 2023.10.3

MattWestb commented 1 year ago

Was pulling the HA 2023.10.4 docker image by CLI and then using ha core update --version 2023.10.4 and it was installing it OK and then patching and restarting from portainer and BT Proxy and the thread homekit device is now online as normal. Have starting doing the same with the other RCP 23 bit system that have the Dirigera and see if its working OK but i think it shall being OK.

Edit; Armbian Ubuntu 32 bits with Dirigera is also working OK.

I waiting updating my production system (R PI3B+ 64 bits) then our Puddly have merger some new fixes that i need for ZHA that is coming in next patch release.

Great work done !!!

chrislader commented 1 year ago

Got the same issue on all my (3) homekit devices. Also rpi4, 32bit, updating to 23.10.4

Looking through this thread it seems fixed. But unclear to me wheter I could wait untill 2023.10.5 for the fix to be included or need to ssh the manual fix?

MattWestb commented 1 year ago

@chrislader Rolling back the last backup (i was doing 2 systems) and install next patch release then its online or patching the HA container by instruction.

bdraco commented 1 year ago

Got the same issue on all my (3) homekit devices. Also rpi4, 32bit, updating to 23.10.4

Looking through this thread it seems fixed. But unclear to me wheter I could wait untill 2023.10.5 for the fix to be included or need to ssh the manual fix?

You have a few options:

  1. Install the fix in https://github.com/home-assistant/core/issues/102474#issuecomment-1773876816
  2. Restore from last backup
  3. Downgrade to 2023.10.3 with ha core update --version 2023.10.3
  4. Wait for 2023.10.5
chrislader commented 1 year ago

Got the same issue on all my (3) homekit devices. Also rpi4, 32bit, updating to 23.10.4 Looking through this thread it seems fixed. But unclear to me wheter I could wait untill 2023.10.5 for the fix to be included or need to ssh the manual fix?

You have a few options:

  1. Install the fix in HomeKit Device failed setup (Error while connecting to device Data too long.) on 32-bit systems running 2023.10.4 #102474 (comment)
  2. Restore from last backup
  3. Downgrade to 2023.10.3 with ha core update --version 2023.10.3
  4. Wait for 2023.10.5

Thx @bdraco, for all your hard work in this. I ll wait since the devices can still be accessed using their own apps/platforms.

bdraco commented 1 year ago

Might actually be a bug in cython on 32bit https://github.com/cython/cython/issues/5768

MattWestb commented 1 year ago

@bdraco Still one other strange things with the update. My production system (64 bit) like update to HA 2023.10.3 (from 2023.10.1) and not to the latest version and the 2 32 bits systems (fixed yesterday evening) is liking downgrading to the same version.

Home Assistant Core Update
12 hours ago
2023.10.3
Home Assistant Core
Installed version
2023.10.4
Latest version
2023.10.3

Edit: Production from CLI:

pi@RPi3Bp:~ $ sudo ha refresh-updates
Command completed successfully.
pi@RPi3Bp:~ $ sudo ha  available-updates
available_updates:
- panel_path: /update-available/core
  update_type: core
  version_latest: 2023.10.3
pi@RPi3Bp:~ $
bdraco commented 1 year ago

confirmed fixed on 2023.10.5