getsentry / sentry-react-native

Official Sentry SDK for React Native
https://sentry.io
MIT License
1.57k stars 337 forks source link

[iOS] Upload Debug Symbols to Sentry #3582

Closed skinnynpale closed 8 months ago

skinnynpale commented 9 months ago

OS:

Platform:

SDK:

SDK version: 5.18.0

react-native version: 0.73.3

Are you using Expo?

Are you using sentry.io or on-premise?


I have the following issue:

[Description]

Steps to reproduce:

Actual result:

The Sentry logging itself works fine, but when I enable upload Upload Debug Symbols to project.pbxproj with a build in xcode 15.2 I get the error "Command PhaseScriptExecution failed with a nonzero exit code". We use new arch + hermes

image image image image

Expected result:

[Expected result]

latobibor commented 8 months ago

On Android I have the same problem: Process 'command '/Users/XXX/XXX/node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

aliza-khu commented 8 months ago

What went wrong?

API request failed caused by: sentry reported an error: request failure (http status: 500) Object({"detail": String("Internal Error"), "errorId": String("xxx")})

deepanshu-sharma09 commented 8 months ago

error: API request failed caused by: sentry reported an error: request failure (http status: 500) Object {"detail": String("Internal Error"), "errorId": String("xxxx")}

pax-k commented 8 months ago

Edit: now all is good, thanks

Same here, trying to build an iOS app on Expo.

› Executing DevKin » Upload Debug Symbols to Sentry

❌  error: API request failed

⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » DevKin/DevKin » Build Phases » 'Upload Debug Symbols to Sentry'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸   PhaseScriptExecution Upload\ Debug\ Symbols\ to\ Sentry /Users/expo/Library/Developer/Xcode/DerivedData/DevKin-aczgjgpuztfeptgjumyzymjcejrl/Build/Intermediates.noindex/ArchiveIntermediates/DevKin/IntermediateBuildFilesPath/DevKin.build/Debug-iphoneos/DevKin.build/Script-50BEE7372E3D4B0A9587D43A.sh (in target 'DevKin' from project 'DevKin')
▸ (1 failure)
** ARCHIVE FAILED **

Yesterday was ok.

Deps:

"@sentry/react-native": "5.17.0",
"react-native": "0.73.4",
"expo": "~50.0.6",
skinnynpale commented 8 months ago

On Android I have the same problem: Process 'command '/Users/XXX/XXX/node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1

https://github.com/getsentry/sentry-react-native/issues/3585

aliza-khu commented 8 months ago

The issue is resolved now.

skinnynpale commented 8 months ago

The issue is resolved now.

iOS is work now?

aliza-khu commented 8 months ago

@skinnynpale, I am using CI/CD for build generation and only found an issue under the Android platform which is resolved now. For iOS it was already working.

krystofwoldrich commented 8 months ago

Hello everyone, we experienced a degradation of service on the file-based API yesterday, more information here https://status.sentry.io/incidents/5k3pjs416qnn.

Can anyone confirm the 500 API errors are not happening anymore?

krystofwoldrich commented 8 months ago

@skinnynpale Thank you for the detailed screenshots of your changes. Everything is correct.

Was your issue related to the 500 server response?

In case it wasn't could you add export SENTRY_CLI_EXTRA_ARGS="--force-foreground --log-level=debug" to your environment and share with us the log output of the build phase so we can investigate the issue?

AlejandroGutierrezB commented 8 months ago

This is failing on my end to: "@sentry/react-native": "4.15.2", "expo": "~48.0.21", "react-native": "0.71.14", "sentry-expo": "~6.2.2"

AlejandroGutierrezB commented 8 months ago

This is failing on my end to: "@sentry/react-native": "4.15.2", "expo": "~48.0.21", "react-native": "0.71.14", "sentry-expo": "~6.2.2"

update latest and it persists "@sentry/react-native": "5.19.0" "sentry-expo": "7.1.1"

I am inclined to think it is an API outage?

krystofwoldrich commented 8 months ago

Hi @AlejandroGutierrezB, thank you for the message, are you getting a status 500 response?

AlejandroGutierrezB commented 8 months ago

Hi @AlejandroGutierrezB, thank you for the message, are you getting a status 500 response?

@krystofwoldrich the issue is that that is the only thing I get from the cli:

› Executing myapp » Upload Debug Symbols to Sentry

❌  error: API request failed

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
    at Object.buildAsync (/user/myapp/node_modules/@expo/cli/build/src/run/ios/XcodeBuild.js:241:19)
    at async runIosAsync (/user/myappnode_modules/@expo/cli/build/src/run/ios/runIosAsync.js:56:25)
krystofwoldrich commented 8 months ago

The failing requests were caused by an API incident, https://status.sentry.io/incidents/bt27tt1h1wsd

This was resolved now, uploads are working.

We will close the issue. Feel free to comment here in case this happens again.

coopersamuel commented 6 months ago

Hello @krystofwoldrich, I think I'm running into this issue. Could there have been a regression?

