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

Potential database upgrade error #711

Closed
snej opened this issue May 16, 2015 · 3 comments
Closed

Potential database upgrade error #711

snej opened this issue May 16, 2015 · 3 comments

Comments

@snej
Copy link
Contributor

snej commented May 16, 2015

In this forum post a developer says they upgraded the CBL framework to the 1.1 candidate and their app can no longer open its database due to an invalid-ID error.

This error doesn't make sense for opening the database itself (the database name is valid, and it's an already-existing database) so I'm worried that it comes from within the upgrade process -- that somehow a document ID that was considered valid before is being rejected when it's copied into the new db.

We should try to get a copy of the database file from the developer so we can reproduce this.

CoreData: error: -addPersistentStoreWithType:CBLIncrementalStore configuration:(null) URL:file:///Users/florion/Library/Developer/CoreSimulator/Devices/BB6F7BB0-B1EF-4C7A-898A-61E1310B90B6/data/Containers/Data/Application/B005D3AE-DB85-4261-989F-96C6390500C8/Library/Application%20Support/myApp/database694.sqlite options:{
    NSInferMappingModelAutomaticallyOption = 1;
    NSMigratePersistentStoresAutomaticallyOption = 1;
} ... returned error Error Domain=CBLISErrorDomain Code=6 "Could not create database" UserInfo=0x786aa5a0 {NSUnderlyingError=0x786ab970 "400 Invalid database/document/revision ID", NSLocalizedDescription=Could not create database} with userInfo dictionary {
    NSLocalizedDescription = "Could not create database";
    NSUnderlyingError = "Error Domain=CBLHTTP Code=400 \"400 Invalid database/document/revision ID\" UserInfo=0x786ab120 {NSLocalizedFailureReason=Invalid database/document/revision ID, NSLocalizedDescription=400 Invalid database/document/revision ID}";
}
@snej
Copy link
Contributor Author

snej commented May 16, 2015

(The developer's actual question is about Core Data support, but I don't think that's relevant to this particular issue since the error happens during opening the database and I don't think any IncrementalStore stuff has happened by that point. Right, @pasin ?)

@pasin
Copy link
Contributor

pasin commented May 16, 2015

That's correct. The error happened during the very first step of getting the CBLDatabase object.

self.database = [manager databaseNamed: databaseName error: &error];
    if (!self.database) {
        if (outError)
            *outError = CBLISError(CBLIncrementalStoreErrorCreatingDatabaseFailed,
                                   @"Could not create database", error);
        return NO;
    }

As the error status is kCBLStatusBadID (Invalid database/document/revision ID), I believe that it happened during the database upgrade process. I have tested migrating (but very simple test with a few docs and attachments) from v1.0.4 to 1.1.0.

The user said that he is using CBL 1.0 before so it's also possible that the database could be from any version from 1.0.0 to 1.0.4. I could look more into this tonight, and it's better if we could get the user's database.

@pasin
Copy link
Contributor

pasin commented May 19, 2015

As reported on the forum by the user that there is no real issues, I'm closing the issue.

@pasin pasin closed this as completed May 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants