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

Error during setup of component stream because av fails to load on armv7l #131853

Closed
dynasticorpheus opened this issue Nov 28, 2024 · 48 comments
Closed

Comments

@dynasticorpheus
Copy link
Contributor

dynasticorpheus commented Nov 28, 2024

The problem

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/stream/__init__.py", line 226, in async_setup
    await hass.async_add_executor_job(set_pyav_logging, debug_enabled)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/stream/__init__.py", line 196, in set_pyav_logging
    import av  # pylint: disable=import-outside-toplevel
    ^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/av/__init__.py", line 3, in <module>
    from av._core import time_base, library_versions, ffmpeg_version_info
ImportError: Error loading shared library �: No such file or directory (needed by /usr/local/lib/python3.13/site-packages/av/../av.libs/libjxl-2cfeb5f2.so.0.10.2)

What version of Home Assistant Core has the issue?

core-2024.12.0b2

What was the last working version of Home Assistant Core?

core-2024.11.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

stream

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

armv7l / container

Additional information

Python version	3.13.0
Operating system family	Linux
Operating system version	6.6.63
CPU architecture	armv7l
Timezone	Europe/Amsterdam
Configuration directory	/config
@home-assistant
Copy link

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

Code owner commands

Code owners of stream 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 stream Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


stream documentation
stream source
(message by IssueLinks)

@dynasticorpheus
Copy link
Contributor Author

@bdraco As suggested on discord.

@allenporter
Copy link
Contributor

This release contains an updated version of av from #129699

armv7l likely notable here...

@allenporter
Copy link
Contributor

Since you're using home assistant container: Which exact container image? I'm assuming its an official one so making sure

@bdraco bdraco added this to the 2024.12.0 milestone Nov 28, 2024
@dynasticorpheus
Copy link
Contributor Author

Using the official one pulled using ghcr.io/home-assistant/home-assistant:beta

@bdraco
Copy link
Member

bdraco commented Nov 28, 2024

-2cfeb5f2

It looks like its adding some type of hash to the end

@dynasticorpheus
Copy link
Contributor Author

dynasticorpheus commented Nov 28, 2024

FYI that is the case for all libs in /usr/local/lib/python3.13/site-packages/av.libs

edit: actually I see this hash added in all packages who have a .libs directory so I guess if this would be the culprit nothing would work?

@bdraco bdraco changed the title Error during setup of component stream Error during setup of component stream because av fails to load on armv7l Nov 28, 2024
@VDRainer

This comment was marked as off-topic.

@bdraco
Copy link
Member

bdraco commented Nov 28, 2024

Thats a different issue

@cdce8p
Copy link
Member

cdce8p commented Nov 29, 2024

I'm able to reproduce the issue with both armv7 (and armhf ?) docker images. Interestingly, building the wheels from source works fine. Not sure what's going on there, will have to investigate it further.

If we haven't figured out the root cause next week, I guess a work around would be to remove the wheels from the index and exclude av from the wheel builder. Also of course my preference would be to have working wheels in place.

@dynasticorpheus

This comment was marked as outdated.

@MattWestb

This comment was marked as off-topic.

@f45tb00t
Copy link

f45tb00t commented Dec 5, 2024

The bug is shipped in HA 2024.12 !!! Its braking Default config so not very nice.

No idea whats wrong. this is not the first thing which has been reported prior release. In the last monthes its getting worse :(
Even the uv issue is not fully explained why and how...

I have a Core installation.

Can we please fix this asap? If we can support you with logs or what ever, let us know. Thanks!

@funbirdcas

This comment was marked as duplicate.

@ntercantrist
Copy link

The same issue is on Home Assistant OS, see #132363

@rdenis1

This comment was marked as duplicate.

@TilmannBach

This comment was marked as duplicate.

@lweberru

This comment was marked as duplicate.

@AlexxIT
Copy link

AlexxIT commented Dec 6, 2024

Encountered this on my test raspberry. HAOS is installed on it. The good thing is that the cameras continued to work via WebRTC, even after the stream component failed.

@brenard

This comment was marked as duplicate.

@ruttromp

This comment was marked as duplicate.

@rseffner

This comment was marked as off-topic.

@s-chivikov

This comment was marked as duplicate.

@brenard

This comment was marked as off-topic.

@brenard
Copy link

brenard commented Dec 8, 2024

I just made the connection, but on another instance of HA running on an old i686 machine (Debian 12 + Docker), I have another error with an incompatible Python 13 library:

ImportError: Erro
r loading shared library /usr/local/lib/python3.13/site-packages/cr
yptography/hazmat/bindings/_rust.abi3.so: Exec format error

It's possible that the issue with installing Python libraries depending on the host architecture is not limited to the av library after all.

@cdce8p
Copy link
Member

cdce8p commented Dec 8, 2024

I might have identified the issue. The wheel below should be fixed.
https://github.com/cdce8p/ha-core/releases/download/2020.12.1/av-13.1.0-cp313-cp313-musllinux_1_2_armv7l.whl

Update:
https://wheels.home-assistant.io/musllinux/av-13.1.0-cp313-cp313-musllinux_1_2_armv7l.whl

@brenard

This comment was marked as off-topic.

@cdce8p

This comment was marked as off-topic.

@NateRobinsonS

This comment was marked as off-topic.

@cdce8p
Copy link
Member

cdce8p commented Dec 8, 2024

The fixed armv7 wheels are now available from https://wheels.home-assistant.io/musllinux/.
Will be included in the next dev release as well as 2024.12.2.

https://wheels.home-assistant.io/musllinux/av-13.1.0-cp312-cp312-musllinux_1_2_armv7l.whl
https://wheels.home-assistant.io/musllinux/av-13.1.0-cp313-cp313-musllinux_1_2_armv7l.whl

@f45tb00t

This comment was marked as off-topic.

@cdce8p cdce8p modified the milestones: 2024.12.0, 2024.12.2 Dec 8, 2024
@ccMatrix

This comment was marked as off-topic.

@cdce8p

This comment was marked as off-topic.

@R-ens

This comment was marked as off-topic.

@tweas
Copy link

tweas commented Dec 8, 2024

You could try rolling back to the last known working version:
2024.11.3

That is what I did.

@frenck
Copy link
Member

frenck commented Dec 8, 2024

Will this fix auto apply to: ghcr.io/home-assistant/raspberrypi4-homeassistant as well?

You shouldn't be using that image in the first place (as it is not meant for Docker consumption, it is an intermediate image). Check out the documentation on which image to use.

@frenck frenck removed this from the 2024.12.2 milestone Dec 8, 2024
@brenard
Copy link

brenard commented Dec 8, 2024

PS : do you known if my other problem with _rust.abi3.so on i686 host is related or if I need to create another issue?

Probably not. I'd suggest to open a separate issue for that.

An issue already exists for this problem (#114779) and it seem quite similar to this one: I identified 72 python packages containing x64 binary libs in the x86 docker image. I will put a comment in this issue. @cdce8p, could you take a look?

@NateRobinsonS
Copy link

Is there a quick fix which I can apply in my running container. My security system is not working now.

See my comment above.

@cdce8p
Copy link
Member

cdce8p commented Dec 10, 2024

2024.12.2 was just released which includes the fixed wheel.

@cdce8p cdce8p closed this as completed Dec 10, 2024
@pascallj
Copy link
Contributor

@cdce8p I couldn't really backtrack what you did to fix this issue for armv7, but could it be that the same problem exists for armv6 (see #132303)? According to the timestamps, these wheels were not rebuilt.

@cdce8p
Copy link
Member

cdce8p commented Dec 13, 2024

@cdce8p I couldn't really backtrack what you did to fix this issue for armv7, but could it be that the same problem exists for armv6 (see #132303)? According to the timestamps, these wheels were not rebuilt.

Correct, I wasn't able to test armhf / armv6 and haven't seen / wasn't linked in any reports at the time, so I only rebuild armv7. I could probably use the same setup for armv6. Would you be able to verify if the wheels work once I rebuild it @pascallj?

@pascallj
Copy link
Contributor

Tomorrow I will give a shot if I can replicate the issue with QEMU. I'll let you know.

@sholl
Copy link

sholl commented Dec 14, 2024

I could give you feedback for arm6 too, since I am running into this issue with 2024.12.2 as well.
If you provide steps how to test properly on arm6 I would be happy to assist. (my HA-installation is on docker running on arm6)

@cdce8p
Copy link
Member

cdce8p commented Dec 14, 2024

I could give you feedback for arm6 too, since I am running into this issue with 2024.12.2 as well. If you provide steps how to test properly on arm6 I would be happy to assist. (my HA-installation is on docker running on arm6)

It should be fixed in the latest dev / nightly images published last night. Alternatively with the next patch or beta release. Didn't make 2024.12.3 though unfortunately.

https://www.home-assistant.io/common-tasks/container/#running-a-development-version

@pascallj
Copy link
Contributor

Posting it in this issue too for reference:

I have replicated the issue with the armv6 Docker images and with the new armv6 wheels the issue is indeed solved. So this should at least fix the issue for everyone who specifically has the "No such file or directory [...] libjxl [...]" error.

For people who don't want to wait for the new patch version, you can reinstall av inside your existing Docker container. If your container is named homeassistant:

  1. Start the container until the error message occurs and leave it running
  2. Execute this command: docker exec homeassistant pip install --force-reinstall av
  3. After the command has finished, restart your Home Assistant container and the issue should be fixed in this container.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests