Automattic / Automattic/Automattic-Tracks-iOS

TracksPersistentStoreException - Error initializing Tracks: Error Domain=NSSQLiteErrorDomain

Open
#209 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
47
Forks
15
Avg merge
7h 58m
Merged PRs (30d)
1

Description

I'm not entirely sure if this is coming from the AutomatticTracks pod or is something else in the WCiOS implementation, as the crash seemed to happen when attempting to create the `persistentStoreCoordinator`, but this last bit in the stack trace caught my attention:

```
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) {
// Replace this with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
TracksLogError(@"Unresolved error %@, %@", error, [error userInfo]);

@throw [NSException exceptionWithName:TracksPersistentStoreException
reason:[NSString stringWithFormat:@"Error initializing Tracks: %@", error]
userInfo:error.userInfo];
}
```

```
TracksPersistentStoreException
Error initializing Tracks: Error Domain=NSSQLiteErrorDomain Code=13 "(null)" UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/425A1933-DC91-4E12-9739-A08822A585D0/Library/Application Support/com.automattic.woocommerce/Tracks.sqlite, NSSQLiteErrorDomain=13}
```

I checked a bit and seems to point to a "not enough memory" error, however the logs show Free Memory of 324.5 MiB at the time of the crash, which should be enough from my tests 🤔

Sentry Issue: [WOOCOMMERCE-IOS-1DHC](https://sentry.io/organizations/a8c/issues/3508408936/?referrer=github_integration)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.