Coder Social home page Coder Social logo

Comments (10)

deviantintegral avatar deviantintegral commented on August 26, 2024 1

It looks like a new release of the base images was pushed yesterday:

I don't see any pull requests that would obviously fix this, but that would explain why it started working just yesterday. Thanks for following up, and if this comes back again let's go straight to checking the upstream images.

from rtl_433-hass-addons.

deviantintegral avatar deviantintegral commented on August 26, 2024

I just upgraded and rebuilt on my install, and it worked for me. Is it possible there was some sort of networking issue during the pip step?

from rtl_433-hass-addons.

nilsmau avatar nilsmau commented on August 26, 2024

I can't seem to find network issues (pi hole lets everything through - also tested with PiHole disabled).
I restarted Home Assistant OS and still have the same issue.
Bildschirmfoto 2021-11-19 um 08 29 06
.

from rtl_433-hass-addons.

deviantintegral avatar deviantintegral commented on August 26, 2024

Can you reload repositories as there's a new version released - not that it does anything for this issue, but let's at least make sure you're on the latest which is 0.2.1 for the discovery addon.

I just reinstalled on two instances (one on an x64 VM and one on a Raspberry Pi 4) and there were no errors:

21-11-20 11:16:52 INFO (SyncWorker_5) [supervisor.docker.addon] Starting build for 9b13b3f4/armv7-addon-rtl433mqttautodiscovery:0.2.1
21-11-20 11:17:26 INFO (SyncWorker_5) [supervisor.docker.addon] Build 9b13b3f4/armv7-addon-rtl433mqttautodiscovery:0.2.1 done
21-11-20 11:17:26 INFO (MainThread) [supervisor.addons] Add-on '9b13b3f4_rtl433mqttautodiscovery' successfully installed

I see yours says aarch64 - what hardware platform are you running on?

from rtl_433-hass-addons.

deviantintegral avatar deviantintegral commented on August 26, 2024

TIL'ed about cross-platform docker builds.

While I don't have an aarch64 machine to test with, I was able to build the container on my Intel Mac with:

docker build --platform linux/aarch64/v8 --build-arg BUILD_FROM=ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13 .

from rtl_433-hass-addons.

nilsmau avatar nilsmau commented on August 26, 2024

I run it on an Raspi 4... 0.2.1. gives the same error.

[supervisor.docker.addon] Can't build 9b13b3f4/aarch64-addon-rtl433mqttautodiscovery:0.2.1: The command '/bin/ash -o pipefail -c pip install         --no-cache-dir         --prefer-binary         paho-mqtt         && chmod a+x /run.sh' returned a non-zero code: 1
21-11-20 20:51:07 ERROR (SyncWorker_7) [supervisor.docker.addon] Build log: 
Step 1/11 : ARG BUILD_FROM=homeassistant/amd64-base-python:3.9-alpine3.13
Step 2/11 : FROM ${BUILD_FROM}
 ---> 7c0b4c02319e
Step 3/11 : COPY run.sh rtl_433_mqtt_hass.py /
 ---> Using cache
 ---> f7578ca9ad34
Step 4/11 : RUN     pip install         --no-cache-dir         --prefer-binary         paho-mqtt         && chmod a+x /run.sh
 ---> Running in 39e810215d45
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>

    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 10, in <module>

    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>

    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>

    from pip._internal.cli import cmdoptions
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py", line 18, in <module>

    from distutils.util import strtobool
  File "/usr/local/lib/python3.9/distutils/util.py", line 9, in <module>

    import importlib.util
  File "/usr/local/lib/python3.9/importlib/util.py", line 2, in <module>

    from . import abc
  File "/usr/local/lib/python3.9/importlib/abc.py", line 17, in <module>

    from typing import Protocol, runtime_checkable
  File "/usr/local/lib/python3.9/typing.py", line 23, in <module>

    import contextlib
ModuleNotFoundError: No module named 'contextlib'

Removing intermediate container 39e810215d45

Note: I might have installed the add-on at some point in the past, then removed it (restarted the system in between), can you try to uninstall it and then try to install it again. Might be caused by some error in the uninstall procedure...

from rtl_433-hass-addons.

deviantintegral avatar deviantintegral commented on August 26, 2024

I think the long-term solution is to start building out multi-arch images in GitHub actions, so any errors are more easily reproducible, and users don't have to build images when installing. However, there's quite a bit to wire that up looking at some upstream examples.

I checked the docs and it looks like since I set up my RPi4 install the defaults changed from recommending 32-bit to 64-bit installs. That would explain why mine (a 4GB unit too) is running 32-bit while yours is on 64-bit.

Can you check the version of the base image you have? It hasn't been updated in 2 months, but perhaps you have an old one that is broken. The above error is indicating something is quite wrong with python itself (pip isn't even running!), but I'm also not finding any closed issues fixing an issue like this.

$ docker image ls ghcr.io/home-assistant/aarch64-base-python
REPOSITORY                                   TAG              IMAGE ID       CREATED        SIZE
ghcr.io/home-assistant/aarch64-base-python   3.9-alpine3.13   7c0b4c02319e   2 months ago   223MB

Another thought: I'm curious what happens if you build the image directly. To do this, log into the supervisor console and run:

docker build --pull --build-arg BUILD_FROM=ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13 --tag 9b13b3f4/aarch64-addon-rtl433mqttautodiscovery:0.2.1 /mnt/data/supervisor/addons/git/9b13b3f4/rtl_433_mqtt_autodiscovery

Then, you should be able to start the addon without it rebuilding unless it errors out.

from rtl_433-hass-addons.

nilsmau avatar nilsmau commented on August 26, 2024

here is what I get when

# docker image ls ghcr.io/home-assistant/aarch64-base-python
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
#

(nothing)

alternative:

# docker image ls ghcr.io/home-assistant/*
REPOSITORY                                             TAG         IMAGE ID       CREATED        SIZE
ghcr.io/home-assistant/raspberrypi4-64-homeassistant   2021.11.5   273842e74fb2   2 days ago     1.19GB
ghcr.io/home-assistant/aarch64-hassio-supervisor       2021.10.8   4a2518e745b8   3 weeks ago    309MB
ghcr.io/home-assistant/aarch64-hassio-observer         2021.10.0   9c3593efc7e1   5 weeks ago    89.2MB
ghcr.io/home-assistant/aarch64-hassio-cli              2021.09.0   51572dab9b1c   2 months ago   90.4MB
ghcr.io/home-assistant/aarch64-base                    latest      fc4c367ab17d   2 months ago   81.5MB
ghcr.io/home-assistant/aarch64-hassio-audio            2021.07.0   498e10631ab3   3 months ago   112MB
ghcr.io/home-assistant/aarch64-hassio-dns              2021.06.0   905e97a60aaf   5 months ago   104MB
# 

Building the image directly returns an error (the same as when trying to install it via the add-on):

# docker build --pull --build-arg BUILD_FROM=ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13 --tag 9b13b3f4/a
arch64-addon-rtl433mqttautodiscovery:0.2.1 /mnt/data/supervisor/addons/git/9b13b3f4/rtl_433_mqtt_autodiscovery
Sending build context to Docker daemon  49.15kB
Step 1/5 : ARG BUILD_FROM=homeassistant/amd64-base-python:3.9-alpine3.13
Step 2/5 : FROM ${BUILD_FROM}
3.9-alpine3.13: Pulling from home-assistant/aarch64-base-python
Digest: sha256:8f977927789916f209351cb7efaa16a5e0ee9a4f5bb97613f6a1b8839f62d22b
Status: Downloaded newer image for ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13
 ---> 7c0b4c02319e
Step 3/5 : COPY run.sh rtl_433_mqtt_hass.py /
 ---> af2623280cba
Step 4/5 : RUN     pip install         --no-cache-dir         --prefer-binary         paho-mqtt         && chmod a+x /run.sh
 ---> Running in d71dfcaaf1e8
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py", line 18, in <module>
    from distutils.util import strtobool
  File "/usr/local/lib/python3.9/distutils/util.py", line 9, in <module>
    import importlib.util
  File "/usr/local/lib/python3.9/importlib/util.py", line 2, in <module>
    from . import abc
  File "/usr/local/lib/python3.9/importlib/abc.py", line 17, in <module>
    from typing import Protocol, runtime_checkable
  File "/usr/local/lib/python3.9/typing.py", line 23, in <module>
    import contextlib
