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

Home Assistant install fails on maturin #7329

Open
1 task done
jankkhvej opened this issue Dec 27, 2024 · 15 comments · Fixed by #7335
Open
1 task done

Home Assistant install fails on maturin #7329

jankkhvej opened this issue Dec 27, 2024 · 15 comments · Fixed by #7335
Labels
ARMv6 External bug 🐞 For bugs which are not caused by DietPi. RISC-V All RISC-V platform related Workaround available 🆗 Workaround is available/has been implemented, but a definite solution should be found when possible.
Milestone

Comments

@jankkhvej
Copy link

Creating a bug report/issue

  • I have searched the existing open and closed issues

Required Information

  • DietPi version | 9.9.0
  • Distro version | bookworm 1
  • Kernel version | Linux DietPi 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux
  • SBC model | RPi B (armv6l)
  • Power supply used | IKEA 5v 3 × USB-A charger SMÅHAGEL 705.440.79
  • SD card used | Kingston 128 Gb

Additional Information (if applicable)

  • Software title | Home Assitant
  • Fresh install
  • Yes, bug is repeatable on fresh install of DietPi
  • Bug report ID | 9937c3ff-27ae-402c-bbe2-d28fb843a5c4

Steps to reproduce

  1. Install fresh DietPi without any packages
  2. Upgrade everything
  3. reboot
  4. Attempt to install Home Assistant via dietpi-launcher -> DietPi-Software

Expected behaviour

  • Home Assistant installed

Actual behaviour

  • Got an error on install:
