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/cli binary doesn't download (leads to iOS build failure) #2688

Closed
capella55 opened this issue Dec 9, 2022 · 16 comments
Closed

@sentry/cli binary doesn't download (leads to iOS build failure) #2688

capella55 opened this issue Dec 9, 2022 · 16 comments

Comments

@capella55
Copy link

Environment
os: macOS 12.6
platform: iOS
yarn: 1.22.19
react: 17.0.2
react-native: 0.68.2

I created a new React-Native project by running npx react-native init AwesomeProject --version 0.68.0.
After that, I ran the following commands to install Sentry.

yarn add @sentry/react-native
npx @sentry/wizard -i reactNative -p ios android
cd ios
pod install

I have the following issue:

Android works well but I see the error while building the iOS app.
Command PhaseScriptExecution failed with a nonzero exit code

Error: spawn /AwesomeProject/node_modules/@sentry/cli/sentry-cli ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /AwesomeProject/node_modules/@sentry/cli/sentry-cli',
  path: '/Volumes/DATA/Project/AwesomeProject/node_modules/@sentry/cli/sentry-cli',
  spawnargs: [ 'upload-dsym' ]
}
Command PhaseScriptExecution failed with a nonzero exit code

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Dec 10, 2022

Hi,
it looks like the path to the CLI executable is missing, probably it didn't download when installing dependencies.

You can try to reinstall dependencies or install the CLI manually by yarn add --dev @sentry/[email protected].

@jeremyfalldev
Copy link

@krystofwoldrich Thank you for checking this!
I confirmed @sentry/[email protected] was installed already. However, I ran the above and tried again but saw the same issue.

Here is a screenshot.

screenshot

I see @sentry/cli but not @sentry/cli/sentry-cli. Is this a problem?

@capella55
Copy link
Author

@krystofwoldrich @jeremyfalldev Same issue on my side. :(

@krystofwoldrich
Copy link
Member

@capella55 @jeremyfalldev For some reason the CLI install script didn't download the CLI binary or didn't get executed.

Try to execute it manually.

cd node_modules/@sentry/cli
node ./scripts/install.js

@capella55
Copy link
Author

capella55 commented Dec 13, 2022

@krystofwoldrich Yes, it seems like the CLI install script does not work properly. Please check this screenshot.

Screen Shot 2022-12-13 at 11 24 40 AM

It has been never completed 100% and I don't see sentry-cli.

@krystofwoldrich
Copy link
Member

Are you able to download the file from the URL manually?

https://downloads.sentry-cdn.com/sentry-cli/1.74.4/sentry-cli-Darwin-universal

@capella55 So the install.js never finishes?

@kamilogorek Do you know what could cause this?

@capella55
Copy link
Author

@krystofwoldrich Yes, I can download the file from the URL manually.
So the install.js never finishes. I've tried on several machines and see the same issue.

@kamilogorek
Copy link
Contributor

I tried to replicate the issue locally but with no luck. I see that your output is not TTY, as then it'd not print multiple progressbar lines (it shouldn't anyway as bar should be rendered in TTY environments only anyway ¯_(ツ)_/¯).

I wonder if it may have something to do with it. Can you try to run it with SENTRYCLI_NO_PROGRESS_BAR=1 instead?

@robgraeber
Copy link

Same issue using a yarn monorepo, running install.js manually fixes it.

@krystofwoldrich
Copy link
Member

@robgraeber Not exactly the same as for you the install.js finished when manually executed.

But anyway could you share what tools are you using, what OS, yarn version, node version...

Maybe some of it will help us to fix the issue.

@robgraeber
Copy link

Hmm I tried reproducing it in another repo but can't reliably. I also deleted my .yarn/cache folder in my original project and it seemed to reinstall successfully. I'm using yarn workspaces, yarn 3.2.1, node 16, and a mac.

Here's the repo of what I'm doing, it reproduced one time but doesn't happen when I try it again. https://github.com/robgraeber/sentry-test

@krystofwoldrich
Copy link
Member

@robgraeber Thanks for the repo I'll try it and let you know if I managed to reproduce it.

@krystofwoldrich krystofwoldrich changed the title iOS - Command PhaseScriptExecution failed with a nonzero exit code @sentry/cli binary doesn't download (leads to iOS build failure) Jan 24, 2023
@krystofwoldrich
Copy link
Member

@robgraeber I'm sorry for the wait, sadly I still can't reproduce the issue. I've tried the repo with the same version of node and yarn, but no luck.

@krystofwoldrich
Copy link
Member

I will close this for now, as we are not able to reproduce the issue, if there would be some new context we could try feel free to inform us, and we can reopen the issue and continue with it.

@krystofwoldrich krystofwoldrich closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2023
@grossadamm
Copy link

In case some internet searcher comes along in the future...

I'm also using bun and I struggled with this for a while. I had the same issue where install.js was not being triggered and the sentry-cli rust executable was not present. This results in a file not found error in the spawn command which is very cryptic and confusing to debug until you dig into the repo a bit.

Not sure what precisely solved it for me, but it works now. Here's everything I did.

I moved @sentry/cli into dependencies from devDependencies and ensured that trustedDependencies listed it.

"trustedDependencies": [
    "@sentry/cli"
  ]

Then these commands

bun upgrade
rm -rf ~/.bun/install/cache
 rm -rf node_modules bun.lockb

@krystofwoldrich
Copy link
Member

@grossadamm Thank you for sharing this.

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

No branches or pull requests

6 participants