ModuleNotFoundError: No module named 'contextlib'
The command '/bin/ash -o pipefail -c pip install         --no-cache-dir         --prefer-binary         paho-mqtt         && chmod a+x /run.sh' returned a non-zero code: 1
# 

I have no idea what's happening... as I have no issues installing other Add-Ons - even removing the rtl_433 add-on and reinstalling works.

from rtl_433-hass-addons.

deviantintegral avatar deviantintegral commented on August 26, 2024

I'm so confused! We can even confirm it's the same image ID on Step 2. The only difference is that you're building on real hardware, and I'm building through cross-compilation and emulation. But, it's behaving as if pip doesn't function at all.

DOCKER_BUILDKIT=0 docker build --no-cache --progress plain --platform linux/aarch64 --pull --build-arg BUILD_FROM=ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13 .
Sending build context to Docker daemon  49.15kB
Step 1/5 : ARG BUILD_FROM=homeassistant/amd64-base-python:3.9-alpine3.13
Step 2/5 : FROM ${BUILD_FROM}
3.9-alpine3.13: Pulling from home-assistant/aarch64-base-python
Digest: sha256:8f977927789916f209351cb7efaa16a5e0ee9a4f5bb97613f6a1b8839f62d22b
Status: Image is up to date for ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13
 ---> 7c0b4c02319e
Step 3/5 : COPY run.sh rtl_433_mqtt_hass.py /
 ---> f9efb89f4f7a
Step 4/5 : RUN     pip install         --no-cache-dir         --prefer-binary         paho-mqtt         && chmod a+x /run.sh
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in d4468ba29932
Collecting paho-mqtt
  Downloading paho-mqtt-1.6.1.tar.gz (99 kB)
Building wheels for collected packages: paho-mqtt
  Building wheel for paho-mqtt (setup.py): started
  Building wheel for paho-mqtt (setup.py): finished with status 'done'
  Created wheel for paho-mqtt: filename=paho_mqtt-1.6.1-py3-none-any.whl size=62133 sha256=98052a1f2ef7fb526ee282053d9b95212dac0ca08418738554ca245e3e8c0c4b
  Stored in directory: /tmp/pip-ephem-wheel-cache-kwnshlrl/wheels/0f/90/29/db29bb8ddc98ec5f2363b959130c9ddbcf5cfdb4a00b6184dd
Successfully built paho-mqtt
Installing collected packages: paho-mqtt
Successfully installed paho-mqtt-1.6.1
WARNING: You are using pip version 20.2.4; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Removing intermediate container d4468ba29932
 ---> 2bf068562455
Step 5/5 : CMD [ "/run.sh" ]
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in 996000f74ded
Removing intermediate container 996000f74ded
 ---> 18c595a3aa1c
Successfully built 18c595a3aa1c

Since I don't (yet) have GitHub wired up for packages, I pushed a container to https://hub.docker.com/layers/178713863/andrewberry/rtl_433_mqtt_autodiscovery/0.1/images/sha256-c987c173186157cdd4ebc88c6df17319142605135c12f6f600e3b3b06558a874?context=repo. Are you able to pull it and run it?

Actually, perhaps even better: let's see if pip is broken in the base image. If so, we can report upstream, and get more eyes on this:

docker run --rm -it ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13 pip
# If pip shows the help message, try this.
docker run --rm -it ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13 pip install paho-mqtt

from rtl_433-hass-addons.

nilsmau avatar nilsmau commented on August 26, 2024

@deviantintegral

I ran this:

# docker run --rm -it ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.13 
pip


