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
72.18k stars 30.21k forks source link

32 bit Intel docker image of 2024.4 ("lastest") has a broken python binding #114779

Open catellie opened 6 months ago

catellie commented 6 months ago

The problem

After the automatic upgrade of "latest" today, my docker instance got into a boot loop and checking the logs points to:

...
 from cryptography.hazmat.bindings._rust import (
 ImportError: Error loading shared library /usr/local/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so: Exec format error

Hence I suspect the 32 bit Intel version of this library is broken.

What version of Home Assistant Core has the issue?

core-2024.4.0 (presumably, I can't see it)

What was the last working version of Home Assistant Core?

2024.3.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

32 bit python rust bindings for crypto

Link to integration documentation on our website

No response

Diagnostics information

Not an integration issue

Example YAML snippet

No response

Anything in the logs that might be useful for us?

from cryptography.hazmat.bindings._rust import (
 ImportError: Error loading shared library /usr/local/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so: Exec format error

Additional information

In my mind, the mentioned so file is most likely broken - either in an incorrect format (64 bit?) or even empty? Some googling came up with this link where a similar problem seems to be the issue: https://github.com/pyca/cryptography/issues/9060

sm4rk0 commented 6 months ago

I can confirm the issue. Doing pip install --force-reinstall cryptography unearthed another issue: orjson package was missing. Adding it with pip moved me one step further, but now lru module was missing and it couldn't be installed with pip due to a SyntaxError, so I gave up.

Edit: yes, the mentioned lib is 64-bit.

sm4rk0 commented 6 months ago

32-bit docker "dev" image has the same issue.

iflakin commented 6 months ago

Downgrade to version 2024.03.1 works for me

catellie commented 6 months ago

I backed down to the 2024.3.3 I mention in the report after I gave up on trying to fix it, so technically it's running fine, but it would be really nice to have the 2024.4 features once this is patched up. 🤞

catellie commented 6 months ago

Just to avoid possible confusion, I've clarified that this is the Intel 32 bit image being broken - as I suspect there is an arm 32 bit image kicking around too... (it isn't unlikely that it suffers from the same problem, but I've no information in that)

engineerjoe440 commented 5 months ago

+1 Here, as I just ran into the issue. :frowning:

"whining" aside, THANK YOU, DEVS!!! Home Assistant is AMAZING. If the worst of my trouble is waiting a little while for a fix, well, then I'm doing just fine. Thank you for this tremendous effort!

engineerjoe440 commented 5 months ago

Follow up, seems that I'm continuing to encounter the issue following a simple downgrade to 2024.3.3 and 2024.3.1 There must be something hanging around that's preventing me from getting "back up and running" but I think I'll have to let that sit for a little bit until I can get some time to look more closely. Might have a chance to do that early next week.

ManForSun commented 5 months ago

Follow up, seems that I'm continuing to encounter the issue following a simple downgrade to 2024.3.3 and 2024.3.1 There must be something hanging around that's preventing me from getting "back up and running" but I think I'll have to let that sit for a little bit until I can get some time to look more closely. Might have a chance to do that early next week.

Hi friend. I have a very simple smart home, so I decided to completely reinstall to version 2024.3.3. It works without problems.

initial data:

engineerjoe440 commented 5 months ago

Another update... turns out I was just being dumb with my update script. 2024.3.3 was working fine, the whole time. Hah!

BatonOmsk commented 5 months ago

Good day. I also have this problem on x86. After updating to 2024.4.* I get exactly the same error. 2024.3.3 works correctly.

filippoagresti commented 4 months ago

Hi! I'm also experiencing the same problem on after an upgrade to 2014.5.2 from 2014.3.1. I had to downgrade to continue using HA. My system:

Anyone yet solved this issue? Thanks

rudiservo commented 4 months ago

some issue here 386 build.

filippoagresti commented 4 months ago

Anybody from HA staff can say something about this issue?

catellie commented 4 months ago

I not sure what is the right procedure here, but searching in the change history I found that @bdraco and @frenck mended the 32 bit docker builds not too long ago in this PR: https://github.com/home-assistant/core/pull/107210 Perhaps any of you would know how to get this moving? 🙏

As far as I can tell the 32 bit docker image is still broken since early April due to this. I'm personally preparing to move to the 64 bit image for other reasons (it's long overdue), but perhaps this is not an option for everyone here.

catellie commented 4 months ago

Thanks for the quick action @bdraco! Assuming the above became available in ghcr.io/home-assistant/home-assistant:dev (it seems to have been updated ~12 hours ago), and that I didn't stumble in pulling it, I can say that this appears to have made no real difference. I still get this from the logs:

...
2024-06-06T14:22:59.530051450Z   File "/usr/local/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py", line 11, in <module>
2024-06-06T14:22:59.530100543Z     from cryptography.hazmat._oid import ObjectIdentifier
2024-06-06T14:22:59.530111952Z   File "/usr/local/lib/python3.12/site-packages/cryptography/hazmat/_oid.py", line 7, in <module>
2024-06-06T14:22:59.530180606Z     from cryptography.hazmat.bindings._rust import (
2024-06-06T14:22:59.530188884Z ImportError: Error loading shared library /usr/local/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so: Exec format error
2024-06-06T14:22:59.570781095Z [14:22:59] INFO: Home Assistant Core finish process exit code 1
2024-06-06T14:22:59.571865392Z [14:22:59] INFO: Home Assistant Core service shutdown
...

So I guess we need to wait for rust fixes in a newer alpine?

BatonOmsk commented 2 months ago

Dear friends! So there are no options to resolve the issue?