sentry-cocoa: Issues not showing up

Platform

iOS

Installed

Swift Package Manager

Version

8.3.3

Steps to Reproduce

I’m unable to get my first test issue to show up in the dashboard. I’m doing the following to capture an explicit error and then causing a crash.

    let error = NSError(domain: "TestDomain", code: 0, userInfo: nil)
    SentrySDK.capture(error: error)
    
    let foo: String? = nil
    print("\(foo!)") // app crash

Expected Result

Issues should show up in the dashboard.

Actual Result

I run the above code without debugger attached. The app crashes. Then I run it with the debugger. Sentry logs suggest it is unable to write to disk and I guess that’s why it has nothing to report, but why would that be, when it’s supposed to work out of the box?

2023-04-02 18:47:58.319242-0300 VinylFetish[47262:35012824] [Sentry] [error] [SentryFileManager:439] Failed to write data to path /Users/gbuela/Library/Developer/CoreSimulator/Devices/F5A4076F-6732-4BF9-9F2E-8052396F1472/data/Containers/Data/Application/8F8BA547-31C2-4ADE-AC3C-5BD68E4D1840/Library/Caches/io.sentry/3678b2e22cce07233ae7f4dd71f0bbd83a2bbdca/envelopes/1680472078.318794-00002-B5F2F3B3-8F5B-4D26-AA82-6DA35CFF2A63.json: Error Domain=NSCocoaErrorDomain Code=4 "La carpeta “1680472078.318794-00002-B5F2F3B3-8F5B-4D26-AA82-6DA35CFF2A63.json” no existe." UserInfo={NSFilePath=/Users/gbuela/Library/Developer/CoreSimulator/Devices/F5A4076F-6732-4BF9-9F2E-8052396F1472/data/Containers/Data/Application/8F8BA547-31C2-4ADE-AC3C-5BD68E4D1840/Library/Caches/io.sentry/3678b2e22cce07233ae7f4dd71f0bbd83a2bbdca/envelopes/1680472078.318794-00002-B5F2F3B3-8F5B-4D26-AA82-6DA35CFF2A63.json, NSUserStringVariant=Folder, NSUnderlyingError=0x600003ee0000 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2023-04-02 18:47:58.319352-0300 VinylFetish[47262:35012824] [Sentry] [warning] [SentryFileManager:425] Failed to store data.
2023-04-02 18:47:58.319584-0300 VinylFetish[47262:35012824] [Sentry] [error] [SentryFileManager:231] Couldn't load files in folder /Users/gbuela/Library/Developer/CoreSimulator/Devices/F5A4076F-6732-4BF9-9F2E-8052396F1472/data/Containers/Data/Application/8F8BA547-31C2-4ADE-AC3C-5BD68E4D1840/Library/Caches/io.sentry/3678b2e22cce07233ae7f4dd71f0bbd83a2bbdca/envelopes: Error Domain=NSCocoaErrorDomain Code=260 "La carpeta “envelopes” no existe." UserInfo={NSUserStringVariant=(
), NSFilePath=/Users/gbuela/Library/Developer/CoreSimulator/Devices/F5A4076F-6732-4BF9-9F2E-8052396F1472/data/Containers/Data/Application/8F8BA547-31C2-4ADE-AC3C-5BD68E4D1840/Library/Caches/io.sentry/3678b2e22cce07233ae7f4dd71f0bbd83a2bbdca/envelopes, NSUnderlyingError=0x600003e987e0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2023-04-02 18:47:58.319660-0300 VinylFetish[47262:35012824] [Sentry] [debug] [SentryHttpTransport:251] sendAllCachedEnvelopes start.
2023-04-02 18:47:58.319865-0300 VinylFetish[47262:35012824] [Sentry] [error] [SentryFileManager:231] Couldn't load files in folder /Users/gbuela/Library/Developer/CoreSimulator/Devices/F5A4076F-6732-4BF9-9F2E-8052396F1472/data/Containers/Data/Application/8F8BA547-31C2-4ADE-AC3C-5BD68E4D1840/Library/Caches/io.sentry/3678b2e22cce07233ae7f4dd71f0bbd83a2bbdca/envelopes: Error Domain=NSCocoaErrorDomain Code=260 "La carpeta “envelopes” no existe." UserInfo={NSUserStringVariant=(
), NSFilePath=/Users/gbuela/Library/Developer/CoreSimulator/Devices/F5A4076F-6732-4BF9-9F2E-8052396F1472/data/Containers/Data/Application/8F8BA547-31C2-4ADE-AC3C-5BD68E4D1840/Library/Caches/io.sentry/3678b2e22cce07233ae7f4dd71f0bbd83a2bbdca/envelopes, NSUnderlyingError=0x600003e98810 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
2023-04-02 18:47:58.319942-0300 VinylFetish[47262:35012824] [Sentry] [debug] [SentryHttpTransport:263] No envelopes left to send.
2023-04-02 18:47:58.320009-0300 VinylFetish[47262:35012824] [Sentry] [debug] [SentryHttpTransport:342] Finished sending.

Note: I see the app version showing up in Releases, indicating there isn’t an issue connecting to the server and with my project. Note 2: The above is a simulator log but I the same thing on device.

Are you willing to submit a PR?

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Hello @gbuela. You’re right, this is supposed to work out of the box. I will investigate this, and meanwhile, do you mind sharing the iOS version you’re using for test, and also the options you use to initialize SentrySDK (dont need to share your DSN)?

I face the same issue, just updated from 8.3.1 to 8.3.3 and when I test if the crashes are still reported then nothing shows up. When I use SentrySDK.crash() or

        let crashArray = [1]
        let crash = crashArray[12]
        print("\(crash)")

nothing gets reported. Log events still work.