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

clearAllData emits errors #2239

Closed
martin-muller opened this issue Mar 21, 2025 · 2 comments · Fixed by #2240
Closed

clearAllData emits errors #2239

martin-muller opened this issue Mar 21, 2025 · 2 comments · Fixed by #2240
Labels
bug Something isn't working

Comments

@martin-muller
Copy link

Describe the bug

Calling clearAllData on initialised Datadog SDK emits errors to console, all created files seem to be deleted.

Reproduction steps

Sample project: https://github.com/martin-muller/dd-test

  1. Initialise DD SDK
    Datadog.initialize(
        with: Datadog.Configuration(
            clientToken: "{redacted}",
            env: "dev",
            site: .us1
        ),
        trackingConsent: .pending
    )

    Logs.enable()
    Trace.enable()
    RUM.enable(with: RUM.Configuration(applicationID: "{redacted}"))

    SessionReplay.enable(
        with: SessionReplay.Configuration(
            textAndInputPrivacyLevel: .maskAllInputs,
            imagePrivacyLevel: .maskNone,
            touchPrivacyLevel: .show,
            featureFlags: [.swiftui: true]
        )
    )
  1. Call clearAllData
Datadog.clearAllData()

SDK logs

[DATADOG SDK] 🐶 → 12:03:07.602 🔥 [Data Store] Error on clearing all data for `logging`

Error details:
→ type: InternalError
→ message: Path doesn't exist or is not a directory: file:///Users/martinmuller/Library/Developer/CoreSimulator/Devices/87DE0516-5283-4F4E-AEAC-2A8EF8B23678/data/Containers/Data/Application/4ECA2FDD-9826-4E65-A8BC-B26D8E826F44/Library/Caches/com.datadoghq/v2/f5da9c34155155fa15554148a8a2d145170e0a082ddf9cba39ea3a198b2bb947/1/logging/
→ stack: Path doesn't exist or is not a directory: file:///Users/martinmuller/Library/Developer/CoreSimulator/Devices/87DE0516-5283-4F4E-AEAC-2A8EF8B23678/data/Containers/Data/Application/4ECA2FDD-9826-4E65-A8BC-B26D8E826F44/Library/Caches/com.datadoghq/v2/f5da9c34155155fa15554148a8a2d145170e0a082ddf9cba39ea3a198b2bb947/1/logging/
[DATADOG SDK] 🐶 → 12:03:07.605 🔥 [Data Store] Error on clearing all data for `session-replay`

Error details:
→ type: InternalError
→ message: Path doesn't exist or is not a directory: file:///Users/martinmuller/Library/Developer/CoreSimulator/Devices/87DE0516-5283-4F4E-AEAC-2A8EF8B23678/data/Containers/Data/Application/4ECA2FDD-9826-4E65-A8BC-B26D8E826F44/Library/Caches/com.datadoghq/v2/f5da9c34155155fa15554148a8a2d145170e0a082ddf9cba39ea3a198b2bb947/1/session-replay/
→ stack: Path doesn't exist or is not a directory: file:///Users/martinmuller/Library/Developer/CoreSimulator/Devices/87DE0516-5283-4F4E-AEAC-2A8EF8B23678/data/Containers/Data/Application/4ECA2FDD-9826-4E65-A8BC-B26D8E826F44/Library/Caches/com.datadoghq/v2/f5da9c34155155fa15554148a8a2d145170e0a082ddf9cba39ea3a198b2bb947/1/session-replay/
[DATADOG SDK] 🐶 → 12:03:07.605 🔥 [Data Store] Error on clearing all data for `tracing`

Error details:
→ type: InternalError
→ message: Path doesn't exist or is not a directory: file:///Users/martinmuller/Library/Developer/CoreSimulator/Devices/87DE0516-5283-4F4E-AEAC-2A8EF8B23678/data/Containers/Data/Application/4ECA2FDD-9826-4E65-A8BC-B26D8E826F44/Library/Caches/com.datadoghq/v2/f5da9c34155155fa15554148a8a2d145170e0a082ddf9cba39ea3a198b2bb947/1/tracing/
→ stack: Path doesn't exist or is not a directory: file:///Users/martinmuller/Library/Developer/CoreSimulator/Devices/87DE0516-5283-4F4E-AEAC-2A8EF8B23678/data/Containers/Data/Application/4ECA2FDD-9826-4E65-A8BC-B26D8E826F44/Library/Caches/com.datadoghq/v2/f5da9c34155155fa15554148a8a2d145170e0a082ddf9cba39ea3a198b2bb947/1/tracing/

Expected behavior

Don't emit errors if data has been successfully cleared.

Affected SDK versions

2.24.0

Latest working SDK version

We're at the process of integrating DD, haven't tested previous versions

Did you confirm if the latest SDK version fixes the bug?

Yes

Integration Methods

SPM

Xcode Version

Xcode 16.2 Build version 16C5032a

Swift Version

Swift 6.0.3 (6.0.3.1.10)

MacOS Version

15.3.2 (24D81)

Deployment Target

iOS 16, iPhone

Device Information

No response

Other relevant information

No response

@martin-muller martin-muller added the bug Something isn't working label Mar 21, 2025
@maxep
Copy link
Member

maxep commented Mar 21, 2025

Hey @martin-muller 👋

Thank you very much for the detailed report and sample project, I'm able to reproduce 👍
We will keep you posted with our findings

ncreated added a commit that referenced this issue Mar 24, 2025
when data store directory does not yet exist
ncreated added a commit that referenced this issue Mar 24, 2025
…l-data-errors

GH-2239 chore: Refine errors printed from `clearAllData()`
@ncreated
Copy link
Member

Hey @martin-muller 👋. We managed to fix the problem - #2240 was merged and will be available in next regular release. Thanks for reporting the issue 🙂!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants