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

xcode: Upload Debug Symbols to Sentry has ambiguos dependencies #3537

Open
5 of 11 tasks
Yonom opened this issue Jan 21, 2024 · 31 comments
Open
5 of 11 tasks

xcode: Upload Debug Symbols to Sentry has ambiguos dependencies #3537

Yonom opened this issue Jan 21, 2024 · 31 comments
Labels
Expo Issues related to Sentry React Native Expo support Platform: React-Native

Comments

@Yonom
Copy link

Yonom commented Jan 21, 2024

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 5.16.0

react-native version: 0.73.2

Are you using Expo?

  • Yes, SDK 50
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

I have the following issue:

During build, I see a warning regarding an ambiguous dependency. I am using the "@sentry/react-native/expo" config plugin.

Steps to reproduce:

  • Step 1: Install Sentry in a new Expo project
  • Step 2: Run npx expo run ios and observe the logs

Actual result:

I see the following warning:

⚠️ Script has ambiguous dependencies causing it to run on every build.
To fix, go to: Xcode » App/App » Build Phases » 'Upload Debug Symbols to Sentry'
Either: Uncheck "Based on dependency analysis", or select output files to trigger the script

Expected result:

I expected no warnings.

@iM-GeeKy
Copy link

@Yonom This is appears to be causing builds to fail during eas build process for both iOS and Android. Locally things appear to be working after following the migration guide provided by the Expo team.

@Yonom
Copy link
Author

Yonom commented Jan 22, 2024

My EAS builds work just fine despite the warning

@iM-GeeKy
Copy link

My EAS builds work just fine despite the warning

Thanks for the quick response. I noticed this upgrading from 49 to 50 and following their migration guide. My issue appears to be sentry related and I was seeing the warning as well.

* Where:
Script '/home/expo/workingdir/build/node_modules/@sentry/react-native/sentry.gradle' line: 143

@krystofwoldrich
Copy link
Member

@Yonom Thank you for the message, we will update the build phase to remove the warning.

Note: We want it to run on every build, so the current behavior is correct. Just the script is not correctly marked in Xcode.

@krystofwoldrich krystofwoldrich changed the title Script has ambiguous dependencies causing it to run on every build. xcode: Upload Debug Symbols to Sentry has ambiguos dependencies Jan 22, 2024
@krystofwoldrich krystofwoldrich added the Expo Issues related to Sentry React Native Expo support label Jan 22, 2024
@krystofwoldrich
Copy link
Member

@iM-GeeKy Can you open a new issue for the Android build failure and if possible share a large portion of the build log output?

@iM-GeeKy
Copy link

@iM-GeeKy Can you open a new issue for the Android build failure and if possible share a large portion of the build log output?

Sure thing, I'll do that in a couple of hours when I'm back at my laptop. The issue appeared to be happening on iOS and Android. I'm make sure to attach as much of the build log as possible.

@TreeMan360
Copy link

This is not the reason the build is failing, if you scroll up in your logs you should see the actual failure reason. This is just outputted at the bottom of the Fastlane log output. It does not cause the build to fail.

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Jan 26, 2024

This needs to be updated in the sentry-wizard and @sentry/react-native/expo as well as in the manual setup docs.

@drewbietron
Copy link

We are running into this issue as well using Expo. We have a SENTRY_AUTH_TOKEN as a global env var in our organization's settings in Expo.

Error

Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » Development/Development » Build Phases » 'Upload Debug Symbols to Sentry'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script

Dependencies

"expo": "50.0.7",
"@sentry/react-native": "5.19.1"

Is there anyway to resolve this?

@krystofwoldrich
Copy link
Member

@drewbietron Thank you for the message, this is only a warning, we will fix it soon.

Let us know if your build is failing, as that would be caused by something else.

@drewbietron
Copy link

drewbietron commented Feb 28, 2024

@krystofwoldrich thanks for the quick reply. This is actually making our builds fail

image

@krystofwoldrich
Copy link
Member

@drewbietron Thank you for the extra logs, can you add export SENTRY_CLI_EXTRA_ARGS="--log-level=debug" to your envs to get more details about the failed request?

https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#configure-automatic-debug-symbols-upload

This seems to be an example of an issue we recently closed, can you post the new logs there and we can reopen it.

Does it happen only in CI or also when you try the build locally?

@drewbietron
Copy link

drewbietron commented Feb 28, 2024

@krystofwoldrich It is only happening when building in Expo. When I run the app locally I can send errors to Sentry and see the source.

The xcode logs are actually giving a 401 Invalid org token -- I see the auth token in the logs , but the Sentry dashboard says that the auth token I've generated has never been used + the 401.

+ UPLOAD_DEBUG_FILES='"/Users/expo/workingdir/build/node_modules/@sentry/cli/bin/sentry-cli" debug-files upload --log-level=debug   "/Users/expo/workingdir/build/packages/app/ios/build/Build/Products/Debug-iphonesimulator"'
+ '[' '' '!=' true ']'
+ /bin/sh -c '"node" "/Users/expo/workingdir/build/node_modules/@sentry/cli/bin/sentry-cli" debug-files upload --log-level=debug   "/Users/expo/workingdir/build/packages/app/ios/build/Build/Products/Debug-iphonesimulator"'
  INFO    2024-02-28 10:15:15.446841 -08:00 Loaded file referenced by SENTRY_PROPERTIES (sentry.properties)
  DEBUG   2024-02-28 10:15:15.447062 -08:00 sentry-cli version: 2.25.2, platform: "darwin", architecture: "arm64"
  INFO    2024-02-28 10:15:15.447073 -08:00 sentry-cli was invoked with the following command line: "/Users/expo/workingdir/build/node_modules/@sentry/cli-darwin/bin/sentry-cli" "debug-files" "upload" "--log-level=debug" "/Users/expo/workingdir/build/packages/app/ios/build/Build/Products/Debug-iphonesimulator"
  INFO    2024-02-28 10:15:15.447097 -08:00 Issuing a command for Organization: paintball-vault Project: app-development
  DEBUG   2024-02-28 10:15:15.449013 -08:00 request GET https://sentry.io/api/0/organizations/paintball-vault/chunk-upload/
  DEBUG   2024-02-28 10:15:15.449039 -08:00 using token authentication
  DEBUG   2024-02-28 10:15:15.449055 -08:00 retry number 0, max retries: 0
  DEBUG   2024-02-28 10:15:15.529761 -08:00 > GET /api/0/organizations/paintball-vault/chunk-upload/ HTTP/1.1
  DEBUG   2024-02-28 10:15:15.529782 -08:00 > Host: sentry.io
  DEBUG   2024-02-28 10:15:15.529785 -08:00 > Accept: */*
  DEBUG   2024-02-28 10:15:15.529786 -08:00 > Connection: TE
  DEBUG   2024-02-28 10:15:15.529788 -08:00 > TE: gzip
  DEBUG   2024-02-28 10:15:15.529790 -08:00 > User-Agent: sentry-cli/2.25.2
  DEBUG   2024-02-28 10:15:15.533171 -08:00 > Authorization: Bearer sntrys_e***
  DEBUG   2024-02-28 10:15:15.649165 -08:00 < HTTP/1.1 401 Unauthorized
  DEBUG   2024-02-28 10:15:15.649195 -08:00 < server: nginx
  DEBUG   2024-02-28 10:15:15.649200 -08:00 < date: Wed, 28 Feb 2024 18:15:15 GMT
  DEBUG   2024-02-28 10:15:15.649203 -08:00 < content-type: application/json
  DEBUG   2024-02-28 10:15:15.649206 -08:00 < www-authenticate: xBasic realm="api"
  DEBUG   2024-02-28 10:15:15.649240 -08:00 < allow: GET, POST, HEAD, OPTIONS
  DEBUG   2024-02-28 10:15:15.649254 -08:00 < access-control-allow-methods: GET, POST, HEAD, OPTIONS
  DEBUG   2024-02-28 10:15:15.649263 -08:00 < access-control-allow-headers: X-Sentry-Auth, X-Requested-With, Origin, Accept, Content-Type, Authentication, Authorization, Content-Encoding, sentry-trace, baggage, X-CSRFToken
  DEBUG   2024-02-28 10:15:15.649268 -08:00 < access-control-expose-headers: X-Sentry-Error, X-Sentry-Direct-Hit, X-Hits, X-Max-Hits, Endpoint, Retry-After, Link
  DEBUG   2024-02-28 10:15:15.649281 -08:00 < access-control-allow-origin: *
  DEBUG   2024-02-28 10:15:15.649283 -08:00 < x-sentry-rate-limit-remaining: 39
  DEBUG   2024-02-28 10:15:15.649288 -08:00 < x-sentry-rate-limit-limit: 40
  DEBUG   2024-02-28 10:15:15.649290 -08:00 < x-sentry-rate-limit-reset: 1709144116
  DEBUG   2024-02-28 10:15:15.649292 -08:00 < x-sentry-rate-limit-concurrentremaining: 24
  DEBUG   2024-02-28 10:15:15.649294 -08:00 < x-sentry-rate-limit-concurrentlimit: 25
  DEBUG   2024-02-28 10:15:15.649298 -08:00 < vary: Accept-Language, Cookie
  DEBUG   2024-02-28 10:15:15.649305 -08:00 < content-language: en
  DEBUG   2024-02-28 10:15:15.649308 -08:00 < x-frame-options: deny
  DEBUG   2024-02-28 10:15:15.649311 -08:00 < x-content-type-options: nosniff
  DEBUG   2024-02-28 10:15:15.649313 -08:00 < x-xss-protection: 1; mode=block
  DEBUG   2024-02-28 10:15:15.649318 -08:00 < content-security-policy: img-src * blob: data:; font-src * data:; media-src *; connect-src 'self' *.algolia.net *.algolianet.com *.algolia.io sentry.io *.sentry.io s1.sentry-cdn.com o1.ingest.sentry.io api2.amplitude.com app.pendo.io data.pendo.io reload.getsentry.net t687h3m0nh65.statuspage.io sentry.zendesk.com ekr.zdassets.com maps.googleapis.com; base-uri 'none'; worker-src blob:; default-src 'none'; style-src * 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'report-sample' s1.sentry-cdn.com js.sentry-cdn.com browser.sentry-cdn.com statuspage-production.s3.amazonaws.com static.zdassets.com aui-cdn.atlassian.com connect-cdn.atl-paas.net js.stripe.com 'strict-dynamic' cdn.pendo.io data.pendo.io pendo-io-static.storage.googleapis.com pendo-static-5634074999128064.storage.googleapis.com; frame-src app.pendo.io demo.arcade.software js.stripe.com sentry.io; object-src 'none'; frame-ancestors 'self' *.sentry.io; report-uri https://o1.ingest.sentry.io/api/54785/security/?sentry_key=f724a8a027db45f5b21507e7142ff78e&sentry_release=f83b8301d4aa7e8d208b932d949f7fb2acdb2bbb
  DEBUG   2024-02-28 10:15:15.649333 -08:00 < x-envoy-attempt-count: 1
  DEBUG   2024-02-28 10:15:15.649336 -08:00 < x-envoy-upstream-service-time: 102
  DEBUG   2024-02-28 10:15:15.649338 -08:00 < x-served-by: getsentry-web-rpc-production-578dbf5c4-czqv6
  DEBUG   2024-02-28 10:15:15.649340 -08:00 < x-sentry-proxy-url: http://10.2.0.67:8999/api/0/organizations/paintball-vault/chunk-upload/
  DEBUG   2024-02-28 10:15:15.649343 -08:00 < x-served-by: getsentry-control-web-default-common-production-86bb7479982mmpw
  DEBUG   2024-02-28 10:15:15.649345 -08:00 < x-served-by: frontend-default-55f469fdbb-8h2gt
  DEBUG   2024-02-28 10:15:15.649347 -08:00 < strict-transport-security: max-age=31536000; includeSubDomains; preload
  DEBUG   2024-02-28 10:15:15.649349 -08:00 < via: 1.1 google
  DEBUG   2024-02-28 10:15:15.649351 -08:00 < Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
  DEBUG   2024-02-28 10:15:15.649353 -08:00 < Transfer-Encoding: chunked
  DEBUG   2024-02-28 10:15:15.652380 -08:00 response status: 401
  DEBUG   2024-02-28 10:15:15.652389 -08:00 body: {"detail":"Invalid org token"}
error: API request failed
  caused by: sentry reported an error: Invalid org token (http status: 401)
  DEBUG   2024-02-28 10:15:15.652499 -08:00 skipping update nagger because session is not attended

@krystofwoldrich
Copy link
Member

@drewbietron Thank you for the log, I checked and see all your tokens were used at least once.

When you check Bundle React Native code and images, where Sentry uploads source maps, is the same token used, does that succeed?

When running the app locally have you tried to build the Release version, using Expo Go the debug files are not uploaded.

You can try running only the upload command to verify the token. https://docs.sentry.io/product/cli/dif/#uploading-files

@drewbietron
Copy link

@krystofwoldrich turns out I had a token set in project secrets and account wide secrets in or Expo account, and the project environment variable was outdated.

Appreciate your response on this, everything works as expected after using the correct token. 🙇

@krystofwoldrich
Copy link
Member

@drewbietron Happy to hear that, everything works now!

@chrisl777
Copy link

I was getting the error message for local builds. What was not obvious to me, is that you need to have the Sentry auth token set locally as well:

In my case, I created a ~/.sentryclirc file, per these instructions: https://docs.sentry.io/product/cli/configuration/#to-authenticate-manually:

[auth]
token={Sentry auth token here}

Note in the instructions, you can also use the sentry-cli to help set the auth token locally.

@krystofwoldrich
Copy link
Member

@chrisl777 If you only build a Release version of your application in CI, then you don't have to have the token set locally.

If you want to build Release locally without uploading debug files to Sentry you can use export SENTRY_DISABLE_AUTO_UPLOAD=true

https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/

@SmileHub
Copy link

SmileHub commented May 2, 2024

Maybe this information will help someone as well:
in my case i was missing "@sentry/cli" package in my expo react-native project and the error was the same abotu "ambiguos dependencies"...

@olddustysocksunderthecouch
Copy link

olddustysocksunderthecouch commented May 9, 2024

Unfortunately, SENTRY_DISABLE_AUTO_UPLOAD=true doesn't work when trying to build locally. I've also tried logging in with sentry-cli, which didn't work either. I'm using: "@sentry/react-native": "~5.20.0". Here's the full error output that I'm getting.

[RUN_FASTLANE] ⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » Pods/abseil » Build Phases » 'Create Symlinks to Header Folders'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script

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

[RUN_FASTLANE] ⚠️  Script has ambiguous dependencies causing it to run on every build.
   To fix, go to: Xcode » Ponder/Ponder » Build Phases » '[CP-User] [RNFB] Core Configuration'
   Either: Uncheck "Based on dependency analysis", or select output files to trigger the script

@krystofwoldrich
Copy link
Member

Hi @olddustysocksunderthecouch,
SENTRY_DISABLE_AUTO_UPLOAD=true disables the automatic upload, but the build phase still runs as the upload condition is evaluated inside of the build phase. The build phase will run run, but won't require any of the Sentry envs setup.

Script has ambiguous dependencies causing it to run on every build. is a warning and doesn't interfere with your build.

@zlanich
Copy link

zlanich commented May 12, 2024

Hey all! I got this to work. I found that even though I already have the SENTRY_AUTH_TOKEN in my eas.json, I still had to add the SENTRY_AUTH_TOKEN as a secret in Expo's EAS Cloud Dashboard as a secret in order for this to work, so there seems to be an issue with some variables in eas.json not being used in the build proces.

I hope this helps.

@TreeMan360
Copy link

This has been happening to me today. I have my SENTRY_AUTH_TOKEN set in Expo EAS as I have done for some time now and I push the credentials up from my machine using eas secret push as I always have. I have tested my auth token with a curl request and it is valid. It is also working with eas update. Do you have some kind of active API issue which is causing my iOS builds to fail? Android works fine. I am getting the same error as the above with Multiple commands produce and Script has ambiguous dependencies causing it to run on every build.

I have checked the Sentry status page and all is green. Not really sure what to do from here.

@olddustysocksunderthecouch

I eventually found the issue with my build! Hidden in the Xcode Logs output was a problem with the iOS distribution certificates and provisioning profiles. I deleted all of them locally (key chain) and on Apple Developers. I then recreated them with eas credentials, and then the build worked!

I wish the error message had been more obvious and easier to discover! Not finding it made me think poorly of Sentry because its warnings were outputted last in the build output, and I had to hunt through Xcode logs of a local iOS build instead. Weirdly, one of the Cloud eas builds succeeded, and another didn't indicate any issues, even in the Xcode logs. This prompted me to try building it locally (see these docs). You'll also need to set export EAS_LOCAL_BUILD_SKIP_CLEANUP=1 so the logs aren't destroyed after the build completes.

Anyway, I hope this helps some one.

Screenshot 2024-05-15 at 15 42 44

@TreeMan360
Copy link

Yeah I found my problem also it was a PrivacyInfo.xcprivacy duplication issue

@krystofwoldrich
Copy link
Member

@zlanich Could you share how your set the SENTRY_AUTH_TOKEN in eas.json? Possibly this is more of a Expo question, but I might be able to help.

@krystofwoldrich
Copy link
Member

@olddustysocksunderthecouch Thank you for the update, happy to hear that you find it and that it was not Sentry. I feel with you, the Xcode logs are difficult to navigate.

@krystofwoldrich
Copy link
Member

Yeah I found my problem also it was a PrivacyInfo.xcprivacy duplication issue

@TreeMan360 Anything we can help with? Or was it unrelated to Sentry?

@avogel3
Copy link

avogel3 commented Jun 27, 2024

I am seeing this warning as well. However, it's not preventing us from building the app. But our main.jsbundle is no longer uploading as a release artifact when running a full expo build, but the source maps are. Not sure if the message and the bundle missing are related..

We recently upgraded to Expo 50 and also did the migration from sentry-expo to the sentry react native package.

@krystofwoldrich
Copy link
Member

Hi @avogel3,
thank you for the message, the warning message is unrelated.

Could you open a new issue with details about the bundle and the source map? Could you include what do you see in Sentry, it the bundle 0 bytes or missing? Could you include Xcode log from Bundle React Native and images?

@avogel3
Copy link

avogel3 commented Jun 28, 2024

@krystofwoldrich Yeah, of course. Appreciate the fast response! 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expo Issues related to Sentry React Native Expo support Platform: React-Native
Projects
Status: No status
Status: No status
Status: Backlog
Development

No branches or pull requests

10 participants