Repository navigation
Closed
Description
Hello,
I'm trying to use the @sentry/sentry-webpack-plugin in a project with a Docker from node:alpine and my webpack build is giving the following errors:
Note: I launch the build with this: docker build --tag=api . --build-arg SENTRY_ORG=my-org --build-arg SENTRY_AUTH_TOKEN=my-auth-token
Step 17/21 : RUN yarn build
---> Running in 2b914c65edc5
yarn run v1.15.2
$ backpack build
(node:33) UnhandledPromiseRejectionWarning: Error: spawn Unknown system error -8
at ChildProcess.spawn (internal/child_process.js:373:11)
at spawn (child_process.js:559:9)
at Object.execFile (child_process.js:224:15)
at Promise (/usr/src/api/node_modules/@sentry/cli/js/helper.js:147:20)
at new Promise (<anonymous>)
at Object.execute (/usr/src/api/node_modules/@sentry/cli/js/helper.js:137:10)
at Object.proposeVersion (/usr/src/api/node_modules/@sentry/cli/js/releases/index.js:57:8)
at SentryCliPlugin.getReleasePromise (/usr/src/api/node_modules/@sentry/webpack-plugin/src/index.js:162:27)
at new SentryCliPlugin (/usr/src/api/node_modules/@sentry/webpack-plugin/src/index.js:112:25)
at Object.webpack (/usr/src/api/backpack.config.js:24:9)
(node:33) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:33) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:33) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 2)
(node:33) UnhandledPromiseRejectionWarning: Error: spawn Unknown system error -8
at ChildProcess.spawn (internal/child_process.js:373:11)
at spawn (child_process.js:559:9)
at Object.execFile (child_process.js:224:15)
at Promise (/usr/src/api/node_modules/@sentry/cli/js/helper.js:147:20)
at new Promise (<anonymous>)
at Object.execute (/usr/src/api/node_modules/@sentry/cli/js/helper.js:137:10)
at Object.proposeVersion (/usr/src/api/node_modules/@sentry/cli/js/releases/index.js:57:8)
at SentryCliPlugin.getReleasePromise (/usr/src/api/node_modules/@sentry/webpack-plugin/src/index.js:162:27)
at new SentryCliPlugin (/usr/src/api/node_modules/@sentry/webpack-plugin/src/index.js:112:25)
at Object.webpack (/usr/src/api/backpack.config.js:24:9)
(node:33) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
Isolating the cli call, I have the following error on docker build:
Step 17/25 : RUN npx sentry-cli
---> Running in 3ee1764e848e
spawn Unknown system error -8
The command '/bin/sh -c npx sentry-cli' returned a non-zero code: 1
Isolating the package in node:alpine:
FROM node:alpine
RUN yarn add @sentry/webpack-plugin
RUN npx sentry-cli
Gives me the following output:
Step 1/3 : FROM node:alpine
---> 953c516e1466
Step 2/3 : RUN yarn add @sentry/webpack-plugin
---> Running in 476725a750e7
yarn add v1.15.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 14 new dependencies.
info Direct dependencies
└─ @sentry/[email protected]
info All dependencies
├─ @sentry/[email protected]
├─ @sentry/[email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 3.38s.
Removing intermediate container 476725a750e7
---> c7784ba53137
Step 3/3 : RUN npx sentry-cli
---> Running in 985421737f8a
internal/modules/cjs/loader.js:657
throw err;
^
Error: Cannot find module '/root/.npm/_npx/1/lib/node_modules/sentry-cli/tasks/download.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:655:15)
at Function.Module._load (internal/modules/cjs/loader.js:580:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:868:12)
at internal/main/run_main_module.js:21:11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node tasks/download.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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/2019-04-08T21_47_01_099Z-debug.log
Install for sentry-cli@latest failed with code 1
The command '/bin/sh -c npx sentry-cli' returned a non-zero code: 1
I'm not sure what am I doing wrong right now. Are there some packages I should add to node:alpine so the cli works?
Thank you for your time.
Reacted by James Isaac, Javier García González, Shaoqing Hu, Andrey (Andrii) Los, Bret, Stephen Lacy and Lucas
Metadata
Metadata
Assignees
Labels
No labels
Activity
javiergarciagonzalez commentedon Sep 26, 2019
Same here :(
oprince commentedon Nov 10, 2019
Same here :(
Any solution ?
AvailCat commentedon Nov 11, 2019
It is not related with alpine, same issue on
node:ltsandnode:lts-busterdocker image, see #620tonyo commentedon Nov 12, 2019
A few notes here:
@sentry/cli, notsentry-cli.npx @sentry/clishould work under root after you donpm config set unsafe-perm trueFeel free to provide another minimal failing example.
kamilogorek commentedon Mar 5, 2020
This should be resolved by now, see #620 (comment) + commit from Tonyo.
lightninglu10 commentedon Mar 10, 2020
@kamilogorek I'm still getting this error on "@sentry/cli": "^1.51.1".
I tried on a node:slim image as well and am getting:
Any idea what's up?
kamilogorek commentedon Mar 10, 2020
@lightninglu10 can you provide your Dockerfile?
lightninglu10 commentedon Mar 10, 2020
Where yarn run sentry runs a node.js file
kamilogorek commentedon Mar 19, 2020
Unfortunately provided code isn't enough to reproduce the issue. I need a valid repro case for this to investigate.
vitalyiegorov commentedon Apr 3, 2020
The same problem as @lightninglu10 faced - working locally on OSX, but does not work in the docker container (tried node:10-alpine image also):
Running sentry-cli from PATH works as expected, but running through NODE returns:
/app/node_modules/@sentry/cli/sentry-cli: 1: /app/node_modules/@sentry/cli/sentry-cli: Syntax error: end of file unexpected (expecting ")")I guess there is something with
node_modules/@sentry/cli/sentry-clibinary, @kamilogorek could you please help?Temporary fix to patch path to OS installed sentry-cli in the
package.json:kmaid commentedon Aug 6, 2021
I had this problem because i was using an yarn install from another (host) machine. I think the package compiles a binary which is system specific. Thats 4 hours of my life I will never get back.