Expo EAS build is failing both on the EAS server and locally. However, it does work locally when I pass SENTRY_ALLOW_FAILURE=true as an env var. Here is a screenshot of my build logs (without the added env var). Any help would be appreciated!

image

Edit: Also, here are relevant logs from the successful build with SENTRY_ALLOW_FAILURE=true

› Generating debug TheAIBible » TheAIBible.app.dSYM
› Executing TheAIBible » Bundle React Native code and images

❌  error: API request failed

› Executing TheAIBible » [CP] Copy Pods Resources
› Executing TheAIBible » Upload Debug Symbols to Sentry

❌  error: API request failed

› Executing TheAIBible » [CP] Embed Pods Frameworks
› Signing   TheAIBible » TheAIBible.app
⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » TheAIBible/TheAIBible » Build Phases » 'Upload Debug Symbols to Sentry'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script

› Build Succeeded
appsgenie commented 5 months ago

I've also just received this error that @coopersamuel reported, building with Expos EAS and SDK 49. Does anyone know how to fix this?

anshul-flyfin commented 5 months ago

@krystofwoldrich this issue seems to be happening again, can you confirm if there is a regression ?

error: API request failed
  caused by: sentry reported an error: request failure (http status: 500)
  Object {"detail": String("Internal Error"), "errorId": String("eb2d2943a6404dfd99c16faff66e30b3")}

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

GenerateDSYMFile /Users/runner/Library/Developer/Xcode/DerivedData/flyfinApp-ghsymviuejdlwkgwtreqwuzdlnvh/Build/Intermediates.noindex/ArchiveIntermediates/flyfinApp-org-production/BuildProductsPath/Org\ Production\ Release-iphoneos/FlyFin.app.dSYM /Users/runner/Library/Developer/Xcode/DerivedData/flyfinApp-ghsymviuejdlwkgwtreqwuzdlnvh/Build/Intermediates.noindex/ArchiveIntermediates/flyfinApp-org-production/InstallationBuildProductsLocation/Applications/FlyFin.app/FlyFin (in target 'flyfinApp' from project 'flyfinApp')
    cd /Users/runner/work/1/s/ios
    /Applications/Xcode_15.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/runner/Library/Developer/Xcode/DerivedData/flyfinApp-ghsymviuejdlwkgwtreqwuzdlnvh/Build/Intermediates.noindex/ArchiveIntermediates/flyfinApp-org-production/InstallationBuildProductsLocation/Applications/FlyFin.app/FlyFin -o /Users/runner/Library/Developer/Xcode/DerivedData/flyfinApp-ghsymviuejdlwkgwtreqwuzdlnvh/Build/Intermediates.noindex/ArchiveIntermediates/flyfinApp-org-production/BuildProductsPath/Org\ Production\ Release-iphoneos/FlyFin.app.dSYM

warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'flyfinApp' from project 'flyfinApp')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'flyfinApp' from project 'flyfinApp')
warning: Run script build phase 'Upload Debug Symbols to Sentry' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'flyfinApp' from project 'flyfinApp')
warning: Run script build phase '[CP-User] [RNFB] Core Configuration' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'flyfinApp' from project 'flyfinApp')
warning: Run script build phase '[CP-User] [RNFB] Crashlytics Configuration' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'flyfinApp' from project 'flyfinApp')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'fmt' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-bridging' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-Codegen' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'RCT-Folly' from project 'Pods')
** ARCHIVE FAILED **

The following build commands failed:
    PhaseScriptExecution Upload\ Debug\ Symbols\ to\ Sentry /Users/runner/Library/Developer/Xcode/DerivedData/flyfinApp-ghsymviuejdlwkgwtreqwuzdlnvh/Build/Intermediates.noindex/ArchiveIntermediates/flyfinApp-org-production/IntermediateBuildFilesPath/flyfinApp.build/Org\ Production\ Release-iphoneos/flyfinApp.build/Script-13606D41F60548F7B47E3F63.sh (in target 'flyfinApp' from project 'flyfinApp')
(1 failure)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65
coopersamuel commented 5 months ago

I was able to fix it on my end. My build process was not pulling my SENTRY_AUTH_TOKEN in properly. Make sure your build is providing the token correctly

appsgenie commented 5 months ago

I was able to build once, not sure if it was just a retry or an updated token, but now I am getting A required debug information file was missing. Did you get this issue as well @coopersamuel?

charlestbell commented 2 months ago

Happening again today.

sergioisidoro commented 1 month ago

I think it is quite unacceptable that a service makes uploading the source code and symbols (a non critical task) fail the entire build if the step fails. The same happens if some error like Project not found. Please check that you entered the project and organization slugs correctly.

It's effectively making thousands of build processes dependent on Sentry's service availability.

This should be a warning, not a failure, or should be SENTRY_ABORT_BUILD_IF_FAIL or something similar.

Furthermore, I am working with multiple organizations, which have different access tokens, making the secret management quite challenging.