Skons / hassio-addons

7 stars 4 forks source link

Error on install #55

Closed sga-noud closed 7 months ago

sga-noud commented 1 year ago

When trying to install on my RPi 3B+, I get this error (which looks to be similar, but not quite the same as #51):

The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies tesseract-ocr tesseract-ocr-dev jpeg-dev libjpeg zlib-dev gcc libc-dev' returned a non-zero code: 3

Home Assistant 2023.7.3 Supervisor 2023.08.3 Operating System 9.5 Frontend-versie: 20230705.1 - latest

Skons commented 11 months ago

I can't reproduce this error. Can you go to Settings -> System -> Logs. Select supervisor at the top right and show the error that is probably there?

sga-noud commented 11 months ago

Thanks for your reply. I hit the install button again, got the same error, and then checked the logs:

23-09-22 00:16:22 INFO (MainThread) [supervisor.host.apparmor] Adding/updating AppArmor profile: f5a8083e_dutch_gas_prices
23-09-22 00:16:23 INFO (MainThread) [supervisor.docker.addon] Starting build for f5a8083e/armv7-addon-dutch_gas_prices:2023.8.11.1
23-09-22 00:17:03 ERROR (MainThread) [supervisor.docker.addon] Can't build f5a8083e/armv7-addon-dutch_gas_prices:2023.8.11.1: The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies         tesseract-ocr         tesseract-ocr-dev         jpeg-dev         libjpeg         zlib-dev         gcc         libc-dev' returned a non-zero code: 3
23-09-22 00:17:03 ERROR (MainThread) [supervisor.docker.addon] Build log: 
Step 1/28 : ARG BUILD_FROM=ghcr.io/hassio-addons/base-python/amd64:11.0.4
Step 2/28 : FROM ${BUILD_FROM}
 ---> a4412077faa9
Step 3/28 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 ---> Using cache
 ---> 8c7f8bdac75c
Step 4/28 : ARG BUILD_ARCH=amd64
 ---> Using cache
 ---> d2aa756ce087
Step 5/28 : COPY rootfs/app /app
 ---> Using cache
 ---> 7a1e60ab2ee3
Step 6/28 : COPY rootfs/run.sh /
 ---> Using cache
 ---> c657a3fb9cbb
Step 7/28 : RUN     apk add --no-cache --virtual .build-dependencies         tesseract-ocr         tesseract-ocr-dev         jpeg-dev         libjpeg         zlib-dev         gcc         libc-dev
 ---> Running in c2b0597af388
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/armv7/APKINDEX.tar.gz
ERROR: unable to select packages:

  .build-dependencies-20230921.221701:

    masked in:
 cache

    satisfies:
 world[.build-dependencies=20230921.221701]

  tesseract-ocr (no such package):

    required by:
 .build-dependencies-20230921.221701[tesseract-ocr]

  tesseract-ocr-dev (no such package):

    required by:
 .build-dependencies-20230921.221701[tesseract-ocr-dev]

Removing intermediate container c2b0597af388
Skons commented 11 months ago

Your error indicates that packages can not be found. I do not have an rpi lying around so i cant test, but my arm device is just perfectly installing those packages. I do not know why those package arent being installed. The least i could do is update the base image for my addon to the latest version. Can you test if that image solves your problem?

Skons commented 11 months ago

My fix isn't going to cut it. The problem is that tesseract is missing in the 3.18 armv7 repo and i am not able to add it there. The fix that i have is to add the older 3.17 repo to see if that will fix the problem. Can you follow these steps to test my hypotheses? https://github.com/Skons/hassio-addons/issues/50#issuecomment-1673685327

If you can, then please edit the Docker file and add the following instead of #install packages

#install packages
ARG TARGETARCH
RUN arch=$TARGETARCH \
    && if [ "$TARGETARCH" = "armv7" ]; then RUN apk add --repository https://dl-cdn.alpinelinux.org/alpine/v3.17/community/armv7/ tesseract; fi
sga-noud commented 11 months ago

Sorry, I don’t have Samba share or VS code installed and I’m not experienced enough to fiddle around with the terminal/SSH to get the folder in the \addons directory. With File Editor I can only edit \config directory…

Skons commented 11 months ago

I just released a dev addon that you could check out if that solves your problem: https://github.com/Skons/hassio-addons/tree/main/dutch_gas_prices_dev

If it is not visible, hit the check for updates button and hit f5 to see the changes in the addons list. image

Please let me know if this one works.

sga-noud commented 11 months ago

Thanks for helping me out :)

Unfortunately I get the same error (I think) when installing: The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies tesseract-ocr tesseract-ocr-dev jpeg-dev libjpeg zlib-dev gcc libc-dev' returned a non-zero code: 3

And in supervisor logs the error looks to be the same as well:

