Installation error during docker Build

See original GitHub issue

Hi

i have a VPS on a hosting provider. I follow the installation guide at https://pwndoc.github.io/pwndoc/#/installation, but when i try a fresh installation of pwndoc i have this error message :

Step 6/11 : RUN npm install
 ---> Running in 817e142f53f1
npm WARN deprecated xmldom@0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm notice 
npm notice New minor version of npm available! 8.5.0 -> 8.7.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.7.0>
npm notice Run `npm install -g npm@8.7.0` to update!
npm notice 
npm ERR! code 1
npm ERR! path /app/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! make: Entering directory '/app/node_modules/bcrypt/build'
npm ERR! make: Leaving directory '/app/node_modules/bcrypt/build'
npm ERR! Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/app/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/app/node_modules/bcrypt/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.14.0
npm ERR! node-pre-gyp info using node@16.14.2 | linux | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download 
npm ERR! node-pre-gyp info check checked for "/app/node_modules/bcrypt/lib/binding/bcrypt_lib.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-linux-x64-musl.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-linux-x64-musl.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-linux-x64-musl.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.8 and node@16.14.2 (node-v93 ABI, musl) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.8/bcrypt_lib-v3.0.8-node-v93-linux-x64-musl.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.2 | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.2 | linux | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "/usr/bin/python3"
npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v16.14.2/node-v16.14.2-headers.tar.gz
npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v16.14.2/node-v16.14.2-headers.tar.gz
npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v16.14.2/SHASUMS256.txt
npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v16.14.2/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/app/node_modules/bcrypt/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/root/.cache/node-gyp/16.14.2/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.14.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.14.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/app/node_modules/bcrypt',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.2 | linux | x64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! make: printf: Operation not permitted
npm ERR! make: *** [bcrypt_lib.target.mk:115: Release/obj.target/bcrypt_lib/src/blowfish.o] Error 127
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.4.0-109-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/app/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/app/node_modules/bcrypt/lib/binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd /app/node_modules/bcrypt
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! 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 build --fallback-to-build --module=/app/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/app/node_modules/bcrypt/lib/binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/app/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Linux 5.4.0-109-generic
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /app/node_modules/bcrypt
npm ERR! node-pre-gyp ERR! node -v v16.14.2
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.14.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-04-26T10_05_19_376Z-debug-0.log
ERROR: Service 'pwndoc-backend' failed to build: The command '/bin/sh -c npm install' returned a non-zero code: 1

I try to change de Dockerfile of the backend dir with : RUN npm install -g npm@8.7.0

Then i have some error during installation, and after installation there is an error in the backend log (i launch sudo docker-compose logs -f pwndoc-backend) pwndoc-backend@0.0.1 start pwndoc-backend | > node src/app.js pwndoc-backend | pwndoc-backend | node:internal/modules/cjs/loader:936 pwndoc-backend | throw err; pwndoc-backend | ^ pwndoc-backend | pwndoc-backend | Error: Cannot find module 'express' pwndoc-backend | Require stack: pwndoc-backend | - /app/src/app.js Maby i missed something

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Effritecommented, Apr 26, 2022

I am using Ubuntu 20.04.4 LTS I just clean all docker image, and rebuild the container with your workaround yeln4ts and it works. The installation is now working find. Thank you for your help and for sharing with the community pwndoc.

1reaction
yeln4tscommented, Apr 26, 2022

I managed to reproduce the issue it seems to be because of bcrypt version. I will update it soon (after testing that everything is working) but meanwhile you can change the version of bcrypt in backend/package.json to 5.0.1 and rebuild

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker: “build” Requires 1 Argument Error - Baeldung
The most common reason for “Docker build Requires 1 Argument” error is when we try to build the image without providing sufficient arguments....
Read more >
Installer running in container during docker build fails with ...
The install fails with with error 1719. Error 1719. The Windows Installer Service could not be accessed. This can occur if you are...
Read more >
While running Docker build the pip dependencies installation ...
I have run my application using gunicorn with no error. Then I tried to create a docker image to deploy the application. But...
Read more >
An error occurred while attempting to build Docker image #3884
Basically, I'm trying to transition my build agents to run under docker containers and in doing so I'm running into container size limitations ......
Read more >
Building your Docker Image - Runnable
Detailed steps to build your Docker image and troubleshoot errors encountered during builds with Ruby on Rails applications.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found