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
71.59k stars 29.91k forks source link

armv7 QNAP Docker: Restarting loop - Core finish process exit code 256 - Core finish process received signal 11 (exit code 139 and exit code 135) #86589

Closed magicse closed 1 month ago

magicse commented 1 year ago

Version 2022.7+ currently boot loop on QNAP NAS ts-231p

INFO: Home Assistant Core finish process exit code 256
INFO: Home Assistant Core finish process received signal 11
…

What version of Home Assistant Core has the issue? 2022.7+

What was the last working version of Home Assistant Core? 2022.6.7

What type of installation are you running? Home Assistant Container

Additional information Running on QNAP NAS (TS-231P).

Processor: Annapurna Labs Alpine AL314 Quad-core ARM Cortex-A15 CPU @ 1.70GH

magicse commented 1 year ago

https://github.com/home-assistant/core/issues/74707#issuecomment-1241101866

magicse commented 1 year ago

Every version from 2022.7+ is failed to start on Docker (QNAP).

The same error message is occurred.

[14:44:09] INFO: Home Assistant Core finish process exit code 256 [14:44:09] INFO: Home Assistant Core finish process received signal 11 [14:44:10] INFO: Home Assistant Core finish process exit code 256 [14:44:10] INFO: Home Assistant Core finish process received signal 11 [14:44:11] INFO: Home Assistant Core finish process exit code 256 [14:44:11] INFO: Home Assistant Core finish process received signal 11

It is looping infinitely.

There is no resolution in any discussion only reverting to a lower version 2022.6.

Wetzel402 commented 1 year ago

75142

Wetzel402 commented 1 year ago

This issue might be resolved finally. If the latest official container still isn't working you can try linuxserver.io's container.

Gerigot commented 1 year ago

@magicse can you try with a pre-release version? like the new one from today 2023.2.0b9

So that we can ensure that it's related with the problem #75142.

Because the fix was for armv6 and I'm not sure the problem with your device is the same, although it seems similar.

magicse commented 1 year ago

@Gerigot Due to the constant power outage, it's a little difficult for me to do this, but I'll try.

boyarale commented 1 year ago

I have the same problem with Qnap TS-431X. Tested versions 2023.3.0.dev20230202, 2023.2.0.dev20230120, 2023.2.0b9 and current "stable".

2022.6.7 works well.

Wetzel402 commented 1 year ago

@boyarale, have you tried linuxserver.io's image? Please test and report back.

magicse commented 1 year ago

Because the fix was for armv6 and I'm not sure the problem with your device is the same, although it seems similar.

QNAP TS-231p3 is arm32v7

Gerigot commented 1 year ago

I've seen other talking about that problem with QNAP and they solved it using the Linuxserver.io image, unfortunately I don't have a QNAP so I can't investing the problem

magicse commented 1 year ago

It may be possible to somehow analyze what has changed during the transition from version 2022.6.7. There should be some explanation for this phenomenon.

Gerigot commented 1 year ago

I think the problem relays on some libraries that HA uses not on the core itself so it's very difficult investigate without a device. I fixed the problem for "pi zero" because I'm using it on that so I could test if the solution was good.

magicse commented 1 year ago

like the new one from today 2023.2.0b9 My test config

version: '3.8'
services:
homeassistant:
restart: always
image: homeassistant/home-assistant:2023.2.0b9
network_mode: host
privileged: true
environment:
- DISABLE_JEMALLOC=true
- TZ=Europe/Berlin
volumes:
- /share/Container/hass-config:/config

Error log

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
[17:41:21] INFO: Home Assistant Core finish process exit code 256
[17:41:21] INFO: Home Assistant Core finish process received signal 11
[17:41:22] INFO: Home Assistant Core finish process exit code 256
[17:41:22] INFO: Home Assistant Core finish process received signal 11
[17:41:23] INFO: Home Assistant Core finish process exit code 256
magicse commented 1 year ago
bash-5.1# python3 
Python 3.10.7 (main, Nov 24 2022, 13:02:43) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jwt
Segmentation fault
bash-5.1# 
bash-5.1# python3 
Python 3.10.7 (main, Nov 24 2022, 13:02:43) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cryptography.hazmat.primitives.asymmetric import ec, padding
Segmentation fault
bash-5.1# 
bash-5.1# gdb --args python -c "import sys, numpy; print(numpy.__version__, sys.version)"
GNU gdb (GDB) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "armv7-alpine-linux-musleabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...
(No debugging symbols found in python)
(gdb) r
Starting program: /usr/local/bin/python -c import\ sys,\ numpy\;\ print\(numpy.__version__,\ sys.version\)

Program received signal SIGSEGV, Segmentation fault.
0x75fb792c in ?? () from /lib/ld-musl-armhf.so.1

apk --print-arch' gives armv7, but /lib/libc.musl-armv7.so.1 is link to /lib/ld-musl-armhf.so.1 it is somewhat strange

magicse commented 1 year ago

https://github.com/home-assistant/core/issues/75142#issuecomment-1200269467 Just for completeness, on 2022.6.7 both imports, numpy and jwt, work without issues:

magicse commented 1 year ago

https://github.com/home-assistant/core/issues/75142#issuecomment-1287606304

magicse commented 1 year ago

@Wetzel402

This issue might be resolved finally. If the latest official container still isn't working you can try linuxserver.io's container.

linuxserver.io's container Home Assistant 2023.2.1 work well.

Wetzel402 commented 1 year ago

I was hoping that @Gerigot's fix would also correct the issue with QNAP but it appears that isn't the case. More investigation and research is needed...

magicse commented 1 year ago

@Wetzel402 No problem any needed logs and tests for analytics we could make.

Wetzel402 commented 1 year ago

