Skip to content

Face API Docker build tfjs-node failure #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
6 tasks done
szotrj opened this issue Apr 26, 2025 · 1 comment
Open
6 tasks done

Face API Docker build tfjs-node failure #83

szotrj opened this issue Apr 26, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@szotrj
Copy link

szotrj commented Apr 26, 2025

Describe the bug
Face API Docker image fails to build due to tfjs-node npm install issue
Error: /opt/nodejs/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node: cannot open shared object file: No such file or directory

To Reproduce
Clone repository
Change directory to deployment
Run ./build-deploy-docker-image.sh --image-name faceapi-on-aws
Image fails to build

== Building docker image 'redacted.dkr.ecr.us-east-1.amazonaws.com/faceapi-on-aws:4.0.6' ==
[+] Building 66.7s (13/15) docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.41kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for public.ecr.aws/lambda/nodejs:20 2.5s
=> [build 1/8] FROM public.ecr.aws/lambda/nodejs:20@sha256:7f8272a2b1dfc1dd312a0c266bd50e71b06e3d714439dc67bb87bce302ca031f 18.1s
=> => resolve public.ecr.aws/lambda/nodejs:20@sha256:7f8272a2b1dfc1dd312a0c266bd50e71b06e3d714439dc67bb87bce302ca031f 0.0s
=> => sha256:34328c8be51cbad703d9e17aaa048fa432339731a4eccf6e25a78162a439aa8f 37.90MB / 37.90MB 6.6s
=> => sha256:f69b28a9afcdbc3e4ff1893beaafa123ef91849e20404ae50b197b152dfc4075 88.12kB / 88.12kB 0.3s
=> => sha256:7f8272a2b1dfc1dd312a0c266bd50e71b06e3d714439dc67bb87bce302ca031f 772B / 772B 0.0s
=> => sha256:5de3217fd569ebf1acf2a6b88e826dc95da6a82665d906321038f293e448dd11 1.58kB / 1.58kB 0.0s
=> => sha256:7d523d45e2e8c5b6d6ecffb9aaa48f70e48d3968aeb346372505adf990b4eb32 4.50kB / 4.50kB 0.0s
=> => sha256:a7bb9cce4478838b115c2971bb7fbaff94891157de21afd24d6d787cec397cd0 417B / 417B 0.3s
=> => sha256:ef05d9f2265b34e7a00e7aff623707cf81b4e793a99bdeb46a7b38d0974e944b 2.72MB / 2.72MB 2.8s
=> => sha256:03f4f4aea12b2e14e41a8eb535002582bba76ac997c912839308e26a1dcb1d55 54.11MB / 54.11MB 15.8s
=> => sha256:14f2b6ced03542007ef4614a563afc3af56b9ecad580ea4b6449b4c87b77965a 25.74MB / 25.74MB 11.6s
=> => extracting sha256:34328c8be51cbad703d9e17aaa048fa432339731a4eccf6e25a78162a439aa8f 0.9s
=> => extracting sha256:f69b28a9afcdbc3e4ff1893beaafa123ef91849e20404ae50b197b152dfc4075 0.0s
=> => extracting sha256:a7bb9cce4478838b115c2971bb7fbaff94891157de21afd24d6d787cec397cd0 0.0s
=> => extracting sha256:ef05d9f2265b34e7a00e7aff623707cf81b4e793a99bdeb46a7b38d0974e944b 0.0s
=> => extracting sha256:03f4f4aea12b2e14e41a8eb535002582bba76ac997c912839308e26a1dcb1d55 0.7s
=> => extracting sha256:14f2b6ced03542007ef4614a563afc3af56b9ecad580ea4b6449b4c87b77965a 1.5s
=> [internal] load build context 0.0s
=> => transferring context: 794B 0.0s
=> [build 2/8] RUN microdnf update -y && npm install -g npm && mkdir /opt/nodejs 17.7s
=> [release 2/4] RUN microdnf update -y 11.3s
=> [build 3/8] COPY .version package.json app.js app.test.js demo.jpg ./ 0.0s
=> [build 4/8] COPY lib/ ./lib/ 0.0s
=> [build 5/8] WORKDIR /opt/nodejs 0.0s
=> [build 6/8] COPY package.json ./ 0.0s
=> [build 7/8] RUN npm install --omit=dev 28.2s
=> ERROR [build 8/8] RUN cd /var/task && node app.test.js demo.jpg 0.2s

[build 8/8] RUN cd /var/task && node app.test.js demo.jpg:
0.190 node:internal/modules/cjs/loader:1651
0.190 return process.dlopen(module, path.toNamespacedPath(filename));
0.190 ^
0.190
0.190 Error: /opt/nodejs/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node: cannot open shared object file: No such file or directory
0.190 at Module._extensions..node (node:internal/modules/cjs/loader:1651:18)
0.190 at Module.load (node:internal/modules/cjs/loader:1275:32)
0.190 at Module._load (node:internal/modules/cjs/loader:1096:12)
0.190 at Module.require (node:internal/modules/cjs/loader:1298:19)
0.190 at require (node:internal/modules/helpers:182:18)
0.190 at Object. (/opt/nodejs/node_modules/@tensorflow/tfjs-node/dist/index.js:72:16)
0.190 at Module._compile (node:internal/modules/cjs/loader:1529:14)
0.190 at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
0.190 at Module.load (node:internal/modules/cjs/loader:1275:32)
0.190 at Module._load (node:internal/modules/cjs/loader:1096:12) {
0.190 code: 'ERR_DLOPEN_FAILED'
0.190 }
0.190
0.190 Node.js v20.19.0


Dockerfile:30

28 | MODEL_PATH=/opt/nodejs/node_modules/@vladmandic/face-api/model
29 |
30 | >>> RUN cd /var/task && node app.test.js demo.jpg
31 |
32 | #####################################################################

ERROR: failed to solve: process "/bin/sh -c cd /var/task && node app.test.js demo.jpg" did not complete successfully: exit code: 1

Expected behavior
Successful image build

Please complete the following information about the solution:

  • Version: v4.0.6
  • Region: us-east-1
  • Was the solution modified from the version published on this repository? No
  • If the answer to the previous question was yes, are the changes available on GitHub? N/A
  • Have you checked your service quotas for the sevices this solution uses? N/A
  • Were there any errors in the CloudWatch Logs? N/A

Screenshots
N/A

Additional context
N/A

@szotrj szotrj added the bug Something isn't working label Apr 26, 2025
@aws-kens aws-kens self-assigned this Apr 29, 2025
@aws-kens
Copy link
Collaborator

Hi @szotrj ,

Could you tell me what OS are you running the build script and what processor (CPU) of your system?

aws-kens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants