You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error while upgrading from 4.5.4 to 4.5.5: Failed to update database structure #999
Just upgraded from 4.5.4 to 4.5.5 and run into the same as mentioned in: #664 (upgrade from 4.5.2 to 4.5.3)
Unfortunately I did not make a backup of the 4.5.4 database. As such I can not redo the upgrade. Perhaps I remember to this with the next upgrade.
The log file contains:
{"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":1356087810}
On the GUI it is:
Fatal core Failed to update database structure (MDB2 Error: unknown error, _doQuery: [Error message: Could not execute statement] [Last executed query: SELECT sql FROM sqlite_master WHERE type='table' AND name='oc_appconfig'] [Native code: 5] [Native message: database is locked] ) December 21, 2012, 12:03
Downgrading the version setting in config/config.php and re-visiting the start page does not result in the error.
Perhaps this problems happens as I just switched on the machine and did not visit the owncloud instance before. Perhaps it takes some time to load libraries or something like that???
I had an error similar to this after updating from 4.5.5 - 4.5.6...
Failed to update database structure (MDB2 Error: unknown error, _doQuery: [Error message: Could not execute statement] [Last executed query: ALTER TABLE `oc_groups` ADD PRIMARY KEY (`gid`)] [Native code: 1068] [Native message: Multiple primary key defined] )
I only saw the message appear once when logged into online interface as Admin user under the Admin tab as a FATAL warning. After rebooting Apache2 a couple of times, I have not seen the message. Services appear fully functional at this time.
Found something similar with the upgrade from 4.5.6 --> 4.5.7 (Internal numbering: 4.90.7 --> 4.90.8 )
System Info:
OS: Ubuntu 12.04.1 LTS (server)
Database: MySql 5.5.29-0
Log output:
{"app":"core","message":"starting upgrade from 4.90.7 to 4.90.8","level":0,"time":1361440266}
{"app":"core","message":"Failed to update database structure (MDB2 Error: unknown error, _doQuery: [Error
message: Could not execute statement]\n[Last executed query: ALTER TABLE `oc_locks` CHANGE `id` `id` INT
UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, CHANGE `timeout` `timeout` INT UNSIGNED DEFAULT 0, CHANGE `created`
`created` BIGINT DEFAULT 0, CHANGE `scope` `scope` TINYINT DEFAULT 0,
CHANGE `depth` `depth` TINYINT DEFAULT 0]\n[Native code: 1068]\n[Native message: Multiple primary key
defined]\n)","level":4,"time":1361440266}
Visiting the instance gives the error: Unable to upgrade the database (Or soemthing like that)
Setting installed version from 4.90.7 to 4.90.8 in config.php manually "resolves" the problem. It seems to work rather good but I have to do additonal testing.
How could I test if the failed alter table to oc_locks affects my users ?
Had the same problem after upgrading to 4.5.7 from 4.5.6 (and to 4.5.6 from 4.5.5, as I recall). Editing config.php solved it for me!
My machine is using SQlite and lighttpd.
Yes. But please do only the schema piece for now and not the full ORM piece.
It is important that we have a fully working version in a branch before we merge. All apps have to be migrated and tested. I also want to have a performance test to see how much slower the new code is.
I got the error 'database is locked' also with the doctrine code. The problem is the caching of prepared statements, sqlite keeps the connection open when there are still statements around. I think we should disable the caching for sqlite. @karlitschek@icewind1991 What do you think?
@bartv2 I haven't looked into the db locking issue yet. I have no idea what the best practice is if you have other php/apache processes handing around with open connections. Perhaps it's worth looking into other PHP applications to check how they do it.
What do you mean by solution? PR where it says not recommended when you choose SQlite on the install page?
I dont know how others think about it yet, thats why I only stated my opinion. Also I dont think this can be solved, its an SQLite specific issue that I ran into in my own projects.
sqlite is really nice to quickly try out owncloud. It is very easy to setup. Once a full blown installation is needed one can use one of the bigger database engines.
Well sure its nice because its fast and easy. But its not intended to be used that way in production. If someone wants to use sqlite in production then he shouldnt complain about broken dbs.
If @doomi@etam@simlan123 or @radoeka could respond wether or not they migrated from sqlite to mysql, we could finally have found the root cause of this.
@karlitschek we could check if the id columns are defined as int(11) and log a warning in the db?
@karlitschek@icewind1991 this issue contains a lot of information regarding failed database migrations and potential steps regarding the database repair operation
From reading through the comments, it seems that one issue is the "Database is locked" issue from SQLite, which was addressed already multiple times and isn't related to the repair routine.
The other outstanding issue is the upgrade of the oc_locks (what's this table for?) table with primary key issues. With the new checkMigrate such cases should be caught during upgrade simulation.
Activity
anti-pencil commentedon Jan 29, 2013
I had an error similar to this after updating from 4.5.5 - 4.5.6...
I only saw the message appear once when logged into online interface as Admin user under the Admin tab as a FATAL warning. After rebooting Apache2 a couple of times, I have not seen the message. Services appear fully functional at this time.
radoeka commentedon Feb 10, 2013
Related: #1036
simlan123 commentedon Feb 21, 2013
Found something similar with the upgrade from 4.5.6 --> 4.5.7 (Internal numbering: 4.90.7 --> 4.90.8 )
System Info:
OS: Ubuntu 12.04.1 LTS (server)
Database: MySql 5.5.29-0
Log output:
Visiting the instance gives the error: Unable to upgrade the database (Or soemthing like that)
Setting installed version from 4.90.7 to 4.90.8 in config.php manually "resolves" the problem. It seems to work rather good but I have to do additonal testing.
How could I test if the failed alter table to oc_locks affects my users ?
Captain-Rage commentedon Feb 26, 2013
Had the same problem after upgrading to 4.5.7 from 4.5.6 (and to 4.5.6 from 4.5.5, as I recall). Editing config.php solved it for me!
My machine is using SQlite and lighttpd.
BernhardPosselt commentedon Feb 26, 2013
I think the general consensus is to migrate to doctrine as soon as possible.
@bartv2 if you need help tell me.
karlitschek commentedon Feb 26, 2013
Yes. But please do only the schema piece for now and not the full ORM piece.
It is important that we have a fully working version in a branch before we merge. All apps have to be migrated and tested. I also want to have a performance test to see how much slower the new code is.
bartv2 commentedon Feb 26, 2013
@karlitschek it is only the replacement of the current db layer, no ORM yet ;)
bartv2 commentedon Feb 26, 2013
I got the error 'database is locked' also with the doctrine code. The problem is the caching of prepared statements, sqlite keeps the connection open when there are still statements around. I think we should disable the caching for sqlite. @karlitschek @icewind1991 What do you think?
karlitschek commentedon Feb 26, 2013
@bartv2 ;-)
karlitschek commentedon Feb 26, 2013
@bartv2 I haven't looked into the db locking issue yet. I have no idea what the best practice is if you have other php/apache processes handing around with open connections. Perhaps it's worth looking into other PHP applications to check how they do it.
BernhardPosselt commentedon Feb 26, 2013
Typical SQLite problem, I'd actively discourage users from using it.
DeepDiver1975 commentedon Feb 26, 2013
Nice - where is the solution? Come on - comments like that are of zero help.
BernhardPosselt commentedon Feb 26, 2013
What do you mean by solution? PR where it says not recommended when you choose SQlite on the install page?
I dont know how others think about it yet, thats why I only stated my opinion. Also I dont think this can be solved, its an SQLite specific issue that I ran into in my own projects.
radoeka commentedon Feb 26, 2013
sqlite is really nice to quickly try out owncloud. It is very easy to setup. Once a full blown installation is needed one can use one of the bigger database engines.
BernhardPosselt commentedon Feb 26, 2013
Well sure its nice because its fast and easy. But its not intended to be used that way in production. If someone wants to use sqlite in production then he shouldnt complain about broken dbs.
29 remaining items
butonic commentedon Jan 10, 2014
Smells a lot like http://fabianpeter.de/cloud/owncloud-migrating-from-sqlite-to-mysql/#comment-6250
butonic commentedon Jan 10, 2014
indeed. dumping a sqlite3 db produces this line for oc_locks:
the sqlite3-to-mysql.py script turns it into
which in turn produces a table like this:
If @doomi @etam @simlan123 or @radoeka could respond wether or not they migrated from sqlite to mysql, we could finally have found the root cause of this.
@karlitschek we could check if the id columns are defined as int(11) and log a warning in the db?
XueSheng-GIT commentedon Jan 10, 2014
Same discussion as #5139.
Root cause was migration of sqlite to mysql.
radoeka commentedon Jan 10, 2014
I always used sqlite3.
radoeka commentedon Jan 10, 2014
I've not encountered this problem for a long time (perhaps not since I reported the issue).
DeepDiver1975 commentedon Feb 6, 2014
@karlitschek @icewind1991 this issue contains a lot of information regarding failed database migrations and potential steps regarding the database repair operation
karlitschek commentedon Jul 4, 2014
@PVince81 Can you go through this issue and check if everything should be covered by our new db migration test and repair scripts? Thanks
PVince81 commentedon Jul 4, 2014
@icewind1991 could help as well.
PVince81 commentedon Jul 4, 2014
He knows more about
checkMigratethan I do since he wrote it.The repair scripts part at the moment only fixes mimetypes for office files.
PVince81 commentedon Aug 19, 2014
From reading through the comments, it seems that one issue is the "Database is locked" issue from SQLite, which was addressed already multiple times and isn't related to the repair routine.
The other outstanding issue is the upgrade of the
oc_locks(what's this table for?) table with primary key issues. With the newcheckMigratesuch cases should be caught during upgrade simulation.