Repository navigation
Closed
Labels
Description
I just wanted to test upgrading 5.0.13 to the latest OwnCloud 6 RC2, but when it gets to the point where:
This ownCloud instance is currently being updated, which may take a while.
Please reload this page after a short time to continue using ownCloud.
Contact your system administrator if this message persists or appeared unexpectedly.
Thank you for your patience.
is displayed, refreshing the page does nothing. Instead, the following errors are repeated in the owncloud.log:
{"app":"core","message":"Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 19 PRIMARY KEY must be unique' in \/var\/www\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php:742\nStack trace:\n#0 [internal function]: PDO->query('INSERT INTO oc_...')\n#1 \/var\/www\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(742): call_user_func_array(Array, Array)\n#2 \/var\/www\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connection->query('INSERT INTO oc_...')\n#3 \/var\/www\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(91): OC\\DB\\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\\DBAL\\Schema\\SchemaDiff))\n#4 \/var\/www\/owncloud\/lib\/private\/db.php(373): OC\\DB\\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/ownclo...')\n#5 \/var\/www\/owncloud\/lib\/private\/app.php(965): OC_DB::updateDbFromStructure('\/var\/www\/ownclo...')\n#6 \/var\/www\/owncloud\/lib\/private\/app.php(867): OC_App::updateApp('search_lucene')\n#7 \/var\/www\/owncloud\/lib\/private\/app.php(92): OC_App::checkUpgrade('search_lucene')\n#8 \/var\/www\/owncloud\/lib\/private\/app.php(66): OC_App::loadApp('search_lucene')\n#9 \/var\/www\/owncloud\/lib\/base.php(548): OC_App::loadApps()\n#10 \/var\/www\/owncloud\/lib\/base.php(956): OC::init()\n#11 \/var\/www\/owncloud\/cron.php(49): require_once('\/var\/www\/ownclo...')\n#12 {main}\n\nNext exception 'Doctrine\\DBAL\\DBALException' with message 'An exception occurred while executing 'INSERT INTO oc_lucene_status (fileid, status) SELECT fileid, status FROM __temp__oc_lucene_status':\n\nSQLSTATE[23000]: Integrity constraint violation: 19 PRIMARY KEY must be unique' in \/var\/www\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php:47\nStack trace:\n#0 \/var\/www\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(744): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(PDOException), 'INSERT INTO oc_...')\n#1 \/var\/www\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connection->query('INSERT INTO oc_...')\n#2 \/var\/www\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(91): OC\\DB\\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\\DBAL\\Schema\\SchemaDiff))\n#3 \/var\/www\/owncloud\/lib\/private\/db.php(373): OC\\DB\\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/ownclo...')\n#4 \/var\/www\/owncloud\/lib\/private\/app.php(965): OC_DB::updateDbFromStructure('\/var\/www\/ownclo...')\n#5 \/var\/www\/owncloud\/lib\/private\/app.php(867): OC_App::updateApp('search_lucene')\n#6 \/var\/www\/owncloud\/lib\/private\/app.php(92): OC_App::checkUpgrade('search_lucene')\n#7 \/var\/www\/owncloud\/lib\/private\/app.php(66): OC_App::loadApp('search_lucene')\n#8 \/var\/www\/owncloud\/lib\/base.php(548): OC_App::loadApps()\n#9 \/var\/www\/owncloud\/lib\/base.php(956): OC::init()\n#10 \/var\/www\/owncloud\/cron.php(49): require_once('\/var\/www\/ownclo...')\n#11 {main})","level":4,"time":"2013-12-02T15:02:52+00:00"}
{"app":"cron","message":"Failed to upgrade \"search_lucene\".","level":4,"time":"2013-12-02T15:02:52+00:00"}
Installed OS: Ubuntu 12.04 (using testing repository for 12.10, since none exist for 12.04(?))
Running owncloud on Apache/PHP/sqlite.
Activity
karlitschek commentedon Dec 2, 2013
@butonic Can you have a look?
butonic commentedon Dec 3, 2013
fixed in stable6 with owncloud-archive/apps@997e873
mrijke commentedon Dec 3, 2013
Thanks, will test it when RC3 is released.
butonic commentedon Dec 3, 2013
fixed in master with owncloud-archive/apps@1d72bb1
karlitschek commentedon Dec 3, 2013
Awesome! Thanks @butonic
butonic commentedon Dec 3, 2013
@mrijke thx. The update should remove duplicate entries and reindex the missing files. Tested here with sqlite.
hdering commentedon Dec 3, 2013
I tried to update from 5.0.13 to daily build (http://download.owncloud.org/community/daily/owncloud-daily-master.tar.bz2) but I get this error:
[Tue Dec 03 20:08:11 2013] [error] [client 192.168.188.22] PHP Fatal error: Cannot redeclare class OC_Config in /var/www/lib/config.php on line 41, referer: http://192.168.188.25/
VicDeo commentedon Dec 3, 2013
@hdering #5313 (comment)
mrijke commentedon Dec 9, 2013
I just tested upgrading to ownCloud 6 RC4 and I'm still seeing this error. Anything else I can try/post to help fix this?
maurostorch commentedon Dec 10, 2013
I could fix the problem by removing duplicated key entries on table "oc_lucene_status" (delete from oc_lucene_status where fileid in (select fileid from oc_lucene_status group by fileid having count(*) > 1);).
I'm using RC1 (with updated script lucene.php from master).
mrijke commentedon Dec 10, 2013
@maurostorch I tried your query, but I still get the same error message. Anything else I can try?
maurostorch commentedon Dec 10, 2013
@mrijke, actually I just got a fresh 6.0RC1 and update the lucene.php. Then, I'd moved config, data and .db(sqlite3) and finally run the query (delete from oc_lucene_status where fileid in (select fileid from oc_lucene_status group by fileid having count(*) > 1);). It was enough for me.
mrijke commentedon Dec 10, 2013
@maurostorch strange, since I'm running RC4 which already contains the updated lucene.php.
@butonic do you have any idea why I'm still getting this error?
butonic commentedon Dec 10, 2013
@mrijke maybe the versions got mixed up s othe update.php is no longer triggered.
Please check if your
oc_lucene_statustable contains any duplicates:And post what version of search_lucene oc thinks is installed:
Assuming there are duplicate entries and the version is already 0.5.2 change the version in the db back to 0.5.0:
Reloading owncloud in the browser should update search_lucene without the 'Integrity constraint violation' error.
To manually clean up the table run the following query to delete any duplicates:
mrijke commentedon Dec 10, 2013
@butonic Thanks for your reply.
The oc_lucene_status table does not contain any duplicates, probably because I ran the query provided by @maurostorch.
The version of search_lucene that is installed is reported as 0.5.2.
After setting that to 0.5.0 I reloaded ownCloud in the browser but it wouldn't go past the 'currently being updated' page, but there were no errors in the owncloud.log and there was no CPU or harddisk activity on the server. I had to set 'ḿaintenance' to false in the config.php file to be able to access ownCloud.
However 'search_lucene' is now version 0.5.2 so I guess the upgrade went fine after all?
butonic commentedon Dec 11, 2013
Yes, indeed. OwnCloud being stuck in maintenance mode is a different issue though. One we have never really been able to reproduce and thus debug / fix. Closing the issue.
Conf action: fix sql schema upgrade. Refs #2669