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

SQLite error in Apptentive DB #71

Closed
eaceto opened this issue Nov 21, 2013 · 4 comments
Closed

SQLite error in Apptentive DB #71

eaceto opened this issue Nov 21, 2013 · 4 comments
Assignees
Milestone

Comments

@eaceto
Copy link

eaceto commented Nov 21, 2013

In my application I got the following exception

Fatal error. The database at /var/mobile/Applications/95709F07-B065-47F4-B338-CE48599EAA37/Library/Application Support/com.apptentive.feedback/ATDataModel.sqlite is corrupted. SQLite error code:11, 'database disk image is malformed'
APP-[ATAbstractMessage updateWithJSON:]

The stack trace is:

22 APP 0x001354fb -[ATAbstractMessage updateWithJSON:]
23 APP 0x001372dd -[ATTextMessage updateWithJSON:]
24 APP 0x00134f01 -[ATAutomatedMessage updateWithJSON:]
25 APP 0x00134ddf +[ATAutomatedMessage newInstanceWithJSON:]
26 APP 0x0013264f -[ATGetMessagesTask(Private) processResult:]
27 APP 0x001320c9 -[ATGetMessagesTask at_APIRequestDidFinish:result:]
28 APP 0x0010b6df -[ATAPIRequest connectionFinishedSuccessfully:]
29 Foundation 0x2f1b100d
30 Foundation 0x2f1b49c5
31 APP 0x000fc43f -[ATURLConnection connectionDidFinishLoading:]

How can I fix this in the following release of the app?

@wooster
Copy link
Contributor

wooster commented Nov 21, 2013

Hi @eaceto. We're sorry this is happening! We have one other report of this, and are trying to narrow down how it happens.

Some questions that will help us figure this out:

  • Was the app upgraded from a previous version? Which version of apptentive-ios did the previous version have?
  • Which iOS versions does this happen on?
  • Do you have any other third party libraries in the app? Which ones?
  • Do you use Core Data yourself in the app at all?
  • Are you able to reproduce this yourself?

If you can reproduce this yourself, I'd love to get a copy of the files of the app from the device you can reproduce the problem on.

At this point, it seems like the problem is resolved if users delete and reinstall the app. We're working hard to figure out a fix and will get it out as soon as we can!

@ghost ghost assigned wooster Nov 21, 2013
@wooster
Copy link
Contributor

wooster commented Nov 22, 2013

We think this was caused by SQLite on iOS 7 now using write ahead logging (WAL) by default, which is similar to the issue here:

http://pablin.org/2013/05/24/problems-with-core-data-migration-manager-and-journal-mode-wal/

We have a candidate fix available here:

https://github.com/apptentive/apptentive-ios/tree/MigrationFix

This fix does two things, it switches our Core Data database from WAL to the previous default (DELETE mode) on migration. So, any databases that get migrated from here on out won't use WAL. (I haven't been able to reliably move a database from WAL to DELETE without a migration.)

It also performs a sanity check on the database at startup and tries to detect the corruption we're seeing. If so, it deletes our database and starts over.

If this looks good, you may want to use it for your fix release. If you see any issues with it, please let me know. We're going to continue pounding on it on our end.

@pkamb
Copy link
Contributor

pkamb commented Nov 22, 2013

By the way, @eaceto, is this happening in a live app? If so, email me: [email protected] and we can use some over-the-air measures to reduce the likelyhood of this crash in your current live app.

@pkamb pkamb mentioned this issue Nov 22, 2013
@wooster
Copy link
Contributor

wooster commented Nov 23, 2013

We've just released v1.2.3, which we believe fixes these problems:

https://github.com/apptentive/apptentive-ios/releases/tag/v1.2.3

If it doesn't fix them for you, please let us know!

@wooster wooster closed this as completed Nov 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants