thomasfr / hass-addons

MIT License
14 stars 25 forks source link

Install Issues #13

Open wabit opened 9 months ago

wabit commented 9 months ago

The S3 integration has worked previously in the past but recently i noticed it wasnt running and had been removed.

When i go to install it again i get the following error:

The command '/bin/ash -o pipefail -c apk add -v --update --no-cache python3 py3-pip groff less jq && pip3 install --upgrade awscli' returned a non-zero code: 1

dral3x commented 9 months ago

Same

matheusmaximo commented 9 months ago

I have this same issue. Is there a way to debug?

dral3x commented 9 months ago

Usually, this problem is related to the inability to fetch the docker images needed to build the addon. The only way out is building the add-on on the cloud instead of the local machine. This is exactly what I did with my fork of this add-ons https://github.com/dral3x/ha-addons

Please give it a try @matheusmaximo @wabit and let me know if that solves the issue for you

mennis commented 9 months ago

It builds and I launch the BUILDFROM image and can run the steps locally.

% docker run homeassistant/aarch64-base:latest  -it /bin/ash  
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
s6-rc: info: service legacy-services successfully started
/run/s6/basedir/scripts/rc.init: line 76: -it: not found
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
^Cs6-linux-init-shutdown: fatal: unable to talk to shutdownd: Operation not permitted
src/hass-addons  % docker run -it homeassistant/aarch64-base:latest  /bin/ash 
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
s6-rc: info: service legacy-services successfully started
/ # apk add -v --update --no-cache
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/aarch64/APKINDEX.tar.gz
OK: 42 packages, 171 dirs, 1645 files, 35 MiB
/ # apk add -v --update --no-cache \
>         python3 \
>         py3-pip \
>         groff \
>         less \
>         jq \
>         && \
>     pip3 install --upgrade awscli
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/aarch64/APKINDEX.tar.gz
(1/23) Installing libgcc (12.2.1_git20220924-r10)
(2/23) Installing libstdc++ (12.2.1_git20220924-r10)
(3/23) Installing groff (1.22.4-r4)
(4/23) Installing less (633-r0)
(5/23) Installing libbz2 (1.0.8-r5)
(6/23) Installing libexpat (2.5.0-r1)
(7/23) Installing libffi (3.4.4-r2)
(8/23) Installing gdbm (1.23-r1)
(9/23) Installing mpdecimal (2.5.1-r2)
(10/23) Installing libpanelw (6.4_p20230506-r0)
(11/23) Installing sqlite-libs (3.41.2-r2)
(12/23) Installing python3 (3.11.6-r0)
(13/23) Installing python3-pycache-pyc0 (3.11.6-r0)
(14/23) Installing pyc (0.1-r0)
(15/23) Installing py3-setuptools-pyc (67.7.2-r0)
(16/23) Installing py3-pip-pyc (23.1.2-r0)
(17/23) Installing py3-parsing (3.0.9-r2)
(18/23) Installing py3-parsing-pyc (3.0.9-r2)
(19/23) Installing py3-packaging-pyc (23.1-r1)
(20/23) Installing python3-pyc (3.11.6-r0)
(21/23) Installing py3-packaging (23.1-r1)
(22/23) Installing py3-setuptools (67.7.2-r0)
(23/23) Installing py3-pip (23.1.2-r0)
Executing busybox-1.36.0-r9.trigger
OK: 65 packages, 476 dirs, 5017 files, 116 MiB
Collecting awscli
  Downloading awscli-1.32.3-py3-none-any.whl (4.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.3/4.3 MB 5.2 MB/s eta 0:00:00
Collecting botocore==1.34.3 (from awscli)
  Downloading botocore-1.34.3-py3-none-any.whl (11.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.8/11.8 MB 4.5 MB/s eta 0:00:00
Collecting docutils<0.17,>=0.10 (from awscli)
  Downloading docutils-0.16-py2.py3-none-any.whl (548 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 548.2/548.2 kB 2.8 MB/s eta 0:00:00
Collecting s3transfer<0.10.0,>=0.9.0 (from awscli)
  Downloading s3transfer-0.9.0-py3-none-any.whl (82 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.0/82.0 kB 2.3 MB/s eta 0:00:00
Collecting PyYAML<6.1,>=3.10 (from awscli)
  Downloading PyYAML-6.0.1.tar.gz (125 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.2/125.2 kB 1.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting colorama<0.4.5,>=0.2.5 (from awscli)
  Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting rsa<4.8,>=3.1.2 (from awscli)
  Downloading rsa-4.7.2-py3-none-any.whl (34 kB)
Collecting jmespath<2.0.0,>=0.7.1 (from botocore==1.34.3->awscli)
  Downloading jmespath-1.0.1-py3-none-any.whl (20 kB)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.34.3->awscli)
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 2.6 MB/s eta 0:00:00
Collecting urllib3<2.1,>=1.25.4 (from botocore==1.34.3->awscli)
  Downloading urllib3-2.0.7-py3-none-any.whl (124 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.2/124.2 kB 1.8 MB/s eta 0:00:00
Collecting pyasn1>=0.1.3 (from rsa<4.8,>=3.1.2->awscli)
  Downloading pyasn1-0.5.1-py2.py3-none-any.whl (84 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.9/84.9 kB 2.7 MB/s eta 0:00:00
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.34.3->awscli)
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: PyYAML
  Building wheel for PyYAML (pyproject.toml) ... done
  Created wheel for PyYAML: filename=PyYAML-6.0.1-cp311-cp311-linux_aarch64.whl size=45364 sha256=bed78b6b77b9284160b84491f2f9e8036f93e72955e08bcbdebb3ee5be8922bb
  Stored in directory: /root/.cache/pip/wheels/20/40/04/9edd5f1052f28aff139c0b315b3d5ad7ba893c93ccde03f1b4
Successfully built PyYAML
Installing collected packages: urllib3, six, PyYAML, pyasn1, jmespath, docutils, colorama, rsa, python-dateutil, botocore, s3transfer, awscli
Successfully installed PyYAML-6.0.1 awscli-1.32.3 botocore-1.34.3 colorama-0.4.4 docutils-0.16 jmespath-1.0.1 pyasn1-0.5.1 python-dateutil-2.8.2 rsa-4.7.2 s3transfer-0.9.0 six-1.16.0 urllib3-2.0.7
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
 # echo $?
0

I went through and checked that each dependency could be installed by apk by editing the Dockerfile to incrementally add items from the list. They all succeeded. I understand that there may be an issue using multiple RUN statements, something to do with caching, but I don't really understand that. I decided then to try adding the aws-cli apk package and that seemed to install and run but I don't have my credentials configured and I am out of time. Working Dockerfile inline.

ARG BUILD_FROM
FROM ${BUILD_FROM}

ENV LANG C.UTF-8

COPY run.sh /
RUN chmod a+x /run.sh

# add aws-cli and deps
RUN apk add -v --update --no-cache python3 py3-pip groff less jq aws-cli

CMD [ "/run.sh" ]
dral3x commented 9 months ago

During my tests, on several instances of HA, I got the following results:

Why? I've no idea

fm4991 commented 7 months ago

same problem here image

dral3x commented 7 months ago

@fm4991 give it a try to the addon in my repo https://github.com/dral3x/ha-addons