sentry-unity icon indicating copy to clipboard operation
sentry-unity copied to clipboard

After updating Sentry iOS Symbol Upload Fails

Open marcos-monumental opened this issue 2 years ago • 13 comments
trafficstars

Environment

How do you use Sentry? Sentry SaaS

Which version of the SDK? We are upgrading from 17.0.

We tried to upgrade months ago to version 22.1 and ran into this issue. Tried again now with 26.0 and 27.0 and running into the exact same issue.

How did you install the package? (Git-URL, Assetstore) Git-URL

Which version of Unity? 2019.4.39f1

Is this happening in Unity (editor) or on a player like Android, iOS, Windows? Editor, at build time, only when building for iOS. All other platforms build successfully.

Steps to Reproduce

  1. Upgrade the git URL to go from 17.0 to a newer version (tried 22.1, 26.0, and 27.0)
  2. Kick an iOS build
  3. Unity-side of build completes successfully and XCode build will begin

Expected Result

The XCode build completes and symbols are uploaded successfully.

Actual Result

The XCode build completes, but symbols fail to upload (and the build is treated as a failure).

The build logs for the failure:

Uploading debug symbols and bcsymbolmaps (Bitcode enabled).
  INFO    2022-12-05 16:41:44.861780 -06:00 Loaded file referenced by SENTRY_PROPERTIES (sentry.properties)
  INFO    2022-12-05 16:41:44.862689 -06:00 sentry-cli was invoked with the following command line: "./sentry-cli-Darwin-universal" "upload-dif" "--force-foreground" "--il2cpp-mapping" "--include-sources" "/Users/jenkins/Library/Developer/Xcode/DerivedData/Unity-iPhone-hauzkwhtmeovjubpaozltvvplbru/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos"
  INFO    2022-12-05 16:41:44.862710 -06:00 Issuing a command for Organization: monumentalllc Project: mythgard
error: Could not parse Info.plist file
  caused by: MARKETING_VERSION is missing
Command PhaseScriptExecution emitted errors but did not return a nonzero exit code to indicate failure`

Sentry-Symbols-Upload.log:

error: Could not parse Info.plist file
  caused by: InvalidXmlSyntax (line 0, column 0)

I've looked at our Info.plist and it seems to be in the correct location and proper.

marcos-monumental avatar Dec 05 '22 23:12 marcos-monumental

Hey, sorry you're running into issues. Which version of Xcode are you using?

bitsandfoxes avatar Dec 06 '22 08:12 bitsandfoxes

We are running Xcode 13.3.1

marcos-monumental avatar Dec 06 '22 16:12 marcos-monumental

It's odd. I can't reproduce the issue but I can confirm that this is coming from sentry-cli trying to parse the Info.plist. I don't really understand how or why the property is missing. Trying this locally, my Info.plist does not have the property either. Xcode does show it tho. Let me get back to you with more answers once I have them.

bitsandfoxes avatar Dec 07 '22 17:12 bitsandfoxes

Hey @marcos-monumental, could you provide me your Info.plist? Feel free to send it to [email protected]

bitsandfoxes avatar Dec 09 '22 13:12 bitsandfoxes

Hey @bitsandfoxes sorry for the delay in response, I wanted to look into a few more things and then suddenly holidays were here.

I've just sent you our plist to that email, but I don't think that's the cause of the issue.

I think we've actually never successfully uploaded symbols due to this failure to find the plist, but it wasn't until this MARKETING_VERSION fallback failed that it failed hard enough to stop our build process, on Unity Sentry 17.0 it fails quietly.

We've realized that if we pass a plist argument to the sentry-cli command used in the SymbolUpload build phase of Xcode it will find the plist no problem and upload symbols successfully.

image

We're pretty sure this is the default location for the plist, so it seems odd we'd need to pass this in.

Do you know why sentry-cli would be failing to find it at the default location?

We were hoping we could pass this plist parameter via the Buildtime Options script, but from what we can tell that's not really possible. Maybe we're missing something, if you have any suggestions for how to add the plist argument as part of the automatic debug symbol upload that'd be great.

Thanks

marcos-monumental avatar Jan 11 '23 16:01 marcos-monumental

Thanks for coming back to us with this one.

We were hoping we could pass this plist parameter via the Buildtime Options script, but from what we can tell that's not really possible.

Unfortunately, you're right. It does not work right now but it would be the ideal place to add to the arguments we pass down to cli and a very valid feature request.

We'll be looking into why sentry cli fails to find the Info.plist and I'll come back to you once I know more.

bitsandfoxes avatar Jan 17 '23 11:01 bitsandfoxes

@marcos-monumental: One thing that strikes me as odd: Sentry CLI should be looking for the for the project's Info.plist. And you're providing the path to the one inside the built app? I take it the one you've sent me is the app's? Could I ask you to send me the one from the Xcode project as well?

bitsandfoxes avatar Jan 18 '23 16:01 bitsandfoxes

That's a great point... @bitsandfoxes, we will get you the proper project plist as soon as we can (working with another dev on this, as I'm on Windows)

marcos-monumental avatar Jan 18 '23 18:01 marcos-monumental

@bitsandfoxes I have just sent you some more .plists as they appear in our xcode project folder.

marcos-monumental avatar Jan 19 '23 17:01 marcos-monumental

@bitsandfoxes sorry for @ spam, but a quick follow up that I think is relevant. We enabled info level logging and this is what we see in the sentry upload logs now:

INFO 2023-01-19 10:27:22.116765 -06:00 sentry-cli was invoked with the following command line: "./sentry-cli-Darwin-universal" "upload-dif" "/Users/jenkins/Library/Developer/Xcode/DerivedData/Unity-iPhone-hauzkwhtmeovjubpaozltvvplbru/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos" INFO 2023-01-19 10:27:22.117234 -06:00 Issuing a command for Organization: monumentalllc Project: [redacted] error: Could not parse Info.plist file caused by: InvalidXmlSyntax (line 0, column 0)

Is that the location that Sentry expects $BUILT_PRODUCTS_DIR to be pointing to? Its clearly not in the xcode project folder, and is ultimately looking at a symbolically linked location that doesn't exist.

marcos-monumental avatar Jan 19 '23 18:01 marcos-monumental

@marcos-monumental, yes. That does look like the correct $BUILT_PRODUCTS_DIR. That is where the build output ends up at. The Xcode's Info.plist is something that Sentry CLI looks for separately. @kamilogorek is there a way to output which/where Sentry CLI gets stuck on? The Info.plist I received pass as valid XML.

bitsandfoxes avatar Jan 24 '23 16:01 bitsandfoxes

Not really, sorry. I'm more than happy to accept a PR that will improve debug logging there though :)

kamilogorek avatar Jan 27 '23 16:01 kamilogorek

@marcos-monumental does this issue still persist for you with the current version?

bitsandfoxes avatar May 25 '23 08:05 bitsandfoxes

Closing this as stale.

bitsandfoxes avatar Apr 05 '24 14:04 bitsandfoxes