@magicse, right now I think comparing the repositories to find differences would be a good start. Why does linuxserver.io's image run when the official does not?

Wetzel402 commented 1 year ago

I'm already noticing that linuxserver.io has a dedicated dockerfile for armhf.

Edit: They also use their own wheels. This makes me suspect it is a wheels issue as some have previously suspected...

One more edit... Linuxserver is using their own Alpine 3.16 base image.

Wetzel402 commented 1 year ago

It could be worth trying to build the docker image using the Linuxserver base image with offical HA wheels as well as vice versa.

Gerigot commented 1 year ago

It is really a strange behavior and unfortunately I don't have an ARMv7 to make some test myself it will be really difficult to find out what's going on

magicse commented 1 year ago

@Wetzel402

Edit: They also use their own wheels. This makes me suspect it is a wheels issue as some have previously suspected...

May be you are right and they use different wheels for example for cryptography. I see by names that they didn't use musllinux for arch armv7l . musllinux used for aarch64 and x86_64 arch. Also aarch64 and x86_64 arch builded for Python 3.6, and armv7l armv8l builded for Python 3.10

[cryptography-39.0.0-cp310-cp310-linux_armv7l.whl](https://wheels.linuxserver.io/alpine-3.16/cryptography-39.0.0-cp310-cp310-linux_armv7l.whl)
[cryptography-39.0.0-cp310-cp310-linux_armv8l.whl](https://wheels.linuxserver.io/alpine-3.16/cryptography-39.0.0-cp310-cp310-linux_armv8l.whl)
[cryptography-39.0.0-cp36-abi3-musllinux_1_1_aarch64.whl](https://wheels.linuxserver.io/alpine-3.16/cryptography-39.0.0-cp36-abi3-musllinux_1_1_aarch64.whl)
[cryptography-39.0.0-cp36-abi3-musllinux_1_1_x86_64.whl](https://wheels.linuxserver.io/alpine-3.16/cryptography-39.0.0-cp36-abi3-musllinux_1_1_x86_64.whl)

Debugging of official image give me error in ld-musl-armhf.so.1 while importing (for exmaple) numpy or cryptography

(gdb) r
bash-5.1# gdb --args python -c "import sys, numpy; print(numpy.__version__, sys.version)"
Starting program: /usr/local/bin/python -c import\ sys,\ numpy\;\ print\(numpy.__version__,\ sys.version\)

Program received signal SIGSEGV, Segmentation fault.
0x75fb792c in ?? () from /lib/ld-musl-armhf.so.1

I think we could start from this point.... For example when simple importing of numpy inside of container will be without segmentation fault.

**bash-5.1# python3 
Python 3.10.7 (main, Nov 24 2022, 13:02:43) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Segmentation fault
bash-5.1#** 
magicse commented 1 year ago

QNAP armv7l May be problem with armv7l <-- > armv7hf and package architecture (armv7l) does not match system (armhf) also it not armv7hf-musl armv7hf armv7l-musl

bash-5.1# cat /proc/cpuinfo processor : 0 model name : Annapurna Labs Alpine AL314 Quad-core ARM Cortex-A15 CPU @ 1.70GHz Speed : 1.7GHz Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x2 CPU part : 0xc0f CPU revision : 4

magicse commented 1 year ago

@Gerigot @Wetzel402 I have tried build wheels for armv7 on Ubuntu 64 with next command

export ARCH=armv7
sudo docker build  --build-arg CPYTHON_ABI=cp310 --build-arg BUILD_FROM=ghcr.io/home-assistant/wheels/${ARCH}/musllinux_1_2/cp310:dev --build-arg BUILD_ARCH=${ARCH} --tag wheel-builder:${ARCH} .

And all time got error about import cmake.

After that I checked Dockerfile and requirements_cp310.txt and files at this link "https://wheels.home-assistant.io/musllinux/" and there is different versions of cmake. In requirements_cp310.txt version of cmake 3.25.2 and at link "https://wheels.home-assistant.io/musllinux/" cmake for armv7 is 3.22.2. After changing version of cmake in file requirements_cp310.txt to 3.22.2 - all builds well.

Could you check this problem with versions?

Wetzel402 commented 1 year ago

@magicse,

The cmake version was only changed a couple of weeks ago so I'm not sure that's our problem. Theoretically something changed between the June and July builds of HA and we need to find it.

magicse commented 1 year ago

I think need dig in musllinux becouse i get seg fault during debug from ld-musl-armhf.so.1

gdb --args python -c "import sys, numpy; print(numpy.__version__, sys.version)"
Starting program: /usr/local/bin/python -c import\ sys,\ numpy\;\ print\(numpy.__version__,\ sys.version\)
Program received signal SIGSEGV, Segmentation fault.
0x75fb792c in ?? () from /lib/ld-musl-armhf.so.1

Also additional information abut cpu from here ARMonQEMUforDebianUbuntu.md ARMv7 CPU which Debian calls as armhf (ARM hard float) and Cortex-A8, A9, A15 are all ARMv7. ARMv6 CPU which Debian calls as armel and ARMv5, v6. Raspberry Pi uses ARMv6. In this case, the cpu is arm1176

And addidtiona information ARM v6 and v7 target musl Building a cross compiler targeting musl libc MUSL LIBC for ARMv6 and ARMv7 Building Unable run grpcio wheel on alpine arvm7 run grpcio wheel on alpine arvm7

magicse commented 1 year ago

I rebuilt numpy package inside of homeassistant container

git clone https://github.com/numpy/numpy.git
cd numpy
python setup.py build -j 4 install

And after that it work well without segfault.

bash-5.1# python
Python 3.10.7 (main, Nov 24 2022, 13:02:43) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> 
magicse commented 1 year ago

$\color{magenta}{\textrm{Test experiments inside of homeassistant container}}$

💡 pip show numpy

bash-5.1# pip show numpy
Name: numpy
Version: 1.23.2
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: 
License: BSD
Location: /usr/local/lib/python3.10/site-packages
Requires: 
Required-by: contourpy, imageio, matplotlib, noaa-coops, pandas, pyairvisual, PyTurboJPEG

💡 python3 -c "import numpy"

bash-5.1# python3 -c "import numpy"
Segmentation fault 
bash-5.1# 

And after pip install numpy all good

💡 pip install numpy --upgrade --no-cache-dir --force-reinstall --use-deprecated=legacy-resolver

bash-5.1#  apk add gcc g++
bash-5.1#  pip install numpy --upgrade --no-cache-dir --force-reinstall  --use-deprecated=legacy-resolver
Collecting numpy
  Downloading numpy-1.24.2.tar.gz (10.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.9/10.9 MB 919.0 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (pyproject.toml) ... done
  Created wheel for numpy: filename=numpy-1.24.2-cp310-cp310-linux_armv7l.whl size=6837303 sha256=45539a718b34234f92ede59b7f65d6b363f0c0d85cc8d862b70d190527d633ae
  Stored in directory: /tmp/pip-ephem-wheel-cache-8pwduyiw/wheels/31/42/8e/88540c3411ed4734c7fd06056942e82136135724593ecec35a
Successfully built numpy
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.23.2
    Uninstalling numpy-1.23.2:
      Successfully uninstalled numpy-1.23.2
Successfully installed numpy-1.24.2

💡 python3 -c "import numpy"

bash-5.1# python3 -c "import numpy"
bash-5.1# 

💡 pip show numpy

bash-5.1# pip show numpy
Name: numpy
Version: 1.24.2
Summary: Fundamental package for array computing in Python
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: 
License: BSD-3-Clause
Location: /usr/local/lib/python3.10/site-packages
Requires: 
Required-by: contourpy, imageio, matplotlib, noaa-coops, pandas, pyairvisual, PyTurboJPEG
magicse commented 1 year ago

@Wetzel402 I downloaded Alpina 3.16 official minimal clean docker image (only 5mb in size) https://hub.docker.com/_/alpine And I installed everything in it from scratch myself Python 3.10.10, g++, gcc and homeassistant with pip install homeassistant command.

After installation I ran *hass script and Home Assistant 2023.2.5 started and everything works great. This indicates that the docker image https://hub.docker.com/r/homeassistant/home-assistant which is posted on homeassistant is not built correctly. sc1 sc2 sc3

magicse commented 1 year ago

List of commands to install Home assistant in to the clear minimal Alpine 3.16 docker image.

apk add bash
bash
bash-5.1# apk add g++ gcc make
bash-5.1# apk add libcap libpcap-dev
bash-5.1# apk add ffmpeg 
bash-5.1# apk add python3
bash-5.1# apk add python3-dev libffi-dev libftdi1-dev bzip2-dev openssl-dev
bash-5.1# apk add cargo
bash-5.1# python3 -m ensurepip --upgrade
bash-5.1# pip3 install aiohttp
bash-5.1# pip3 install ffmpeg
bash-5.1# pip3 install libpcap
bash-5.1# pip3 install tzdata
bash-5.1# pip3 install PyNaCl
bash-5.1# pip3 install homeassistant

To start home assistant run hass

Wetzel402 commented 1 year ago

@magicse, good work troubleshooting.

@frenck, is this something you could look into?

magicse commented 1 year ago

@Gerigot Also could someone explain to me why I can't update or delete old python in the Home Assistan original container image by standard methods? I wanted made some experiment inside of Home assistant original container but I couldn't.

bash-5.1# python --version
Python 3.10.7
bash-5.1# apk del python3
OK: 119 MiB in 162 packages
bash-5.1# python --version
Python 3.10.7
bash-5.1# apk add python3
(1/1) Installing python3 (3.10.10-r0)
Executing busybox-1.35.0-r17.trigger
OK: 165 MiB in 163 packages
bash-5.1# python --version
Python 3.10.7

????? What's wrong with this container from Home Assistant???

magicse commented 1 year ago

@Wetzel402 @jrieger @larsxschneider @lswysocki @boyarale @Gerigot

Next experiment inside of original Home Assistant docker container to get worked Home Assistant

I removed old python by rm command because apk del python3 can't delete it, I think because of some wrong installation of Python in Home Assistan container.

rm -f /usr/local/bin/python*
rm -f /usr/local/bin/pip*
rm -f /usr/local/bin/pydoc
rm -rf /usr/local/bin/include/python*
rm -f /usr/local/lib/libpython*
rm -rf /usr/local/lib/python*
rm -f /usr/local/share/man/python*
rm -rf /usr/local/lib/pkgconfig
rm -f /usr/local/bin/idle
rm -f /usr/local/bin/easy_install-*
rm -rf /usr/local/include/python*
rm -f /usr/local/share/man/python*

After that I reinstall Python and Home Assistant inside of container.

apk add pyton3
ln -sf /usr/bin/python3 /usr/bin/python && ln -sf /usr/bin/python3 /usr/local/bin/python
python3 -m ensurepip --upgrade
apk add cargo libffi-dev libftdi1-dev python3-dev bzip2-dev openssl-dev
pip3 install ffmpeg
pip3 install libpcap
pip3 install tzdata
pip3 install PyNaCl
cd /usr/src/homeassistant
pip3 install -e .
hass --config /config

And voila Home Assistant works without problems

bash-5.1# hass --config /config
2023-02-21 09:06:13.090 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration rhvoice which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-02-21 09:06:13.124 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration browser_mod which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

sc3

Therefore, questions remain about the Python installed in the original Home Assistant container.

Listing of worked installation ``` bash-5.1# pip install -e . Obtaining file:///usr/src/homeassistant Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting voluptuous-serialize==2.5.0 Downloading voluptuous_serialize-2.5.0-py3-none-any.whl (6.8 kB) Requirement already satisfied: pip<22.4,>=21.0 in /usr/lib/python3.10/site-packages (from homeassistant==2023.2.5) (22.3.1) Collecting home-assistant-bluetooth==1.9.2 Using cached home_assistant_bluetooth-1.9.2.tar.gz (10 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting PyJWT==2.5.0 Downloading PyJWT-2.5.0-py3-none-any.whl Collecting voluptuous==0.13.1 Using cached voluptuous-0.13.1-py3-none-any.whl (29 kB) Collecting astral==2.2 Using cached astral-2.2-py2.py3-none-any.whl (30 kB) Collecting awesomeversion==22.9.0 Using cached awesomeversion-22.9.0-py3-none-any.whl (12 kB) Collecting orjson==3.8.6 Using cached orjson-3.8.6.tar.gz (655 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting ifaddr==0.1.7 Using cached ifaddr-0.1.7-py2.py3-none-any.whl (10 kB) Collecting pyOpenSSL==23.0.0 Using cached pyOpenSSL-23.0.0-py3-none-any.whl (57 kB) Collecting python-slugify==4.0.1 Using cached python-slugify-4.0.1.tar.gz (11 kB) Preparing metadata (setup.py) ... done Collecting cryptography==39.0.1 Using cached cryptography-39.0.1.tar.gz (603 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting lru-dict==1.1.8 Using cached lru-dict-1.1.8.tar.gz (10 kB) Preparing metadata (setup.py) ... done Collecting atomicwrites-homeassistant==1.4.1 Using cached atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl (7.1 kB) Collecting jinja2==3.1.2 Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB) Collecting certifi>=2021.5.30 Downloading certifi-2022.12.7-py3-none-any.whl (155 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 761.5 kB/s eta 0:00:00 Collecting pyyaml==6.0 Using cached PyYAML-6.0.tar.gz (124 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting typing-extensions<5.0,>=4.4.0 Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB) Collecting ciso8601==2.3.0 Using cached ciso8601-2.3.0.tar.gz (26 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting httpx==0.23.3 Using cached httpx-0.23.3-py3-none-any.whl (71 kB) Collecting async-timeout==4.0.2 Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB) Collecting aiohttp==3.8.1 Using cached aiohttp-3.8.1.tar.gz (7.3 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting bcrypt==4.0.1 Using cached bcrypt-4.0.1.tar.gz (25 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting attrs==22.2.0 Using cached attrs-22.2.0-py3-none-any.whl (60 kB) Collecting yarl==1.8.1 Using cached yarl-1.8.1.tar.gz (172 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting requests==2.28.1 Using cached requests-2.28.1-py3-none-any.whl (62 kB) Collecting frozenlist>=1.1.1 Downloading frozenlist-1.3.3.tar.gz (66 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.6/66.6 kB 537.9 kB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting multidict<7.0,>=4.5 Downloading multidict-6.0.4.tar.gz (51 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.3/51.3 kB 436.4 kB/s eta 0:00:00 Installing build dependencies ... done WARNING: Missing build requirements in pyproject.toml for multidict<7.0,>=4.5 from https://files.pythonhosted.org/packages/4a/15/bd620f7a6eb9aa5112c4ef93e7031bcd071e0611763d8e17706ef8ba65e0/multidict-6.0.4.tar.gz (from aiohttp==3.8.1->homeassistant==2023.2.5). WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'. Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting aiosignal>=1.1.2 Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Collecting charset-normalizer<3.0,>=2.0 Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB) Collecting pytz Downloading pytz-2022.7.1-py2.py3-none-any.whl (499 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 kB 658.7 kB/s eta 0:00:00 Collecting cffi>=1.12 Using cached cffi-1.15.1.tar.gz (508 kB) Preparing metadata (setup.py) ... done Collecting httpcore<0.17.0,>=0.15.0 Downloading httpcore-0.16.3-py3-none-any.whl (69 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 69.6/69.6 kB 562.2 kB/s eta 0:00:00 Collecting rfc3986[idna2008]<2,>=1.3 Downloading rfc3986-1.5.0-py2.py3-none-any.whl (31 kB) Collecting sniffio Downloading sniffio-1.3.0-py3-none-any.whl (10 kB) Collecting MarkupSafe>=2.0 Downloading MarkupSafe-2.1.2.tar.gz (19 kB) Preparing metadata (setup.py) ... done Collecting text-unidecode>=1.3 Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.2/78.2 kB 767.2 kB/s eta 0:00:00 Collecting idna<4,>=2.5 Downloading idna-3.4-py3-none-any.whl (61 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 557.1 kB/s eta 0:00:00 Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.14-py2.py3-none-any.whl (140 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 497.1 kB/s eta 0:00:00 Collecting pycparser Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB) Collecting h11<0.15,>=0.13 Downloading h11-0.14.0-py3-none-any.whl (58 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 239.7 kB/s eta 0:00:00 Collecting anyio<5.0,>=3.0 Downloading anyio-3.6.2-py3-none-any.whl (80 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.6/80.6 kB 659.2 kB/s eta 0:00:00 Building wheels for collected packages: aiohttp, bcrypt, ciso8601, cryptography, home-assistant-bluetooth, orjson, pyyaml, yarl, frozenlist, multidict Building wheel for aiohttp (pyproject.toml) ... done Created wheel for aiohttp: filename=aiohttp-3.8.1-cp310-cp310-linux_armv7l.whl size=1224585 sha256=0b0d0d36dd3dacee924a8017468c95a11d2488965a45d83a3f7070741850e9d0 Stored in directory: /root/.cache/pip/wheels/d4/50/eb/f51338c53367b838a0ec965f2c3169ea7e3e15a846345dcf51 Building wheel for bcrypt (pyproject.toml) ... done Created wheel for bcrypt: filename=bcrypt-4.0.1-cp310-cp310-linux_armv7l.whl size=261298 sha256=ed2b2f4fbfc7131ac394f789144f150e791c371048877f614d74ba984db17d52 Stored in directory: /root/.cache/pip/wheels/03/3b/4e/dcbf6b75a11a1ca8559ccdd1c72f3a5bccc06c1d4c446a910e Building wheel for ciso8601 (pyproject.toml) ... done Created wheel for ciso8601: filename=ciso8601-2.3.0-cp310-cp310-linux_armv7l.whl size=37163 sha256=f99a7f6050038a2343fa21582c4f0c850525a380f58c3c09c0c3fc27d802cb69 Stored in directory: /root/.cache/pip/wheels/bf/6d/37/ade063f0371c2d99d0d89c573b5f8f8d2b65867cbbdecac23d Building wheel for cryptography (pyproject.toml) ... done Created wheel for cryptography: filename=cryptography-39.0.1-cp310-cp310-linux_armv7l.whl size=1724519 sha256=d2e969335c6f5b9e30197f3d12a9bb4151abc46ef5cdfdeedaa4ec0386ed5626 Stored in directory: /root/.cache/pip/wheels/64/c4/cc/f550958c39c03b9a252e4d1b3d1f66a60465239087c76bb3cd Building wheel for home-assistant-bluetooth (pyproject.toml) ... done Created wheel for home-assistant-bluetooth: filename=home_assistant_bluetooth-1.9.2-cp310-cp310-musllinux_1_2_armv7l.whl size=9880 sha256=c3058c27d6f0ec4db05c3d4fc2a3929ab30192d0c00f360f257ae272e97b0f70 Stored in directory: /root/.cache/pip/wheels/1b/45/f8/d15781d785e0954f95d7fa40a868d3af255d4a5dc6096e5777 Building wheel for orjson (pyproject.toml) ... done Created wheel for orjson: filename=orjson-3.8.6-cp310-cp310-linux_armv7l.whl size=307962 sha256=287798bad47db17615d5aa484086c464761889f1e3670300455ca114e73017c1 Stored in directory: /root/.cache/pip/wheels/27/60/74/750046bf9140da2969b4439a56111b0ed3214e18481f0bd7db Building wheel for pyyaml (pyproject.toml) ... done Created wheel for pyyaml: filename=PyYAML-6.0-cp310-cp310-linux_armv7l.whl size=45331 sha256=d5a116e6c94d6e7f9ba9374e7cc79ea39393461f9a80e5bdf9d8cc3bad5de494 Stored in directory: /root/.cache/pip/wheels/06/72/f6/3f89f64cf1943a82e42cdd8e59d7b2aa98769fd48b08019fc7 Building wheel for yarl (pyproject.toml) ... done Created wheel for yarl: filename=yarl-1.8.1-cp310-cp310-linux_armv7l.whl size=251195 sha256=a747d014b792db53a1d6fd10743c142dc9a31c000a4dafad2fda863b7dcd9728 Stored in directory: /root/.cache/pip/wheels/1f/60/e8/b65794eedd75315d15fba8f46db710ce68e823664810ca5ce6 Building wheel for frozenlist (pyproject.toml) ... done Created wheel for frozenlist: filename=frozenlist-1.3.3-cp310-cp310-linux_armv7l.whl size=140954 sha256=58f39c3b7ce9c72b99223e827deb5e787b1bc492d4f597d59e7eb125e391038d Stored in directory: /root/.cache/pip/wheels/37/77/4d/2330a0cc3e244d931a9e60859bb6ec66e09558b3806c382983 Building wheel for multidict (pyproject.toml) ... done Created wheel for multidict: filename=multidict-6.0.4-cp310-cp310-linux_armv7l.whl size=108885 sha256=ec576deb44836fc0e71f0f60c84ff2d0446314eef02bfd256dcafce1310f5752 Stored in directory: /root/.cache/pip/wheels/ae/d2/13/61a3897335dd417ee80bcf70d39fea8eda1f7761d28d5547f5 Successfully built aiohttp bcrypt ciso8601 cryptography home-assistant-bluetooth orjson pyyaml yarl frozenlist multidict Installing collected packages: voluptuous, text-unidecode, rfc3986, pytz, lru-dict, ifaddr, ciso8601, voluptuous-serialize, urllib3, typing-extensions, sniffio, pyyaml, python-slugify, PyJWT, pycparser, orjson, multidict, MarkupSafe, idna, home-assistant-bluetooth, h11, frozenlist, charset-normalizer, certifi, bcrypt, awesomeversion, attrs, atomicwrites-homeassistant, async-timeout, astral, yarl, requests, jinja2, cffi, anyio, aiosignal, httpcore, cryptography, aiohttp, pyOpenSSL, httpx, homeassistant DEPRECATION: lru-dict is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for lru-dict ... done DEPRECATION: python-slugify is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for python-slugify ... done DEPRECATION: MarkupSafe is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for MarkupSafe ... done DEPRECATION: cffi is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for cffi ... done Running setup.py develop for homeassistant Successfully installed MarkupSafe-2.1.2 PyJWT-2.5.0 aiohttp-3.8.1 aiosignal-1.3.1 anyio-3.6.2 astral-2.2 async-timeout-4.0.2 atomicwrites-homeassistant-1.4.1 attrs-22.2.0 awesomeversion-22.9.0 bcrypt-4.0.1 certifi-2022.12.7 cffi-1.15.1 charset-normalizer-2.1.1 ciso8601-2.3.0 cryptography-39.0.1 frozenlist-1.3.3 h11-0.14.0 home-assistant-bluetooth-1.9.2 homeassistant-2023.2.5 httpcore-0.16.3 httpx-0.23.3 idna-3.4 ifaddr-0.1.7 jinja2-3.1.2 lru-dict-1.1.8 multidict-6.0.4 orjson-3.8.6 pyOpenSSL-23.0.0 pycparser-2.21 python-slugify-4.0.1 pytz-2022.7.1 pyyaml-6.0 requests-2.28.1 rfc3986-1.5.0 sniffio-1.3.0 text-unidecode-1.3 typing-extensions-4.5.0 urllib3-1.26.14 voluptuous-0.13.1 voluptuous-serialize-2.5.0 yarl-1.8.1 ```
magicse commented 1 year ago

I think that the problem is related to the incorrectly compiled and installed Python in the container. And as a result we get a broken container for armv7 Also I could share built whl's if needed. built wheels

Also pay attention to the names of the created packages after rebuilding. ( in some packages names "linux" instead "musllinux_1_2") -
aiohttp-3.8.1-cp310-cp310-linux_armv7l.whl instead of your repository aiohttp-3.8.3-cp310-cp310-musllinux_1_2_armv7l.whl or my build name of home_assistant_bluetooth-1.9.2-cp310-cp310-musllinux_1_2_armv7l.whl the same as your weel name home_assistant_bluetooth-1.9.2-cp310-cp310-musllinux_1_2_armv7l.whl

magicse commented 1 year ago

Hi @Gerigot , could you helpme? I see several reps with dockerfiles. Can you tell me which one do you use to cross-compile a Docker image for your experiments with armv6 ? 1 https://github.com/home-assistant/core 2 https://github.com/home-assistant/docker-base 3 https://github.com/home-assistant/docker

Gerigot commented 1 year ago

Hi @Gerigot , could you helpme? I see several reps with dockerfiles. Can you tell me which one do you use to cross-compile a Docker image for your experiments with armv6 ? 1 https://github.com/home-assistant/core 2 https://github.com/home-assistant/docker-base 3 https://github.com/home-assistant/docker

Hi I was using the core one, the other projects are, as I understood, some base where the core build is based on.

If you want to try build that image remember to pass this build-arg if you want to try of course you should use the right homeassistant-base image I was using the armhf but for the v7 I think you can try using the ghcr.io/home-assistant/armv7-homeassistant-base:2022.11.0....

--build-arg BUILD_FROM=ghcr.io/home-assistant/armhf-homeassistant-base:2022.11.0 -t homeassistant-home .

I've seen they begun to use a newer version of the homeassistant-base (ghcr.io/home-assistant/armv7-homeassistant-base:2023.02.0) so maybe it can be helpful also trying with that one.

Gerigot commented 1 year ago

Sorry I was very busy those days and I couldn't see what was analyzed till now. You said that with a new version of python it was working right? What I can see is that in the new version of the homeassistant-base the bumped the python version so try building the core with the new version of the base or better try this version of home assistant on your device homeassistant/armv7-homeassistant:2023.4.0.dev20230223

magicse commented 1 year ago

@Gerigot No, I don't want to download the finished image. I'm currently trying and experimenting with cross-compiling my own image. And I wanted to know which github of the above listed you used.

Gerigot commented 1 year ago

as I said I used the core one :D no problem I was just curious because I saw that the new version should have the base image with the new python so maybe that will solve the issue without compiling

Gerigot commented 1 year ago

let me know, "unfortunately" I don't have a device with the problem, so I can't help testing

magicse commented 1 year ago

I have already successfully cross-compiled the image from here https://github.com/home-assistant/docker-base/tree/master/alpine on Ubuntu64 with this command

sudo docker build --build-arg BUILD_FROM=arm32v7/alpine:3.16.4 --build-arg QEMU_CPU=cortex-a15 --build-arg TEMPIO_VERSION=2021.09.0 --build-arg BASHIO_VERSION=0.14.3 --build-arg S6_OVERLAY_VERSION=3.1.4.1 --build-arg BUILD_ARCH=${ARCH} .

and after building the clear Docker image (with changed *init to /bin/bash) started normally on QNAP

magicse commented 1 year ago

You said that with a new version of python it was working right?

Yes you are right with Python 10.10.10 it work well

Gerigot commented 1 year ago

Ok so you're trying to do all what is done from multiple github actions alone ... And it's a good method, first trying to make it work and then slowly remove some custom builded image using the "offical" one is a good method to narrow down what is going wrong. You already did a great work I suspect that since the base image was the 2022.11.0 and stayed that for long time probably something was not working as expected but it could also be something other

magicse commented 1 year ago

I tried to cross-rebuild the docker image myself with this command

git clone https://github.com/home-assistant/core.git 03.hass-core
cd 03.hass-core
docker buildx build --output type=docker --platform linux/arm/v7 --build-arg BUILD_FROM=ghcr.io/home-assistant/armv7-homeassistant-base:2023.02.0 --build-arg QEMU_CPU=cortex-a15 .

but I get the same problems as the original images 2022.7+ Python crashes with Segmentation fault error even with a simple import of the numpy package and aiohttp too, i think with another packages the same.

bash-5.1# python
Python 3.10.10 (main, Feb 14 2023, 15:33:41) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Segmentation fault

After re-installing Python already in the assembled container through the terminal with the standard apk add python3 command, everything starts working just fine. removing python

rm -f /usr/local/bin/python*
rm -f /usr/local/bin/pip*
rm -f /usr/local/bin/pydoc
rm -rf /usr/local/bin/include/python*
rm -f /usr/local/lib/libpython*
rm -rf /usr/local/lib/python*
rm -f /usr/local/share/man/python*
rm -rf /usr/local/lib/pkgconfig
rm -f /usr/local/bin/idle
rm -f /usr/local/bin/easy_install-*
rm -rf /usr/local/include/python*
rm -f /usr/local/share/man/python*

Instalin pyhon and Home Assistant

apk add pyton3
ln -sf /usr/bin/python3 /usr/bin/python && ln -sf /usr/bin/python3 /usr/local/bin/python
python3 -m ensurepip --upgrade
apk add cargo
apk add libffi-dev python3-dev libftdi1-dev bzip2-dev openssl-dev
pip3 install ffmpeg
pip3 install libpcap
pip3 install tzdata
pip3 install PyNaCl
cd /usr/src/homeassistant
pip3 install -e .
hass --config /config
Layers list of built image ``` 1 3.8 MB ADD file:193f48d48ed2e90a0e81663757e372f59806151c17e82113f03443db0ef723c3 in / 2 0 B CMD ["/bin/sh"] 3 0 B ENV LANG=C.UTF-8 S6_BEHAVIOUR_IF_STAGE2_FAILS=2 S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 S6_CMD_WAIT_FOR_SERVICES=1 S6_SERVICES_READY... 4 0 B SHELL [/bin/ash -o pipefail -c] 5 0 B ARG BASHIO_VERSION TEMPIO_VERSION S6_OVERLAY_VERSION JEMALLOC_VERSION QEMU_CPU 6 0 B WORKDIR /usr/src 7 0 B ARG BUILD_ARCH 8 78.2 MB RUN |6 BASHIO_VERSION=0.14.3 TEMPIO_VERSION=2021.09.0 S6_OVERLAY_VERSION=3.1.3.0 JEMALLOC_VERSION=5.3.0 QEMU_CPU= BUILD_ARCH=ar... 9 0 B WORKDIR / 10 0 B ENTRYPOINT ["/init"] 11 0 B ARG PYTHON_VERSION PIP_VERSION GPG_KEY QEMU_CPU 12 0 B ENV PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 13 0 B SHELL [/bin/ash -o pipefail -c] 14 3.6 kB COPY *.patch /usr/src/ # buildkit 15 51.1 MB RUN |4 PYTHON_VERSION=3.10.10 PIP_VERSION=23.0.0 GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D QEMU_CPU= /bin/ash -o pipefai... 16 32 B RUN |4 PYTHON_VERSION=3.10.10 PIP_VERSION=23.0.0 GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D QEMU_CPU= /bin/ash -o pipefai... 17 17.5 MB RUN |4 PYTHON_VERSION=3.10.10 PIP_VERSION=23.0.0 GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D QEMU_CPU= /bin/ash -o pipefai... 18 0 B ARG BUILD_ARCH QEMU_CPU SSOCR_VERSION ARPSCAN_VERSION LIBCEC_VERSION PICOTTS_HASH TELLDUS_COMMIT 19 0 B ENV WHEELS_LINKS=https://wheels.home-assistant.io/musllinux/ 20 94.6 MB RUN |7 BUILD_ARCH=armv7 QEMU_CPU= SSOCR_VERSION=2.22.1 ARPSCAN_VERSION=1.9.7 LIBCEC_VERSION=6.0.2 PICOTTS_HASH=e3ba46009ee86891... 21 65 B COPY requirements.txt /usr/src/ # buildkit 22 10.6 MB RUN |7 BUILD_ARCH=armv7 QEMU_CPU= SSOCR_VERSION=2.22.1 ARPSCAN_VERSION=1.9.7 LIBCEC_VERSION=6.0.2 PICOTTS_HASH=e3ba46009ee86891... 23 0 B WORKDIR /usr/src/ 24 1.9 MB RUN |7 BUILD_ARCH=armv7 QEMU_CPU= SSOCR_VERSION=2.22.1 ARPSCAN_VERSION=1.9.7 LIBCEC_VERSION=6.0.2 PICOTTS_HASH=e3ba46009ee86891... 25 1.4 MB RUN |7 BUILD_ARCH=armv7 QEMU_CPU= SSOCR_VERSION=2.22.1 ARPSCAN_VERSION=1.9.7 LIBCEC_VERSION=6.0.2 PICOTTS_HASH=e3ba46009ee86891... 26 396 B COPY patches/libcec-fix-null-return.patch /usr/src/ # buildkit 27 2.1 MB RUN |7 BUILD_ARCH=armv7 QEMU_CPU= SSOCR_VERSION=2.22.1 ARPSCAN_VERSION=1.9.7 LIBCEC_VERSION=6.0.2 PICOTTS_HASH=e3ba46009ee86891... 28 8.3 MB RUN |7 BUILD_ARCH=armv7 QEMU_CPU= SSOCR_VERSION=2.22.1 ARPSCAN_VERSION=1.9.7 LIBCEC_VERSION=6.0.2 PICOTTS_HASH=e3ba46009ee86891... 29 2.4 kB COPY patches/telldus-fix-gcc-11-issues.patch /usr/src/ # buildkit 30 1.4 MB RUN |7 BUILD_ARCH=armv7 QEMU_CPU= SSOCR_VERSION=2.22.1 ARPSCAN_VERSION=1.9.7 LIBCEC_VERSION=6.0.2 PICOTTS_HASH=e3ba46009ee86891... 31 44.4 kB COPY rootfs / # buildkit 32 0 B ENV S6_SERVICES_GRACETIME=220000 33 0 B ARG QEMU_CPU 34 0 B WORKDIR /usr/src 35 544 B COPY requirements.txt homeassistant/ # buildkit 36 4.5 kB COPY homeassistant/package_constraints.txt homeassistant/homeassistant/ # buildkit 37 20.6 MB RUN |1 QEMU_CPU=cortex-a15 /bin/ash -o pipefail -c pip3 install --no-cache-dir --no-index --only-binary... 38 53 kB COPY requirements_all.txt home_assistant_frontend-* home_assistant_intents-* homeassistant/ # buildkit 39 967.1 MB RUN |1 QEMU_CPU=cortex-a15 /bin/ash -o pipefail -c if ls homeassistant/home_assistant_frontend*.whl 1> /dev/null 2>&1; then ... 40 31.3 MB COPY . homeassistant/ # buildkit 41 26.5 MB RUN |1 QEMU_CPU=cortex-a15 /bin/ash -o pipefail -c pip3 install --no-cache-dir --no-index --only-binary... 42 2.7 kB COPY rootfs / # buildkit 43 0 B WORKDIR /config ``` <\summary>
magicse commented 1 year ago

Hi @pvizeli I'm trying to figure out a problem for our QNAP armv7 devices. please take a look at my research, maybe you can help with something. Most similar to a Python issue that throws a segmentation fault.

magicse commented 1 year ago

@Wetzel402

$\textcolor{magenta}{\textsf{Next experiment rebuilding docker image without using ready-made images of wheels}}$

To eliminate the influence of already created Wheels from repo "https://wheels.home-assistant.io/musllinux/", I changed the Dockerfile. I removed the use of the ready-made Wheels repository "https://wheels.home-assistant.io/musllinux/" from the Dockerfile and I want them to be compiled during the creation of the Docker image.

$\textcolor{orange}{\textsf{I'll post the results after compilation.}}$

git clone https://github.com/home-assistant/core.git 03.hass-core
cd 03.hass-core
docker buildx build --output type=docker --platform linux/arm/v7 --build-arg BUILD_FROM=ghcr.io/home-assistant/armv7-homeassistant-base:2023.02.0 --build-arg QEMU_CPU=cortex-a15 .

Changes in Dockerfile

ARG BUILD_FROM
FROM ${BUILD_FROM}

# Synchronize with homeassistant/core.py:async_stop
+# cargo under QEMU building for ARM can consumes 10s of GBs of RAM...
+# Solution: https://users.rust-lang.org/t/cargo-uses-too-much-memory-being-run-in-qemu/76531/2
ENV \
-  S6_SERVICES_GRACETIME=220000
+ S6_SERVICES_GRACETIME=220000 \
+ CARGO_NET_GIT_FETCH_WITH_CLI=true

ARG QEMU_CPU

WORKDIR /usr/src

+RUN \
+   apk add --no-cache \
+     cmake \
+     cargo \
+     ffmpeg-dev libxml2-dev libxslt-dev jpeg-dev \
+     libffi-dev \
+     python3-dev \
+     libftdi1-dev \
+     bzip2-dev \
+     openssl-dev \
+     postgresql-dev mysql-client mariadb-connector-c-dev \
+     libpcap \
+     autoconf \
+     automake \
+     build-base \
+     libpcap-dev 

## Setup Home Assistant Core dependencies
COPY requirements.txt homeassistant/
COPY homeassistant/package_constraints.txt homeassistant/homeassistant/
RUN \
    pip3 install \
        --no-cache-dir \
-       --no-index \
-       --only-binary=:all: \
-       --find-links "${WHEELS_LINKS}" \
        --use-deprecated=legacy-resolver \
        -r homeassistant/requirements.txt

COPY requirements_all.txt home_assistant_frontend-* home_assistant_intents-* homeassistant/
RUN \
    if ls homeassistant/home_assistant_frontend*.whl 1> /dev/null 2>&1; then \
        pip3 install \
            --no-cache-dir \
-           --no-index \
            homeassistant/home_assistant_frontend-*.whl; \
    fi \
    && if ls homeassistant/home_assistant_intents*.whl 1> /dev/null 2>&1; then \
        pip3 install \
            --no-cache-dir \
-          --no-index \
            homeassistant/home_assistant_intents-*.whl; \
    fi \
    && \
        LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \
        MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \
        pip3 install \
            --no-cache-dir \
-          --no-index \
-          --only-binary=:all: \
-          --find-links "${WHEELS_LINKS}" \
            --use-deprecated=legacy-resolver \
            -r homeassistant/requirements_all.txt

## Setup Home Assistant Core
COPY . homeassistant/
RUN \
    pip3 install \
        --no-cache-dir \
-      --no-index \
-      --only-binary=:all: \
-      --find-links "${WHEELS_LINKS}" \
        --use-deprecated=legacy-resolver \
        -e ./homeassistant \
    && python3 -m compileall \
        homeassistant/homeassistant

# Home Assistant S6-Overlay
COPY rootfs /

WORKDIR /config
Gerigot commented 1 year ago

Just for information so is probably easier to debug. The core image is built starting FROM the homeassistant/docker image, that is build on top of the python3.10 homeassistant/docker-base image that, in turn, is based on the armv7-base:

https://github.com/home-assistant/docker-base/tree/master/alpine (armv7-base) https://github.com/home-assistant/docker-base/tree/master/python/3.10 (python3.10 -alpine 3.16 docker-base) https://github.com/home-assistant/docker (homeassistant-base) https://github.com/home-assistant/core (core)

you could probably try to check if the problem is really in the wheels or in some misconfigured image from all the layers

Before everything it starts with arm32v7/alpine:3.16

magicse commented 1 year ago

Before everything it starts with arm32v7/alpine:3.16

It work well. The problem is hiding somewhere in Python or built Wheels