[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py", line 18, in <module>
    from distutils.util import strtobool
  File "/usr/local/lib/python3.9/distutils/util.py", line 9, in <module>
    import importlib.util
  File "/usr/local/lib/python3.9/importlib/util.py", line 2, in <module>
    from . import abc
  File "/usr/local/lib/python3.9/importlib/abc.py", line 17, in <module>
    from typing import Protocol, runtime_checkable
  File "/usr/local/lib/python3.9/typing.py", line 23, in <module>
    import contextlib
ModuleNotFoundError: No module named 'contextlib'
[cmd] pip exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

The this

# docker images
REPOSITORY                                             TAG              IMAGE ID       CREATED         SIZE
<none>                                                 <none>           af2623280cba   18 hours ago    223MB
9b13b3f4/aarch64-addon-rtl433                          0.1.2            84b9adaa2552   2 days ago      82.7MB
ghcr.io/home-assistant/raspberrypi4-64-homeassistant   2021.11.5        273842e74fb2   3 days ago      1.19GB
<none>                                                 <none>           f7578ca9ad34   4 days ago      223MB
ghcr.io/esphome/esphome-hassio-aarch64                 2021.11.1        b4e9938feb7f   6 days ago      309MB
homeassistant/aarch64-addon-zwave_js                   0.1.48           0aa65a1f4c37   6 days ago      193MB
<none>                                                 <none>           f7af03f4261d   6 days ago      347MB
<none>                                                 <none>           3659106438c8   6 days ago      223MB
<none>                                                 <none>           efb542ea807f   6 days ago      347MB
a844d815/aarch64-addon-rtl4332mqtt                     0.2              66e770bb3b01   6 days ago      83.4MB
1e14b3fb/aarch64-addon-portainer                       1.5.2.2          e187402d0142   6 days ago      95.6MB
ghcr.io/hassio-addons/grafana/aarch64                  7.3.1            7f31c4fb658e   9 days ago      503MB
techblog/broadlinkmanager                              latest           544732631fd4   3 weeks ago     486MB
homeassistant/aarch64-hassio-supervisor                2021.10.8        4a2518e745b8   3 weeks ago     309MB
homeassistant/aarch64-hassio-supervisor                latest           4a2518e745b8   3 weeks ago     309MB
ghcr.io/home-assistant/aarch64-hassio-supervisor       2021.10.8        4a2518e745b8   3 weeks ago     309MB
ghcr.io/home-assistant/aarch64-hassio-observer         2021.10.0        9c3593efc7e1   5 weeks ago     89.2MB
homeassistant/aarch64-addon-ssh                        9.2.1            5f289d8b439f   8 weeks ago     156MB
homeassistant/aarch64-addon-check_config               3.9.0            c1f6c8c23480   8 weeks ago     346MB
ghcr.io/home-assistant/aarch64-hassio-cli              2021.09.0        51572dab9b1c   2 months ago    90.4MB
homeassistant/aarch64-base-python                      3.9-alpine3.13   7c0b4c02319e   2 months ago    223MB
ghcr.io/home-assistant/aarch64-base-python             3.9-alpine3.13   7c0b4c02319e   2 months ago    223MB
ghcr.io/home-assistant/aarch64-base                    latest           fc4c367ab17d   2 months ago    81.5MB
thomasmauerer/samba-backup-aarch64                     5.0.0            ca8ab8708bf1   2 months ago    121MB
homeassistant/aarch64-addon-deconz                     6.10.0           cf58f7ff9f73   3 months ago    475MB
ghcr.io/hassio-addons/base/aarch64                     10.0.1           77db0d03c09e   3 months ago    27.5MB
ghcr.io/home-assistant/aarch64-hassio-audio            2021.07.0        498e10631ab3   4 months ago    112MB
homeassistant/aarch64-addon-configurator               5.3.3            5741c517ba1b   4 months ago    161MB
ghcr.io/poeschl/ha-pigpio-aarch64                      1.4.0            e3d0453ba7d1   4 months ago    99MB
ghcr.io/home-assistant/aarch64-hassio-dns              2021.06.0        905e97a60aaf   5 months ago    104MB
homeassistant/aarch64-addon-samba                      9.5.1            c39dcb33ff09   5 months ago    123MB
homeassistant/aarch64-addon-mosquitto                  6.0.1            f02179bf5d63   6 months ago    90.3MB
homeassistant/aarch64-hassio-multicast                 2021.04.0        fb5813d2b553   7 months ago    88.3MB
pihole/pihole                                          latest           ddcd770c6633   11 months ago   387MB
oznu/homebridge                                        raspberry-pi     34b9988953a6   13 months ago   558MB

and i saw:

homeassistant/aarch64-base-python                      3.9-alpine3.13   7c0b4c02319e   2 months ago    223MB
ghcr.io/home-assistant/aarch64-base-python             3.9-alpine3.13   7c0b4c02319e   2 months ago    223MB

in the list, went to the Add-On Store and tried to install the Autodiscovery Add-On. And for whatever reason it did install.
I don't understand it, but hey, it works.

So, thank you! Do you want to close the issue, or shall I?

from rtl_433-hass-addons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.