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

[5.0.0-alpha.7] "Upload Debug Symbols to Sentry" build step uploads unresolved release metadata on iOS #2581

Closed
5 of 11 tasks
AlexanderEggers opened this issue Oct 28, 2022 · 20 comments · Fixed by getsentry/sentry-cli#1403

Comments

@AlexanderEggers
Copy link

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

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

SDK version: 5.0.0-alpha.7

react-native version: 0.70.4

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

I have following issue:

After updating to 5.0.0-alpha.7, I noticed that the xcode build step "Upload Debug Symbols" does not resolve the global CURRENT_PROJECT_VERSION properly anymore. Instead of resolving that into the actual current build number, it just takes the property name calling the sentry release 0.1.0+$(CURRENT_PROJECT_VERSION). Other release details are broken as well including the package name.

Steps to reproduce:

  • Update to 5.0.0-alpha.7
  • Build ios and ensure that "Upload Debug Symbols" runs successfully
  • Go to sentry and you can see that your release contains a lot of unresolved meta data.

Actual result:

Broken release meta details on sentry.io.

Expected result:

Proper release meta details on sentry.io.

@AlexanderEggers AlexanderEggers changed the title [5.0.0-alpha.7] "Upload Debug Symbols to Sentry" build step broken for iOS [5.0.0-alpha.7] "Upload Debug Symbols to Sentry" build step uploads unresolved release metadata on iOS Oct 28, 2022
@bruno-garcia bruno-garcia moved this to Needs Discussion in Mobile & Cross Platform SDK Oct 28, 2022
@krystofwoldrich
Copy link
Member

Thank you for the information, this might be related to the bump CLI from v1.74.4 to v2.7.0. I'll take a look at it.

@krystofwoldrich
Copy link
Member

@AlexanderEggers Could you share your Upload Debug Symbols to Sentry script?

@AlexanderEggers
Copy link
Author

@krystofwoldrich this is my current script I am using for the build step: export SENTRY_PROPERTIES=sentry.properties\n../node_modules/@sentry/cli/bin/sentry-cli upload-dif \"$DWARF_DSYM_FOLDER_PATH\" --force-foreground --log-level debug\n

That used to work fine for any previous 5.0.0 alpha release - so it surprising that the latest one is breaking that integration. For example using alpha.6, my releases are properly uploaded including the right metadata.

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Oct 28, 2022

I've tried it with our sample app on the main branch and on the 5.0.0 and both behave the same. The release name is "Bundle version string (short)"+"Bundle version" from the Info.plist and the Package Name is PRODUCT_BUNDLE_IDENTIFIER from the project build settings.

Could you send me an example of how your releases changed and does it behave correctly when you roll back to the previous version of the RN SDK?

@AlexanderEggers
Copy link
Author

AlexanderEggers commented Oct 28, 2022

I have created a test release today using the latest alpha and my created release was called "0.1.0+$(CURRENT_PROJECT_VERSION)" (that is the actual name including the placeholder that is not replaced) on sentry.io - usually the name would be "0.1.0+1".

As I mentioned, when rolling back to a previous sentry version, it fixes my issue.
I haven't tried rolling back to a previous react-native version, that will take much more time in regards to testing.

RN 0.70.4 was working with all the previous alpha versions, so it is highly likely related to changes in the CLI package.

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Oct 28, 2022

Thanks for the clarification I thought the name was replaced with a version.

Could you check what version of the CLI you have in node_modules/@sentry/cli?

Did it happen only with one release or with all on the new alpha?

@AlexanderEggers
Copy link
Author

@krystofwoldrich According to its package.json, version 2.7.0 was installed.

That happened every time regardless how many times I was compiling the app.

@krystofwoldrich
Copy link
Member

Could you send a small example app for a repro? I can't reproduce it and it seems like we have the same SDK, the same CLI version.

@AlexanderEggers
Copy link
Author

Unfortunately that will take some time, I will try to take care of that by the end of next week. It is possible that this is very specific to my project, is there anything else I could try to provide which might help you?

@krystofwoldrich
Copy link
Member

If I think of something I'll let you know. For now, I'll wait for the repro.

@irothenbaum
Copy link

I'm experiencing the same/similar issue after updating to version 4.7.1, cli @ 2.8.0

For us, the entire release and dist labels are coming through un-interpolated. For example, instead of coming in as [email protected]+(1), it's coming in as $(PRODUCT_BUNDLE_IDENTIFIER)@$(MARKINEG_VERISON)+$(CURRENT_PROJECT_VERSION)

See screenshot:
image

Our Bundle React Native Code and Images script is

export NODE_BINARY=$(which node)
export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
export SENTRY_PROPERTIES=sentry.properties

../node_modules/@sentry/cli/bin/sentry-cli react-native xcode --force-foreground
  ../node_modules/react-native/scripts/react-native-xcode.sh

and our Upload Debug Symbols to Sentry script is:

export SENTRY_PROPERTIES=sentry.properties
[[ $SENTRY_INCLUDE_NATIVE_SOURCES == "true" ]] && INCLUDE_SOURCES_FLAG="--include-sources" || INCLUDE_SOURCES_FLAG=""

../node_modules/@sentry/cli/bin/sentry-cli debug-files upload "$INCLUDE_SOURCES_FLAG"

@krystofwoldrich
Copy link
Member

@irothenbaum What command are you using to build your app or are you using Xcode GUI?

@irothenbaum
Copy link

We're using the Xcode GUI. Product -> Archive

@Thanaen
Copy link

Thanaen commented Nov 2, 2022

Hi!
I just want to add that I have the same issue, but I'm building the app with Fastlane.
On the Sentry "Versions" page, my latest version is displayed as "$(PRODUCT_BUNDLE_IDENTIFIER)@x.y.z+XX

Update:
In fact, in the "Versions" tab, the version I just published appears twice.
Once with the correct package name, but without any artifacts, and once with the generic package name but with artifacts.

Another strange thing is that Sentry tells me that the version with the correct package name was created earlier than the version with the generic package name. That's weird.

@krystofwoldrich
Copy link
Member

The values should be read from the Xcode environment or Info.plist file. When you check Bundle React Native code and images and Upload Debug Symbols to Sentry build phases, you should see the correct values.

Example:

...
  export PRODUCT_BUNDLE_IDENTIFIER\=io.sentry.sample
...

@Thanaen Could you create a minimal example app where we can reproduce the issue and upload a repo link or archive?

@marandaneto marandaneto moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Nov 8, 2022
@marandaneto
Copy link
Contributor

Any updates here @AlexanderEggers ?

@krystofwoldrich
Copy link
Member

I've opened PR in sentry-cli which fixes this issue.

@krystofwoldrich krystofwoldrich moved this from Needs More Information to In Progress in Mobile & Cross Platform SDK Nov 23, 2022
Repository owner moved this from In Progress to Done in Mobile & Cross Platform SDK Nov 24, 2022
@AlexanderEggers
Copy link
Author

@krystofwoldrich Do you know when this fix will be available in a 4.x or 5.x release?

@kamilogorek
Copy link
Contributor

FYI, fix was released in [email protected].

@irothenbaum
Copy link

Confirmed this solved it for us. Thank you!

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

Successfully merging a pull request may close this issue.

6 participants