Update of Couchbase Lite Database from 1.4 objective C version to 2.0.1 Swift version fails on iOS


#1

Hello,

updating Couchbase Lite Database from 1.4 objective C version to 2.0.1 Swift version caused multiple errors:

CouchbaseLite Info: Upgrader finished

CouchbaseLite WARNING: SQLite error (code 1802): statement aborts at 1: [PRAGMA user_version] disk I/O error

CouchbaseLite WARNING: SQLite error (code 28): file renamed while open: /var/mobile/Containers/Data/Application/8795402F-5CCB-4DE5-8D6B-B9CA098B68D0/Library/Application Support/CouchbaseLite/app-data.cblite2_TEMP/db.sqlite3

I made sure that I am not using ForestDB or encryption. Following the documentation, the database should update automatically and be ready to use again. On my test device, the app crashes showing the two errors. After opening it again, the database seems to be entirely deleted. How can I maintain data saved to the 1.4 database in 2.0.1?

Best regards and thanks in advance


#2

That definitely shouldn’t be happening; I’ve never seen that behavior before.

It looks as though the database created by the updater didn’t get closed before the updater moved it into place. Could you please file a bug report?

Do you happen to have the entire log, and are there any previous messages from the updater?
What iOS version is this?
Is this repeatable?


#3

Those are previous messages from the upgrader:

2018-08-29 10:58:49.991063+0200 Lengo[3143:1631360] CouchbaseLite Info: Upgrader upgrading db </var/mobile/Containers/Data/Application/8795402F-5CCB-4DE5-8D6B-B9CA098B68D0/Library/Application Support/CouchbaseLite/app-data.cblite2/>; creating new db at </var/mobile/Containers/Data/Application/8795402F-5CCB-4DE5-8D6B-B9CA098B68D0/Library/Application Support/CouchbaseLite/app-data.cblite2_TEMP/>

2018-08-29 10:58:50.019607+0200 Lengo[3143:1631360] CouchbaseLite Info: Upgrading CBL 1.x database </var/mobile/Containers/Data/Application/8795402F-5CCB-4DE5-8D6B-B9CA098B68D0/Library/Application Support/CouchbaseLite/app-data.cblite2/>, user_version=102)

then: Importing doc “My Docs” multiple times and after that the error as above.

For my tests I am using the latest iOS Version 11.4.1.

In case you have any idea what I could try to make it work, please let me know.


#4

Hmm. Are you opening multiple Database instances on the same file at startup time, perhaps? (If you could provide the entire log, that would be great. Either pasted into a gist, or you can email it to me directly, jens at couchbase dot com.)


#5

I don’t think I open multiple Database instances at the same file. Things are pretty much as described in the documentation, just that I have some things in didFinishLaunchingWithOptions instead of a ViewController. But that doesn’t correlate with the issue I guess. Nevertheless, I’ve emailed you the entire log.