[...]
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [5 lines of output]
      💥 maturin failed
        Caused by: `project.version` field is required in pyproject.toml unless it is present in the `project.dynamic` list
      Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-r1yj3ba7', '--interpreter', '/home/homeassistant/.pyenv/versions/3.13.1/bin/python3.13']' returned non-zero exit status 1.
      Checking for Rust toolchain....
      Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-r1yj3ba7 --interpreter /home/homeassistant/.pyenv/versions/3.13.1/bin/python3.13`
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.

error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[FAILED] DietPi-Software | Installing Python with Home Assistant module into pyenv
 - Command: runuser -u homeassistant -- dash -c 
. /home/homeassistant/pyenv-activate.sh
pyenv install 3.13.1
pyenv local 3.13.1
pip3 install -U pip setuptools wheel
[ -z '' ] || pip3 install 
exec pip3 install homeassistant
[ INFO ] DietPi-BugReport | Generating informative command outputs, please wait...
[ INFO ] DietPi-BugReport | cp /tmp/G_EXEC_ERROR_REPORT G_EXEC_ERROR_REPORT, please wait...
[  OK  ] DietPi-BugReport | cp /tmp/G_EXEC_ERROR_REPORT G_EXEC_ERROR_REPORT
[  OK  ] DietPi-BugReport | Packing upload archive
[  OK  ] DietPi-BugReport | Sending bug report
[  OK  ] DietPi-BugReport | Your bug report has been successfully uploaded.
- Reference code: 9937c3ff-27ae-402c-bbe2-d28fb843a5c4
@MichaIng
Copy link
Owner

Can you please share the full log of the HA install attempt? I do not see which package build actually failed.

Might be an ARMv6-related issue, but as I am traveling, I have no access to my RPi Zero W right now.

@jankkhvej
Copy link
Author

Details:

  • Date | 2024-12-28 14:28:25
  • Program name | DietPi-Software
  • Command | runuser -u homeassistant -- dash -c . /home/homeassistant/pyenv-activate.sh pyenv install 3.13.1 pyenv local 3.13.1 pip3 install -U pip setuptools wheel [ -z '' ] || pip3 install exec pip3 install homeassistant
  • Exit code | 1
  • DietPi version | v9.9.0 (MichaIng/master)
  • Distro version | bookworm (ID=7,RASPBIAN=1)
  • Kernel version | Linux DietPi 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux
  • Architecture | armhf
  • Hardware model | RPi B (armv6l) (ID=1)

Additional logs:

Downloading Python-3.13.1.tar.gz...
-> https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tgz
Installing Python-3.13.1...
Installed Python-3.13.1 to /home/homeassistant/.pyenv/versions/3.13.1
Requirement already satisfied: pip in ./.pyenv/versions/3.13.1/lib/python3.13/site-packages (24.3.1)
Collecting setuptools
  Downloading setuptools-75.6.0-py3-none-any.whl.metadata (6.7 kB)
Collecting wheel
  Downloading wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
Downloading setuptools-75.6.0-py3-none-any.whl (1.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 2.1 MB/s eta 0:00:00
Downloading wheel-0.45.1-py3-none-any.whl (72 kB)
Installing collected packages: wheel, setuptools
Successfully installed setuptools-75.6.0 wheel-0.45.1
Collecting homeassistant
  Downloading homeassistant-2024.12.5-py3-none-any.whl.metadata (4.8 kB)
Collecting aiodns==3.2.0 (from homeassistant)
  Downloading aiodns-3.2.0-py3-none-any.whl.metadata (4.0 kB)
Collecting aiohasupervisor==0.2.1 (from homeassistant)
  Downloading aiohasupervisor-0.2.1-py3-none-any.whl.metadata (5.1 kB)
Collecting aiohttp==3.11.11 (from homeassistant)
  Downloading aiohttp-3.11.11.tar.gz (7.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.7/7.7 MB 4.1 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting aiohttp-cors==0.7.0 (from homeassistant)
  Downloading aiohttp_cors-0.7.0-py3-none-any.whl.metadata (20 kB)
Collecting aiohttp-fast-zlib==0.2.0 (from homeassistant)
  Downloading aiohttp_fast_zlib-0.2.0-py3-none-any.whl.metadata (5.6 kB)
Collecting aiozoneinfo==0.2.1 (from homeassistant)
  Downloading aiozoneinfo-0.2.1-py3-none-any.whl.metadata (5.5 kB)
Collecting astral==2.2 (from homeassistant)
  Downloading astral-2.2-py2.py3-none-any.whl.metadata (1.5 kB)
Collecting async-interrupt==1.2.0 (from homeassistant)
  Downloading async_interrupt-1.2.0-py3-none-any.whl.metadata (4.9 kB)
Collecting attrs==24.2.0 (from homeassistant)
  Downloading attrs-24.2.0-py3-none-any.whl.metadata (11 kB)
Collecting atomicwrites-homeassistant==1.4.1 (from homeassistant)
  Downloading atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl.metadata (6.0 kB)
Collecting awesomeversion==24.6.0 (from homeassistant)
  Downloading awesomeversion-24.6.0-py3-none-any.whl.metadata (9.0 kB)
Collecting bcrypt==4.2.0 (from homeassistant)
  Downloading bcrypt-4.2.0.tar.gz (24 kB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting certifi>=2021.5.30 (from homeassistant)
  Downloading certifi-2024.12.14-py3-none-any.whl.metadata (2.3 kB)
Collecting ciso8601==2.3.1 (from homeassistant)
  Downloading ciso8601-2.3.1.tar.gz (31 kB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting fnv-hash-fast==1.0.2 (from homeassistant)
  Downloading fnv_hash_fast-1.0.2.tar.gz (5.8 kB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting hass-nabucasa==0.86.0 (from homeassistant)
  Downloading hass_nabucasa-0.86.0-py3-none-any.whl.metadata (1.8 kB)
Collecting httpx==0.27.2 (from homeassistant)
  Downloading httpx-0.27.2-py3-none-any.whl.metadata (7.1 kB)
Collecting home-assistant-bluetooth==1.13.0 (from homeassistant)
  Downloading home_assistant_bluetooth-1.13.0-py3-none-any.whl.metadata (5.4 kB)
Collecting ifaddr==0.2.0 (from homeassistant)
  Downloading ifaddr-0.2.0-py3-none-any.whl.metadata (4.9 kB)
Collecting Jinja2==3.1.4 (from homeassistant)
  Downloading jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting lru-dict==1.3.0 (from homeassistant)
  Downloading lru-dict-1.3.0.tar.gz (13 kB)
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting PyJWT==2.10.1 (from homeassistant)
  Downloading PyJWT-2.10.1-py3-none-any.whl.metadata (4.0 kB)
Collecting cryptography==43.0.1 (from homeassistant)
  Downloading cryptography-43.0.1.tar.gz (686 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 686.9/686.9 kB 3.2 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting Pillow==11.0.0 (from homeassistant)
  Downloading pillow-11.0.0.tar.gz (46.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.7/46.7 MB 3.5 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting propcache==0.2.1 (from homeassistant)
  Downloading propcache-0.2.1-py3-none-any.whl.metadata (9.2 kB)
Collecting pyOpenSSL==24.2.1 (from homeassistant)
  Downloading pyOpenSSL-24.2.1-py3-none-any.whl.metadata (13 kB)
Collecting orjson==3.10.12 (from homeassistant)
  Downloading orjson-3.10.12.tar.gz (5.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.4/5.4 MB 4.2 MB/s eta 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [5 lines of output]
      💥 maturin failed
        Caused by: `project.version` field is required in pyproject.toml unless it is present in the `project.dynamic` list
      Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-htk6cb0j', '--interpreter', '/home/homeassistant/.pyenv/versions/3.13.1/bin/python3.13']' returned non-zero exit status 1.
      Checking for Rust toolchain....
      Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-htk6cb0j --interpreter /home/homeassistant/.pyenv/versions/3.13.1/bin/python3.13`
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@frozen905
Copy link

I'm here for the same issue, project.version field error trying to build maturin

@Joulinar
Copy link
Collaborator

This is an issue with the python module orjson and outside our control. It seems you are not alone ijl/orjson#541

@Joulinar Joulinar added External bug 🐞 For bugs which are not caused by DietPi. Waiting for external fix ⏳ and removed Investigating 🤔 labels Dec 29, 2024
@MichaIng
Copy link
Owner

