alex3305 / home-assistant-addons

Alex's Home Assistant Add-ons
https://alex3305.github.io/home-assistant-docs/
MIT License
47 stars 29 forks source link

Traefik addon will not install on supervised HA (ARM architecture) #35

Closed Haifirion closed 2 years ago

Haifirion commented 2 years ago

Hi Alex, When I try to install the addon, I get:

Add-on konnte nicht installiert werden The command '/bin/ash -o pipefail -c if [ "${BUILD_ARCH}" == "aarch64" ]; then BUILD_ARCH=arm64; elif [ "${BUILD_ARCH}" == "i386" ]; then BUILD_ARCH=386; elif [ "${BUILD_ARCH}" == "armhf" ]; then BUILD_ARCH=armv7; fi && apk add --no-cache nginx gomplate && wget --quiet -O /tmp/traefik.tar.gz "https://github.com/traefik/traefik/releases/download/v${TRAEFIK_VERSION}/traefik_v${TRAEFIK_VERSION}_linux_${BUILD_ARCH}.tar.gz" && tar xzvf /tmp/traefik.tar.gz -C /usr/local/bin traefik && chmod +x /usr/local/bin/traefik && rm -f /tmp/*' returned a non-zero code: 2

Any Ideas?

Best Regards Haifi

alex3305 commented 2 years ago

Hi Haifi,

Thank you for reporting this issue. Can you elaborate on what platform you are trying to install Traefik? It seems that you are unable to download Traefik or the install times out or something. Is your platform and internet speed fast enough?

@leakypixel Do you still use this add-on and/or are you having any issues with it?

Haifirion commented 2 years ago

The machine is an Odroid hc1 with a supervised HA installation running on armbian (the scripted install, where HomeAssistant itself creates several docker containers, like hassio_core, hassio_supervisor, hassio_audio and so on). I can wget something to the host, it works without problems. Npm and node.js is installed on the host.

Haifirion commented 2 years ago

I can wget the file traefik_v2.6.6_linux_armv7.tar.gz manually to the host. Maybe the environment selction in your script does not work on my machine?

Haifirion commented 2 years ago

I have no problems with addons from the public or community store, plus I'm using the hacs addon repo without issues. There should be no general misconfigurations on my side.

alex3305 commented 2 years ago

Hi Haifi,

I'm currently at a loss here. Unfortunately I have no platform to test this on. However, could you provide me with your System Architecture? You can find this in System Health:

System Health

Additionally, if you are comfortable with Docker and CLI you could also try this:

docker run --rm -it --name test_traefik alpine /bin/sh
apk add --no-cache nginx gomplate

This way we can also check if those packages are supported on your platform. If they are, then something is probably wrong with the download. But I need your System Architecture to test this.

Thanks again for your quick and extensive response ❤️

Haifirion commented 2 years ago

System Health

version core-2022.5.4
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.9
os_name Linux
os_version 4.14.222-odroidxu4
arch armv7l
timezone Europe/Berlin
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.24.5 Stage | running Available Repositories | 1129 Downloaded Repositories | 17
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Armbian 21.05.6 Buster -- | -- update_channel | stable supervisor_version | supervisor-2022.05.2 docker_version | 20.10.7 disk_total | 109.5 GB disk_used | 14.9 GB healthy | true supported | failed to load: Unsupported supervisor_api | ok version_api | ok installed_addons | TasmoAdmin (0.17.0), Mosquitto broker (6.1.2), Node-RED (11.1.2), Terminal & SSH (9.4.0), Duck DNS (1.14.0), Vaultwarden (Bitwarden) (0.16.0), ESPHome (2022.5.0)
Dashboards dashboards | 4 -- | -- resources | 10 views | 11 mode | storage
leakypixel commented 2 years ago

Hi Haifi,

Thank you for reporting this issue. Can you elaborate on what platform you are trying to install Traefik? It seems that you are unable to download Traefik or the install times out or something. Is your platform and internet speed fast enough?

@leakypixel Do you still use this add-on and/or are you having any issues with it?

I don't have any issues running on a raspberry pi with the standard HA image, but I'll take a look in the next 48h and see if I can replicate and take a look :)

Sorry for the delayed response, I've been AFK for a week or two!

Haifirion commented 2 years ago

OK, I figured out some things. After using your

docker run --rm -it --name test_traefik alpine /bin/sh apk add --no-cache nginx gomplate

Alpine latest (3.15) docker container was up, but apk add would throw:

fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/armv7/APKINDEX.tar.gz WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/main: temporary error (try again later) fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/armv7/APKINDEX.tar.gz WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/community: temporary error (try again later) ERROR: unable to select packages: gomplate (no such package): required by: world[gomplate] nginx (no such package): required by: world[nginx]

Searching for the warnings on google, yielded some hits.

https://github.com/alpinelinux/docker-alpine/issues/135

By setting the Alpine version manually to 3.12.3, the container has access to CDN and the apk commands work.

docker run --rm -it --name test_traefik alpine:3.12.3 /bin/sh Unable to find image 'alpine:3.12.3' locally 3.12.3: Pulling from library/alpine c58e8a26a840: Pull complete Digest: sha256:3c7497bf0c7af93428242d6176e8f7905f2201d8fc5861f45be7a346b5f23436 Status: Downloaded newer image for alpine:3.12.3 / # apk add --no-cache nginx gomplate fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/armv7/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/armv7/APKINDEX.tar.gz (1/4) Installing ca-certificates (20211220-r0) (2/4) Installing gomplate (3.7.0-r0) (3/4) Installing pcre (8.44-r0) (4/4) Installing nginx (1.18.0-r3) Executing nginx-1.18.0-r3.pre-install Executing busybox-1.31.1-r19.trigger Executing ca-certificates-20211220-r0.trigger OK: 43 MiB in 18 packages

Haifirion commented 2 years ago

I guess network in Alpine:latest is somehow bugged on armv7. So I need to use an earlier version for the time being.

Haifirion commented 2 years ago

How would I change your dockerfile to fetch a different Alpine version? I've forked your repo and could do the changes there, so you dont have to hassle with 2 versions.

Haifirion commented 2 years ago

Okay, what a journey. I finally got the addon running. After hours of shimmying from forum post to man-page and back, I solved the problem by making a full backup, and setting up a new supervised install on debian 11 for arm. Debian 10 based installs on arm are not supported anymore. The last seccomp package you can get, is version 2.3.3-4 and for any new alpine dockers you need at least version 2.4. Hope this helps, in case of anyone running into the same wall.