23-10-06 10:05:48 INFO (MainThread) [supervisor.host.apparmor] Adding/updating AppArmor profile: f5a8083e_dutch_gas_prices_dev
23-10-06 10:05:49 INFO (MainThread) [supervisor.docker.addon] Starting build for f5a8083e/armv7-addon-dutch_gas_prices_dev:2023.10.2.1
23-10-06 10:06:20 ERROR (MainThread) [supervisor.docker.addon] Can't build f5a8083e/armv7-addon-dutch_gas_prices_dev:2023.10.2.1: The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies         tesseract-ocr         tesseract-ocr-dev         jpeg-dev         libjpeg         zlib-dev         gcc         libc-dev' returned a non-zero code: 3
23-10-06 10:06:20 ERROR (MainThread) [supervisor.docker.addon] Build log: 
Step 1/28 : ARG BUILD_FROM=ghcr.io/hassio-addons/base-python/amd64:11.0.5
Step 2/28 : FROM ${BUILD_FROM}
 ---> de2147b393fa
Step 3/28 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 ---> Using cache
 ---> 682661bea0dd
Step 4/28 : ARG BUILD_ARCH=amd64
 ---> Using cache
 ---> 1eacc4c609f1
Step 5/28 : COPY rootfs/app /app
 ---> Using cache
 ---> 8733144bf47d
Step 6/28 : COPY rootfs/run.sh /
 ---> Using cache
 ---> 2fd7ef626020
Step 7/28 : RUN     apk add --no-cache --virtual .build-dependencies         tesseract-ocr         tesseract-ocr-dev         jpeg-dev         libjpeg         zlib-dev         gcc         libc-dev
 ---> Running in 42eec729476f
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/armv7/APKINDEX.tar.gz
ERROR: unable to select packages:

  .build-dependencies-20231006.080618:
    masked in: cache
    satisfies: world[.build-dependencies=20231006.080618]
  tesseract-ocr (no such package):
    required by: .build-dependencies-20231006.080618[tesseract-ocr]
  tesseract-ocr-dev (no such package):
    required by: .build-dependencies-20231006.080618[tesseract-ocr-dev]

Removing intermediate container 42eec729476f
Skons commented 11 months ago

Well, if i release a dev addon, but i do not add the dev code, then don’t expect anything to be changed. Sorry for taking tour time, will let you know when the correct one is available. Thanks for letting me spoil your time 🫣

Skons commented 11 months ago

Just released an updated version for the production addon, please check it out. I have tested it here with an rpi3, so it should work. Please let me know

sga-noud commented 11 months ago

Thanks for your hard work thus far. I wish I had better news, but installation failed with error 'f5a8083e_dutch_gas_prices'

I believe the log on this is longer than it is able to show. This is the chunk that shows:

WARNING: 
opening from cache https://dl-cdn.alpinelinux.org/alpine/v3.18/main: No such file or directory

WARNING: opening from cache https://dl-cdn.alpinelinux.org/alpine/v3.18/community: No such file or directory

World updated, but the following packages are not removed due to:
  musl: apk-tools .python-rundeps bash curl
        busybox alpine-baselayout musl-utils
        libc-utils jq libcrypto3 libssl3
OK: 17 MiB in 48 packages
Removing intermediate container 025276273e81
 ---> 0d5fb42903a0
Step 8/31 : ARG TARGETARCH
 ---> Running in 0b2dbc162c1e
Removing intermediate container 0b2dbc162c1e
 ---> b573a58b1715
Step 9/31 : RUN arch=$TARGETARCH     && if [ "$TARGETARCH" = "armv7" ]; then RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.17/community' >> /etc/apk/repositories; fi
 ---> Running in 661dd0898c4c
Removing intermediate container 661dd0898c4c
 ---> 9c1bf0f8afe6
Step 10/31 : RUN     apk add --no-cache --virtual .build-dependencies         tesseract-ocr         tesseract-ocr-dev         jpeg-dev         libjpeg         zlib-dev         gcc         libc-dev
 ---> Running in 9c63047c5d7f
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/armv7/APKINDEX.tar.gz
ERROR: 
unable to select packages:

  .build-dependencies-20231016.183145:
    masked in:
 cache

    satisfies:
 world[.build-dependencies=20231016.183145]

  tesseract-ocr (no such package):

    required by:
 .build-dependencies-20231016.183145[tesseract-ocr]

  tesseract-ocr-dev (no such package):

    required by:
 .build-dependencies-20231016.183145[tesseract-ocr-dev]

Removing intermediate container 9c63047c5d7f