MichaIng commented Dec 30, 2024

Seems to be solved upstream. Can you all retry?

maturin introduced a breaking change here: https://github.com/PyO3/maturin/pull/2391/files
Latest orjson explicitly declares the latest functional version before this breaking change as dependency. No long-term solution, I hope it does not imply a dependency version conflict at some point.

@MichaIng MichaIng added the Workaround available 🆗 Workaround is available/has been implemented, but a definite solution should be found when possible. label Dec 30, 2024
@MichaIng MichaIng added this to the v9.10 milestone Dec 30, 2024
@steals
Copy link

steals commented Dec 30, 2024

Upgrading to the lates version will not help, as HA strictly specifies 3.10.12 version https://github.com/home-assistant/core/blob/2024.12.5/homeassistant/package_constraints.txt
but this issue could be solved by manually downloading sources https://github.com/ijl/orjson/archive/refs/tags/3.10.12.tar.gz manually changing the project.toml fie and adding version = "3.10.12" and building it locally by pip install .

@MichaIng MichaIng added the ARMv6 label Dec 30, 2024
@MichaIng
Copy link
Owner

MichaIng commented Dec 30, 2024

Hmm, much easier and less intrusive to adjust package_constraints.txt instead. v3.10.13 is fully compatible, only ships with this one little change. EDIT: Ah, does not work that easy, as we pull HA from PyPI as well.

I recognised that the issue affects ARMv6 and RISC-V only, as for all other architectures, pre-compiled binaries are shipped by PyPI: https://pypi.org/project/orjson/3.10.12/#files

@jankkhvej
Copy link
Author

Seems to be solved upstream. Can you all retry?

maturin introduced a breaking change here: https://github.com/PyO3/maturin/pull/2391/files Latest orjson explicitly declares the latest functional version before this breaking change as dependency. No long-term solution, I hope it does not imply a dependency version conflict at some point.

Simply retrying, without any changes, results in the same error.
Will try with manual patch and pip install.

@MichaIng MichaIng added the RISC-V All RISC-V platform related label Dec 30, 2024
@MichaIng
Copy link
Owner

MichaIng commented Dec 30, 2024

Yeah, as steals mentiond above, the orjson version dependency in HA is hardcoded. I am currently trying another way, defining the maturin version with an own constraints.txt: #7335

Testing it for RISC-V: https://github.com/MichaIng/DietPi/actions/runs/12546201627

ssheorey added a commit to isl-org/Open3D that referenced this issue Dec 31, 2024
maturin>1.7.8 breaks dependency y-py (Python 3.12) and pywinpty (Python 3.8) wheel building.
MichaIng/DietPi#7329 (comment)
@MichaIng
Copy link
Owner

It seems to work. Can you try on ARMv6?

G_DEV_BRANCH homeassistant
dietpi-software install 157

@MichaIng
Copy link
Owner

Actually also this change in latest maturin from yesterday should have solved it: https://github.com/PyO3/maturin/pull/2417/files
But pinning a version that is assured to be compatible with orjson is still not a bad idea.

@jankkhvej
Copy link
Author

jankkhvej commented Dec 31, 2024

It seems to work. Can you try on ARMv6?

G_DEV_BRANCH homeassistant
dietpi-software install 157

I didn't know about G_DEV_BRANCH, and applied the patch manually. Home Assistant installed successfully, but haven't time to test it yet – RPi Model B is SLOW 🤷🏻‍♂️.

Will retry now according to your recommendations.

@MichaIng
Copy link
Owner

If you applied the patch manually, then it is all good. No need to redo the lengthy build. But can you check the installed maturin version? The logs hide it, as it is a dependency of a dependency only:

sudo -u homeassistant bash
. /home/homeassistant/pyenv-activate.sh
pip3 freeze | grep maturin

@jankkhvej
Copy link
Author

If you applied the patch manually, then it is all good. No need to redo the lengthy build. But can you check the installed maturin version? The logs hide it, as it is a dependency of a dependency only:

After successful installation of HA maturin does not exist in the system:

homeassistant@DietPi:~$ python --version
Python 3.13.1
homeassistant@DietPi:~$ pip3 freeze | grep maturin
homeassistant@DietPi:~$ pip3 freeze | grep json
orjson==3.10.12
homeassistant@DietPi:~$ 

@MichaIng
Copy link
Owner

MichaIng commented Jan 1, 2025

Ah, maybe those build dependencies do not stay in the environment.

MichaIng added a commit that referenced this issue Jan 1, 2025
- DietPi-Software | Home Assistant: Worked around an issue where the installation failed on ARMv6 and RISC-V systems, due to an incompatibility between two dependencies. Many thanks to @jankkhvej for reporting this issue: #7329
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMv6 External bug 🐞 For bugs which are not caused by DietPi. RISC-V All RISC-V platform related Workaround available 🆗 Workaround is available/has been implemented, but a definite solution should be found when possible.
Projects
None yet
5 participants