Skip to content
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

node-pre-gyp WARN Hit error response status 404 Not Found #1862

Closed
andriusign opened this issue Jul 18, 2021 · 4 comments
Closed

node-pre-gyp WARN Hit error response status 404 Not Found #1862

andriusign opened this issue Jul 18, 2021 · 4 comments

Comments

@andriusign
Copy link

Cannot install Node Canvas in Gitlab pipeline.

Running with gitlab-runner 13.11.0 (7f7a4bb0)
  on etc.server.net aaakbbbq
Preparing the "docker" executor 00:39
Using Docker executor with image node:14-alpine ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:b0a9f712488ae3b3ddf576e14e56186f709e4735fe042b01f76521878929d535 for docker:dind with digest docker@sha256:c979de0f48d11f806ca8b26c64c13f96a598433e9d3ba9923198cf6b2d51c20e ...
Waiting for services to be up and running...
*** WARNING: Service runner-ptjkxysq-project-23700379-concurrent-0-d74e947febb79dd0-docker-0 probably didn't start properly.
Health check error:
service "runner-ptjkxysq-project-23700379-concurrent-0-d74e947febb79dd0-docker-0-wait-for-service" timeout
Health check container logs:
Service container logs:
2021-07-18T13:16:06.265300379Z Generating RSA private key, 4096 bit long modulus (2 primes)
2021-07-18T13:16:06.625796993Z .........................................................................................++++
2021-07-18T13:16:06.644542081Z ...++++
2021-07-18T13:16:06.645048647Z e is 65537 (0x010001)
2021-07-18T13:16:06.685210648Z Generating RSA private key, 4096 bit long modulus (2 primes)
2021-07-18T13:16:07.077080144Z ............................................++++
2021-07-18T13:16:07.393204200Z ......................................++++
2021-07-18T13:16:07.393227672Z e is 65537 (0x010001)
2021-07-18T13:16:07.469191904Z Signature ok
2021-07-18T13:16:07.469217769Z subject=CN = docker:dind server
2021-07-18T13:16:07.469221350Z Getting CA Private Key
2021-07-18T13:16:07.502206767Z /certs/server/cert.pem: OK
2021-07-18T13:16:07.508215669Z Generating RSA private key, 4096 bit long modulus (2 primes)
2021-07-18T13:16:07.833029166Z .........................................................................++++
2021-07-18T13:16:07.962388003Z ..................................++++
2021-07-18T13:16:07.962908491Z e is 65537 (0x010001)
2021-07-18T13:16:07.990043369Z Signature ok
2021-07-18T13:16:07.990746989Z subject=CN = docker:dind client
2021-07-18T13:16:07.991095007Z Getting CA Private Key
2021-07-18T13:16:08.006483373Z /certs/client/cert.pem: OK
2021-07-18T13:16:08.059880648Z time="2021-07-18T13:16:08.059659435Z" level=info msg="Starting up"
2021-07-18T13:16:08.063396766Z time="2021-07-18T13:16:08.063220410Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
2021-07-18T13:16:08.063652575Z failed to load listeners: can't create unix socket /var/run/docker.sock: device or resource busy
*********
Pulling docker image node:14-alpine ...
Using docker image sha256:f5f48375fc5d0df18a96d337019e7dc4e99efd4d98f9e8ab53af74c56de91de3 for node:14-alpine with digest node@sha256:fb6cb918cc72869bd625940f42a7d8ae035c4e786d08187b94e8b91c6a534dfd ...
Preparing environment 00:01
Running on runner-ptjkxysq-project-23700379-concurrent-0 via cd2a32de7aba...
Getting source from Git repository 00:03
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/user/project/.git/
Checking out f4ddf66d as feat/258-captcha...
Removing api/new/node_modules/
Skipping Git submodules setup
Restoring cache 00:02
Checking cache for 24edb6a5f8031b8c7c84d3bfaef2f326aeec3fd7-9...
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted. 
Successfully extracted cache
Executing "step_script" stage of the job script 00:20
Using docker image sha256:f5f48375fc5d0df18a96d337019e7dc4e99efd4d98f9e8ab53af74c56de91de3 for node:14-alpine with digest node@sha256:fb6cb918cc72869bd625940f42a7d8ae035c4e786d08187b94e8b91c6a534dfd ...
$ cd ./api/new
$ npm ci
> [email protected] install /builds/user/project/api/new/node_modules/canvas
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-linux-musl-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v83 ABI, musl) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v83-linux-musl-x64.tar.gz 
gyp ERR! find Python 
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python 
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python 
gyp ERR! configure error 
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:179:16)
gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:326:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:338:5)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:467:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:82:21)
gyp ERR! System Linux 5.4.0-73-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/builds/user/project/api/new/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/builds/user/project/api/new/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd /builds/user/project/api/new/node_modules/canvas
gyp ERR! node -v v14.17.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/builds/user/project/api/new/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/builds/user/project/api/new/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/builds/user/project/api/new/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1055:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Linux 5.4.0-73-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/builds/user/project/api/new/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /builds/user/project/api/new/node_modules/canvas
node-pre-gyp ERR! node -v v14.17.3
node-pre-gyp ERR! node-pre-gyp -v v1.0.5
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/builds/user/project/api/new/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/builds/user/project/api/new/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install 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/2021-07-18T13_16_57_634Z-debug.log
Cleaning up file based variables 00:02
ERROR: Job failed: exit code 1
@zbjornson
Copy link
Collaborator

Please see #1511:

If you're on Alpine Linux or another distro using musl-libc

The log may look like

node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.0/canvas-v2.6.0-node-v64-linux-musl-x64.tar.gz

Prebuilds are only available for glibc, not musl-libc. See node-gfx/node-canvas-prebuilt#77, which includes information on building from source.

@andriusign
Copy link
Author

andriusign commented Jul 21, 2021

Adding these two lines to .gitlab-ci.yml fixed the problem:
image

apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev
apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family fontconfig

@balibou
Copy link

balibou commented Jan 25, 2022

Adding these two lines to .gitlab-ci.yml fixed the problem: image

apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev
apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family fontconfig

I have remove ttf-ubuntu-font-family and it's working

@beeattack
Copy link

Adding these two lines to .gitlab-ci.yml fixed the problem: image

apk add --no-cache build-base g++ cairo-dev jpeg-dev pango-dev giflib-dev
apk add --update --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family fontconfig

I have remove ttf-ubuntu-font-family and it's working

This works for me as well, thanks

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

No branches or pull requests

4 participants