Skip to content

Error while upgrading from 4.5.2 to 4.5.3: Failed to update database structure  #664

Closed

Description

@radoeka

While upgrading from 4.5.2 to 4.5.3 the following 2 error messages are logged:

{"app":"core","message":"Failed to update database structure (MDB2 Error: unknown error, _doQuery: [Error message: Could not execute statement]\n[Last executed query: SELECT sql FROM sqlite_master WHERE type='table' AND name='oc_appconfig']\n[Native code: 5]\n[Native message: database is locked]\n)","level":4,"time":1352926012}

And 2 seconds later:
{"app":"core","message":"Failed to get existing database structure for upgrading (MDB2 Error: unknown error, _doQuery: [Error message: Could not execute statement]\n[Last executed query: SELECT name FROM sqlite_master WHERE type='table' AND sql NOT NULL AND name!='sqlite_sequence' ORDER BY name]\n[Native code: 5]\n[Native message: database is locked]\n)","level":4,"time":1352926014}

repeating the sql statements manually, just works (now):
printf "SELECT sql FROM sqlite_master WHERE type='table' AND name='oc_appconfig';" | sqlite3 data/owncloud.db
CREATE TABLE "oc_appconfig" ("appid" VARCHAR(32) DEFAULT ' ' NOT NULL, "configkey" VARCHAR(64) DEFAULT ' ' NOT NULL, "configvalue" LONGTEXT NOT NULL)

and
printf "SELECT name FROM sqlite_master WHERE type='table' AND sql NOT NULL AND name!='sqlite_sequence' ORDER BY name;" | sqlite3 data/owncloud.db
oc_appconfig
oc_bookmarks
.....
oc_sharing
oc_shorty
oc_users

How do I verify that the database has been evolved from the 4.5.2 structure to 4.5.3 correctly (or not). What is still to be done?

More people are having this problem, e.g:
http://mail.kde.org/pipermail/owncloud/2012-November/006562.html
But search the net and there are more messages about it.

  • Is it possible to make the (sqlite) database migration more robust in this respect?
  • Is it possible to rerun the database upgrade again?
  • Is it possible to audit the database (structure)

Activity

  1. osos commented on Dec 1, 2012

    @osos

    I had the same issue upgrading from 4.5.1 to 4.5.2.

    It would be nice to have a possibility to rerun database upgrade.

  2. DeepDiver1975 commented on Dec 3, 2012

    @DeepDiver1975
    Contributor

    @butonic If I recall correctly you faced something like this - right? THX

  3. butonic commented on Dec 3, 2012

    @butonic
    Contributor

    @osos the database upgrade can be triggered by setting the version in config/config.php to a version lower than what is defined in the getVersion() method around line 98 in lib/util.php. Setting it to '4.90.1' should do the trick for oc stable.

    @DeepDiver1975 Sorry, I did not yet run into locking issues with sqlite. But I wanted to test the upgrade for tokenized share links anyway ...

  4. radoeka commented on Dec 3, 2012

    @radoeka
    Author

    @butonic: I lowered my version number in config/config.php, after making a backup of my database. When I entered the url of my OC instance, it reported an error.... Upgrading an already (or partly upgraded) database may result in errors....

  5. karlitschek commented on Dec 14, 2012

    @karlitschek
    Contributor

    I think this should be fixed with 4.5.4 Could you try again with the latest version please?

  6. radoeka commented on Dec 15, 2012

    @radoeka
    Author

    @karlitschek: I tried it again. This time no warnings or errors. All seems well.

  7. karlitschek commented on Dec 15, 2012

    @karlitschek
    Contributor

    solved

  8. locked as resolved and limited conversation to collaborators on Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions