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

Allow uploading macOS and iOS crash files (ips) manually

Open tonyarnold opened this issue 3 years ago • 18 comments

Problem Statement

Some of our users provide the raw crash logs from their Apple devices in .ips format. It would be really helpful to be able to upload these via the web UI, and the CLI.

Solution Brainstorm

No response

tonyarnold avatar Jul 14 '22 04:07 tonyarnold

Routing to @getsentry/team-mobile for triage. ⏲️

getsentry-release avatar Jul 14 '22 13:07 getsentry-release

Hey @tonyarnold, the raw crashlog in .ips format already contains much information. Can you please answer the following questions to understand your use case better:

  1. Why do you want to upload it to Sentry?
  2. What would be the benefit for you?
  3. Is there a reason why you can't run the Cocoa SDK on your users' devices?

philipphofmann avatar Jul 18 '22 08:07 philipphofmann

Sure can, thanks for the response @philipphofmann!

  1. Some of our customers provide .ips or .crash files from their macOS systems directly to us, rather than submitting them via Sentry (which is integrated into the app) - this can be for a variety of reasons, but generally it's due to corporate network policies.
  2. Uploading these manually provided crashlogs means that we have continuity of the issues we're facing at any point in time - I really don't want to miss an issue that only occurs in very specific network environments, and Sentry obviously nicely symbolicates and links to the affected commits/source if it's possible to do so.
  3. We do. As I mentioned above, often they can't use this method of submission due to corporate network policies.

tonyarnold avatar Jul 18 '22 11:07 tonyarnold

Updating the status based on the above. Please let me know if it should be something else!

kerenkhatiwada avatar Jul 19 '22 19:07 kerenkhatiwada

I feel like I've provided the information requested. If there's more required, I'm happy to help - just ask!

tonyarnold avatar Jul 19 '22 22:07 tonyarnold

@tonyarnold, Sentry doesn't support your desired use case at the moment, as we don't have endpoints to upload or parse .ips or .crash files today. We don't have plans to add support for that soon, as we don't see a high demand for that feature.

A workaround for you would be to write a script that transforms the .ips file to our event schema on your machine and send it to us. If you plan on scripting this, sending the events with sentry-cli could be handy. It would be awesome to share the script with us here if you do.

Solution Brainstorm

According to @jan-auer, we have the capability to parse apple crash report files internally, but that's not exposed via an ingestion endpoint. We could also discuss adding this functionality to sentry-cli.

philipphofmann avatar Jul 22 '22 06:07 philipphofmann

Thanks, @philipphofmann - I appreciate the detailed response!

I understand that this isn't going to be a highly demanded feature. I was hoping that there was an API endpoint I could poke them at, but that's okay - we'll make do with what we have for the time being. If I end up writing a script to convert the files to an event schema record, I'll be sure to share it here.

tonyarnold avatar Jul 24 '22 22:07 tonyarnold

We at Playrix support this issue. Other services have such option. For example:

https://github.com/bugsnag/apple-crash-report-uploader https://learn.microsoft.com/en-us/appcenter/diagnostics/upload-crashes-ui

s-shestakov avatar Jul 31 '23 07:07 s-shestakov

cc @ashwoods

kahest avatar Aug 16 '23 12:08 kahest

I investigated this issue as https://github.com/getsentry/sentry-unreal already uses some type of apple crash reports.

The envelope endpoint of Relay has an envelope attachment type of AppleCrashReport. You can manually ingest envelopes with an AppleCrashReport attachment.

Ingesting envelope-with-ips.json doesn't work properly via sentry-cli sentry-cli send-envelope envelope-with-ips.json. The event looks empty CleanShot 2023-10-16 at 15 32 25@2x

So I guess we need some changes in Relay to support the JSON format of .ips files following these docs: https://developer.apple.com/documentation/xcode/interpreting-the-json-format-of-a-crash-report#IPS-metadata.

What works is sending Xcode crash reports in the following format. Here is the full content of the envelope you can send via sentry-cli send-envelope working-envelope.json

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 949B74EE-3050-4CFA-97C2-EA30CEBBA2AD
Beta Identifier:     8CB9B451-8C4B-489B-8DD2-68FA5C5ABE90
Hardware Model:      iPhone13,2
Process:             iOS-Swift [18979]
Path:                /private/var/containers/Bundle/Application/4E6431AE-1C3F-41D8-B668-B6D3700486E3/iOS-Swift.app/iOS-Swift
Identifier:          io.sentry.sample.iOS-Swift
Version:             8.13.0 (1295)
AppStoreTools:       15A240a
AppVariant:          1:iPhone13,2:17
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           io.sentry.sample.iOS-Swift [2067]

Date/Time:           2023-10-12 16:38:35.5421 +0200
Launch Time:         2023-10-09 16:06:26.6597 +0200
OS Version:          iPhone OS 17.0.3 (21A360)
Release Type:        User
Baseband Version:    4.06.01
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000010085ae74
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [18979]

Triggered by Thread:  0

Thread 0 name:   Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   Sentry                        	       0x10085ae74 +[SentrySDK crash] + 0
1   UIKitCore                     	       0x1b1f23204 -[UIApplication sendAction:to:from:forEvent:] + 100
2   Sentry                        	       0x100841380 __49-[SentrySwizzleWrapper swizzleSendAction:forKey:]_block_invoke_2 + 152
3   UIKitCore                     	       0x1b18d2514 -[UIControl sendAction:to:forEvent:] + 112
4   UIKitCore                     	       0x1b18d288c -[UIControl _sendActionsForEvents:withEvent:] + 324
5   UIKitCore                     	       0x1b18cfeb0 -[UIButton _sendActionsForEvents:withEvent:] + 124
6   UIKitCore                     	       0x1b18d19bc -[UIControl touchesEnded:withEvent:] + 400
7   UIKitCore                     	       0x1b132dad0 -[UIWindow _sendTouchesForEvent:] + 776
8   UIKitCore                     	       0x1b132d474 -[UIWindow sendEvent:] + 3204
9   UIKitCore                     	       0x1b132c6f4 -[UIApplication sendEvent:] + 560
10  UIKitCore                     	       0x1b12eed34 __dispatchPreprocessedEventFromEventQueue + 6492
11  UIKitCore                     	       0x1b12ed038 __processEventQueue + 5540
12  UIKitCore                     	       0x1b12eba48 updateCycleEntry + 160
13  UIKitCore                     	       0x1b11d2d40 _UIUpdateSequenceRun + 84
14  UIKitCore                     	       0x1b11d2430 schedulerStepScheduledMainSection + 144
15  UIKitCore                     	       0x1b11d24ec runloopSourceCallback + 92
16  CoreFoundation                	       0x1aef4cacc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
17  CoreFoundation                	       0x1aef4bd48 __CFRunLoopDoSource0 + 176
18  CoreFoundation                	       0x1aef4a4fc __CFRunLoopDoSources0 + 244
19  CoreFoundation                	       0x1aef49238 __CFRunLoopRun + 828
20  CoreFoundation                	       0x1aef48e18 CFRunLoopRunSpecific + 608
21  GraphicsServices              	       0x1f1a0d5ec GSEventRunModal + 164
22  UIKitCore                     	       0x1b13572fc -[UIApplication _run] + 888
23  UIKitCore                     	       0x1b1356938 UIApplicationMain + 340
24  iOS-Swift                     	       0x1002aeec0 0x1002a8000 + 28352
25  dyld                          	       0x1d1733d44 start + 2104

...

The event in Sentry looks like this:

CleanShot 2023-10-16 at 15 35 09@2x

philipphofmann avatar Oct 16 '23 13:10 philipphofmann

As this issue is already over 2 years old, and seems to be a use case we will not try to support in the near future at least via the UI. It could be that this is more a requirement for the sentry-cli

In which case a feature request should be opened there, if there is still interest. Otherwise I will close this issue.

smeubank avatar Dec 13 '24 14:12 smeubank

Closing this makes sense.

philipphofmann avatar Dec 16 '24 09:12 philipphofmann

I hit this today and can provide a little more context as to when this can happen in the iOS developer cycle.

When submitting to the App Store Apple can fail your submission if your app crashes during their testing. When this happens they will provide a small description (far too small 😆) and a few raw .ips files.

I find symbolicating these crashes extra painful and I think Sentry might be great at it. There is years of mixed documentation on the matter and in the end most tooling seems to just wrap atos. Finding the extact dSYMs can also be a pain for us.

Sentry already has all of our symbols from our CI/CD pipelines. I'd love to be able to manually submit an Apple .ips to Sentry and have it do its normal magic.

JakeShirley avatar Jul 28 '25 16:07 JakeShirley

Thanks for the context, @JakeShirley.

We (@szokeasaurusrex and @kahest) just discussed this internally, and we agreed that it makes sense to do this via the sentry-cli. The sentry-cli can parse the ips file format, convert it to a SentryEvent, and then upload it to Sentry. Therefore, we move this issue to sentry-cli.

We can't give you an ETA for this, @JakeShirley. If you really need this now, you could try to manually parse the ips file and convert it into a Sentry event with any Sentry SDK of your choice.

philipphofmann avatar Jul 29 '25 10:07 philipphofmann

I'd just like to second @JakeShirley's use case:

We have an app that's failing submision to the iOS store. Our app was built with React Native Expo, and we don't have easy access to a Mac computer, so it'd be nice to be able to manually upload our .ips and .dsym files and have Sentry symbolicate the crash report for us :)

neoncube2 avatar Dec 07 '25 08:12 neoncube2

@s-shestakov BTW, I tried out the BugSnag Apple Crash Report Uploader, and it looks like it supports uploading .crash files but not .ips files: https://github.com/bugsnag/apple-crash-report-uploader :)

neoncube2 avatar Dec 07 '25 08:12 neoncube2