23-10-16 20:31:48 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'f5a8083e_dutch_gas_prices'
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 625, in _build
    image, log = await self.sys_run_in_executor(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/docker/models/images.py", line 306, in build
    raise BuildError(chunk['error'], result_stream)
docker.errors.BuildError: The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies         tesseract-ocr         tesseract-ocr-dev         jpeg-dev         libjpeg         zlib-dev         gcc         libc-dev' returned a non-zero code: 3
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 274, in wrapper
    return await self._method(obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 612, in install
    await self._build(version)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 637, in _build
    _LOGGER.error("Can't build %s:%s: %s", self.image, version, err)
                                           ^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 90, in image
    return self.addon.image
           ^^^^^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 434, in image
    return self.persist.get(ATTR_IMAGE)
           ^^^^^^^^^^^^
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 205, in persist
    return self.sys_addons.data.user[self.slug]
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'f5a8083e_dutch_gas_prices'

Looks like error code 3 again with another exception this time.

When I tried again, I got the original error again, with the following log:

world[.build-dependencies=20231016.183832]

  tesseract-ocr (no such package):

    required by:
 .build-dependencies-20231016.183832[tesseract-ocr]

  tesseract-ocr-dev (no such package):

    required by:
 .build-dependencies-20231016.183832[tesseract-ocr-dev]

Removing intermediate container b3729779a4a4

23-10-16 20:38:47 INFO (MainThread) [supervisor.jobs] 'MountManager.reload' blocked from execution, mounting not supported on system
23-10-16 20:39:13 INFO (MainThread) [supervisor.host.apparmor] Adding/updating AppArmor profile: f5a8083e_dutch_gas_prices
23-10-16 20:39:13 INFO (MainThread) [supervisor.docker.addon] Starting build for f5a8083e/armv7-addon-dutch_gas_prices:2023.10.15.1
23-10-16 20:39:25 ERROR (MainThread) [supervisor.docker.addon] Can't build f5a8083e/armv7-addon-dutch_gas_prices:2023.10.15.1: The command '/bin/bash -o pipefail -c apk add --no-cache --virtual .build-dependencies         tesseract-ocr         tesseract-ocr-dev         jpeg-dev         libjpeg         zlib-dev         gcc         libc-dev' returned a non-zero code: 3
23-10-16 20:39:25 ERROR (MainThread) [supervisor.docker.addon] Build log: 
Step 1/31 : ARG BUILD_FROM=ghcr.io/hassio-addons/base-python/amd64:11.0.6
Step 2/31 : FROM ${BUILD_FROM}
 ---> 48faa76e7942
Step 3/31 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 ---> Using cache
 ---> af21c1e65d28
Step 4/31 : ARG BUILD_ARCH=amd64
 ---> Using cache
 ---> 4cea182fb71e
Step 5/31 : COPY rootfs/app /app
 ---> Using cache
 ---> 282d1fee228f
Step 6/31 : COPY rootfs/run.sh /
 ---> Using cache
 ---> d64f0fa5cf98
Step 7/31 : RUN     apk del musl
 ---> Using cache
 ---> 0d5fb42903a0
Step 8/31 : ARG TARGETARCH
 ---> Using cache
 ---> b573a58b1715
Step 9/31 : RUN arch=$TARGETARCH     && if [ "$TARGETARCH" = "armv7" ]; then RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.17/community' >> /etc/apk/repositories; fi
 ---> Using cache
 ---> 9c1bf0f8afe6
Step 10/31 : RUN     apk add --no-cache --virtual .build-dependencies         tesseract-ocr         tesseract-ocr-dev         jpeg-dev         libjpeg         zlib-dev         gcc         libc-dev
 ---> Running in ffcc9d867857
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/armv7/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/armv7/APKINDEX.tar.gz
ERROR: unable to select packages:

  .build-dependencies-20231016.183924:
    masked in: cache
    satisfies: world[.build-dependencies=20231016.183924]
  tesseract-ocr (no such package):
    required by: .build-dependencies-20231016.183924[tesseract-ocr]
  tesseract-ocr-dev (no such package):
    required by: .build-dependencies-20231016.183924[tesseract-ocr-dev]

Removing intermediate container ffcc9d867857

Any ideas?

Skons commented 11 months ago

Which addon did you install?

edit: it’s visible at the top of your post. What version did you try to install?

edit2: i get my answer at step 9/31.

how is this possible? My rpi3 did not have any issue installing this addon 🤔. The difference maybe is that my rpi installation was fresh. What ha version are you running? And what is the version of your ha os?

sga-noud commented 11 months ago

Home Assistant 2023.7.3 Supervisor 2023.10.0 Operating System 9.5 Frontend-versie: 20230705.1 - latest

I too am wondering if it’s just that my installation isn’t fresh. But I don’t think I’ll try reinstalling my whole HA just to find that out. So if we can’t find the solution in another way, so be it 🥲

Skons commented 7 months ago

I have just released an update that maybe solves your problem, could you try that latest version?

sga-noud commented 7 months ago

Yes, it works now! Installed without issues. Just tried getting euro95 info from my favorite gas station and it works flawlessly. Thanks! 🙏