Open
Description
Description
When checking the test logs in CI we can see that the SentryFileManager spams the logs with fatal messages like the following ones
[Sentry] [fatal] [timeIntervalSince1970:1748454849.6005049] [SentryFileManager:63] Failed to create directory, path is too long: (null)
[Sentry] [fatal] [timeIntervalSince1970:1748454849.6005502] [SentryFileManager:140] Failed to create Sentry SDK working directory: (null)
[Sentry] [fatal] [timeIntervalSince1970:1748454849.6008] [SentryFileManager:63] Failed to create directory, path is too long: (null)
[Sentry] [fatal] [timeIntervalSince1970:1748454849.600837] [SentryFileManager:140] Failed to create Sentry SDK working directory: (null)
[Sentry] [fatal] [timeIntervalSince1970:1748454849.605884] [SentryFileManager:63] Failed to create directory, path is too long: (null)
[Sentry] [fatal] [timeIntervalSince1970:1748454849.605921] [SentryFileManager:140] Failed to create Sentry SDK working directory: (null)
[Sentry] [fatal] [timeIntervalSince1970:1748454849.606196] [SentryFileManager:63] Failed to create directory, path is too long: (null)
[Sentry] [fatal] [timeIntervalSince1970:1748454849.60624] [SentryFileManager:140] Failed to create Sentry SDK working directory: (null)
You can reproduce this by running the unit tests SentrySerializationTests
on iOS. The clearTestState
calls SentrySDK.close, which then calls AppStateManager, which tries to init a FileManager, but the options are nil.
The SentryDependencyContainer.fileManger property is nonnullable, but it actually return nil
when there are no options bound to the SDK.
A PR that could be related to fixing this problem is #5315, which will require passing in the options when retrieving a file manager.
An easy fix is that the SentryFileManager doesn't print a fatal error message when passing in nil for the options.