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

Sentry fails to install/run around 30% of the time when using sentrycli_cdnurl #1758

Closed
RossMcMillan92 opened this issue Sep 26, 2023 · 7 comments · Fixed by #1836
Closed

Comments

@RossMcMillan92
Copy link

RossMcMillan92 commented Sep 26, 2023

Environment

Jenkins
Using @sentry/next
Using artifactory (changing the URL with sentrycli_cdnurl)

Steps to Reproduce

Around 30% of our builds fail with:

Error: Unexpected sentry-cli version "", expected "1.75.2"

I suspect it's because we're altering the download location with sentrycli_cdnurl, however, I don't think artifactory is the issue as all our other dependencies (including a few others with binaries) install without issue. Seems like a race condition somewhere.

Expected/Actual Result

The package would install and run correctly.

Logs

15:57:55  error /home/jenkins/agent/workspace/XXX-ci-cd/YYY-pipeline/node_modules/@sentry/webpack-plugin/node_modules/@sentry/cli, /home/jenkins/agent/workspace/XXX-ci-cd/YYY-pipeline/node_modules/@sentry/wizard/node_modules/@sentry/cli: Command failed.
15:57:55  Exit code: 1
15:57:55  Command: node ./scripts/install.js
15:57:55  Arguments: 
15:57:55  Directory: /home/jenkins/agent/workspace/XXX-ci-cd/YYY-pipeline/node_modules/@sentry/wizard/node_modules/@sentry/cli
15:57:55  Output:
15:57:55  [sentry-cli] Using cached binary: /home/jenkins/.npm/sentry-cli/65305f-sentry-cli-Linux-x86-64
15:57:55  Error: Unexpected sentry-cli version "", expected "1.75.2"
@RossMcMillan92 RossMcMillan92 changed the title Sentry fails to install/run aroudn 30% of the time when using sentrycli_cdnurl1 Sentry fails to install/run around 30% of the time when using sentrycli_cdnurl Sep 26, 2023
@loewenheim
Copy link
Contributor

Thanks for the report.

@mike-4040
Copy link

Can't install cli at all.
Consistently getting:

info run @sentry/[email protected] install { code: 1, signal: null }
91 timing reify:rollback:createSparse Completed in 4ms
92 timing reify:rollback:retireShallow Completed in 0ms
93 timing command:i Completed in 76518ms
94 verbose stack Error: command failed
94 verbose stack     at ChildProcess.<anonymous> (/Users/mikekravtsov/.nvm/versions/node/v18.16.1/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
94 verbose stack     at ChildProcess.emit (node:events:513:28)
94 verbose stack     at maybeClose (node:internal/child_process:1091:16)
94 verbose stack     at Socket.<anonymous> (node:internal/child_process:449:11)
94 verbose stack     at Socket.emit (node:events:513:28)
94 verbose stack     at Pipe.<anonymous> (node:net:322:12)
95 verbose pkgid @sentry/[email protected]
96 verbose cwd /Users/mikekravtsov/code/native-backend/functions
97 verbose Darwin 22.6.0
98 verbose node v18.16.1
99 verbose npm  v9.5.1
100 error code 1
101 error path /Users/mikekravtsov/code/native-backend/functions/node_modules/@sentry/cli
102 error command failed
103 error command sh -c node ./scripts/install.js
104 error [sentry-cli] Downloading from https://downloads.sentry-cdn.com/sentry-cli/2.20.7/sentry-cli-Darwin-universal
104 error Error: Unable to download sentry-cli binary from https://downloads.sentry-cdn.com/sentry-cli/2.20.7/sentry-cli-Darwin-universal.
104 error Error message: request to https://downloads.sentry-cdn.com/sentry-cli/2.20.7/sentry-cli-Darwin-universal failed, reason: connect ETIMEDOUT 2a04:4e42:600::729:443
104 error Error code: ETIMEDOUT
105 verbose exit 1
106 timing npm Completed in 76563ms
107 verbose unfinished npm timer reify 1696343353105
108 verbose unfinished npm timer reify:build 1696343354444
109 verbose unfinished npm timer build 1696343354445
110 verbose unfinished npm timer build:deps 1696343354445
111 verbose unfinished npm timer build:run:install 1696343354447
112 verbose unfinished npm timer build:run:install:node_modules/@sentry/cli 1696343354448
113 verbose code 1

Increased npm config setting fetch-retry-mintimeout and fetch-retry-maxtimeout
Doesn't help

@loewenheim
Copy link
Contributor

Can you try using PyPI instead of NPM?

@mike-4040
Copy link

I've found the way around it: manually downloaded binaries and then set SENTRY_BINARY_PATH= alongside SENTRYCLI_SKIP_DOWNLOAD=1.
The ideal solution is to make ./scripts/install.js to honor the npm timeout config settings.

@mike-4040
Copy link

Can you try using PyPI instead of NPM?

@loewenheim, thank you for the suggestion. Why don't I try it before? Likely because I am stupid :)

Copy link

github-actions bot commented Nov 1, 2023

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@RossMcMillan92
Copy link
Author

Still seeing this quite often unfortunately.

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

Successfully merging a pull request may close this issue.

3 participants