Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Error when running docker on armhf architecture #85

Open
xiiran opened this issue Aug 31, 2022 · 6 comments
Open

Error when running docker on armhf architecture #85

xiiran opened this issue Aug 31, 2022 · 6 comments

Comments

@xiiran
Copy link

xiiran commented Aug 31, 2022

Hello,
I tried to build and run the docker container on my Rasberry Pi 4 with armhf architecture, I used the latest tagged version 2022.05.0. When running the container, an error occurs. I also tried it with the penultimate tagged version 2021.12.0 and it is running without problems.

The container output is as follows:

[email protected] start
node app.js

/app/node_modules/@napi-rs/canvas/js-binding.js:193
    throw loadError
    ^

Error: Error loading shared library ld-linux-armhf.so.3: No such file or directory (needed by /app/node_modules/@napi-rs/canvas-linux-arm-gnueabihf/skia.linux-arm-gnueabihf.node)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1210:18)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/app/node_modules/@napi-rs/canvas/js-binding.js:177:29)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12) {
  code: 'ERR_DLOPEN_FAILED'
}
@Guus-H
Copy link

Guus-H commented Sep 3, 2022

I have exactly the same issue, this errors appears every two seconds in the logs:

Node.js v18.6.0
[15:35:02] INFO: Setup config
[15:35:02] INFO: Start ICantBelieveItsNotValetudo
/app/node_modules/@napi-rs/canvas/js-binding.js:193
    throw loadError
    ^

Error: Error loading shared library ld-linux-armhf.so.3: No such file or directory (needed by /app/node_modules/@napi-rs/canvas-linux-arm-gnueabihf/skia.linux-arm-gnueabihf.node)
    at Module._extensions..node (node:internal/modules/cjs/loader:1204:18)
    at Module.load (node:internal/modules/cjs/loader:998:32)
    at Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1022:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/app/node_modules/@napi-rs/canvas/js-binding.js:177:29)
    at Module._compile (node:internal/modules/cjs/loader:1120:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
    at Module.load (node:internal/modules/cjs/loader:998:32)
    at Module._load (node:internal/modules/cjs/loader:839:12) {
  code: 'ERR_DLOPEN_FAILED'
}

@Poeschl
Copy link
Contributor

Poeschl commented Sep 12, 2022

Tried to solve this issue now on two evenings but no luck.
It seems to me that the napi-rs don't support a armhf architecture. 😐

@MrSolo570
Copy link

Hello I am running ICBINV as addon within Home Assistant on a Raspberry Pi 4.
Does this mean I should not Update to the latest version as the container might not be able to start anymore?

@Poeschl
Copy link
Contributor

Poeschl commented Nov 14, 2022

@MrSolo570 It depends on the image you installed on your Pi. I'm running my Pi4 on the armv7 architecture.

To check your system look at the starting log of one of the Home Assistant Community Addons. The initial banner shows the system arch.

@MrSolo570
Copy link

ty nice hint. I am on armv7 too so I figure updating should be okay

@irosaurus
Copy link

irosaurus commented Jan 22, 2023

I'm facing the same issue on a RPi4. When trying to use it with npm:

# npm start

> [email protected] start /srv/scripts/ICantBelieveItsNotValetudo
> node app.js

/srv/scripts/ICantBelieveItsNotValetudo/node_modules/@napi-rs/canvas/js-binding.js:193
    throw loadError
    ^

Error: /srv/scripts/ICantBelieveItsNotValetudo/node_modules/@napi-rs/canvas-linux-arm-gnueabihf/skia.linux-arm-gnueabihf.node: undefined symbol: _ZNSt19_Sp_make_shared_tag5_S_eqERKSt9type_info
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/srv/scripts/ICantBelieveItsNotValetudo/node_modules/@napi-rs/canvas/js-binding.js:177:29)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
  code: 'ERR_DLOPEN_FAILED'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-01-22T20_30_19_116Z-debug.log

When I try to build it with docker:

# docker compose up
[+] Building 26.1s (9/10)
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.0s
 => => transferring dockerfile: 32B                                                                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                                                         0.0s
 => [internal] load metadata for docker.io/library/node:lts-alpine                                                                                                                                                                      1.9s
 => [1/6] FROM docker.io/library/node:lts-alpine@sha256:fda98168118e5a8f4269efca4101ee51dd5c75c0fe56d8eb6fad80455c2f5827                                                                                                                0.0s
 => [internal] load build context                                                                                                                                                                                                       4.7s
 => => transferring context: 2.94kB                                                                                                                                                                                                     1.0s
 => CACHED [2/6] WORKDIR /app                                                                                                                                                                                                           0.0s
 => CACHED [3/6] COPY package.json /app                                                                                                                                                                                                 0.0s
 => CACHED [4/6] COPY package-lock.json /app                                                                                                                                                                                            0.0s
 => ERROR [5/6] RUN npm ci                                                                                                                                                                                                             18.5s
------
 > [5/6] RUN npm ci:
#0 8.106
#0 8.106
#0 8.106 #
#0 8.106 # Fatal error in , line 0
#0 8.106 # unreachable code
#0 8.106 #
#0 8.106 #
#0 8.106 #
#0 8.106 #FailureMessage Object: 0xbe9ae554
------
failed to solve: executor failed running [/bin/sh -c npm ci]: exit code: 133

My docker-compose.yml:

services:
    icantbelieveitsnotvaletudo:
        build:
          context: /srv/scripts/ICantBelieveItsNotValetudo/
          dockerfile: Dockerfile
        container_name: "ICantBelieveItsNotValetudo"
        restart: always
        volumes:
            - /srv/scripts/ICantBelieveItsNotValetudo/config.json:/app/config.json

Env

# npm -v
6.14.17

# node -v
v14.21.2

# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants