core icon indicating copy to clipboard operation
core copied to clipboard

Upgrade from 5.0.13 to 6.0RC4 fails with SQL error

Open torlasz opened this issue 12 years ago • 3 comments

Expected behaviour

5.0.13 to 6.0 upgrade should be successful

Actual behaviour

Upgrade fails with an SQL error

Steps to reproduce

  1. make a copy of an existing 5.0.13 service to a new area
  2. delete all folders except data and config
  3. copy 6.0RC4 folders over the install area
  4. make a copy of the 5.0.13 database
  5. set the database to the fresh copy
  6. point the browser to the proper URL

Server configuration

Operating system: RHEL 6.4

Web server: apache httpd-2.2.15-28.el6_4.x86_64

Database: mysql mysql-server-5.1.69-1.el6_4.x86_64

PHP version: php-5.3.3-22.el6.x86_64

ownCloud version: (see ownCloud admin page) 6.0RC4

Updated from an older ownCloud or fresh install: 5.0.13

List of activated app:

The content of config/config.php: (Without the database password and passwordsalt)

'510275117436b', 'passwordsalt' => 'xxx', 'datadirectory' => '/var/www/oc2/data', 'dbtype' => 'mysql', 'version' => '6.0.0.12', 'dbname' => 'owncloud2', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'dbuser' => 'owncloud', 'dbpassword' => 'xxx', 'installed' => true, 'ldapIgnoreNamingRules' => false, 'loglevel' => '0', 'maintenance' => false, 'theme' => '', ); ### Client configuration Browser: mozilla firefox firefox-25.0-3.fc18.x86_64 Operating system: Fedora 18 ### Logs #### Web server error log no errors #### ownCloud log (data/owncloud.log) {"app":"index","message":"Exception: An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S 02]: Base table or view not found: 1146 Table 'owncloud2.oc_jobs' doesn't exist","level":4,"time":"2013-12-10T12:44:34+00:00"} {"app":"core","message":"starting upgrade from 5.0.25 to 6.0.0.12","level":0,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Du plicate entry 'torlasz-settings-email' for key 'PRIMARY'' in \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php:742\nStack trace: \n#0 [internal function]: PDO->query('ALTER TABLE `oc...')\n#1 \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(742): call_user _func_array(Array, Array)\n#2 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connection->query('ALTER TABLE`oc...')\n#3 \/va r\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff))\n#4 \/va r\/www\/oc2\/lib\/private\/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/oc2\/db...')\n#5 \/var\/www\/oc2\/lib\/private\/updater .php(106): OC_DB::updateDbFromStructure('\/var\/www\/oc2\/db...')\n#6 \/var\/www\/oc2\/core\/ajax\/update.php(34): OC\Updater->upgrade()\n#7 {main}\n\nNext exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'ALTER TABLE `oc_preferences` ADD PRIMARY KEY (`userid`, `appid `, `configkey`)':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'torlasz-settings-email' for key 'PRIMARY'' in \/var\/www\/oc2\/3r dparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php:47\nStack trace:\n#0 \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connectio n.php(744): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException), 'ALTER TABLE `oc...')\n#1 \/var\/www\/oc2\/lib\/private\/db\/mdb2 schemamanager.php(152): Doctrine\\DBAL\\Connection->query('ALTER TABLE`oc...')\n#2 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(91): OC\DB\MDB 2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff))\n#3 \/var\/www\/oc2\/lib\/private\/db.php(373): OC\DB\MDB2SchemaManager->up dateDbFromStructure('\/var\/www\/oc2\/db...')\n#4 \/var\/www\/oc2\/lib\/private\/updater.php(106): OC_DB::updateDbFromStructure('\/var\/www\/oc2\/db...')\n#5 \/var\/www\/oc2\/core\/ajax\/update.php(34): OC\Updater->upgrade()\n#6 {main})","level":4,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"App \"\" (user_migrate) can't be used because it is not compatible with this version of ownCloud","level":3,"time":"2013-12-10T12:44 :35+00:00"} {"app":"core","message":"can't remove app user_migrate. It is not installed.","level":3,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"App \"\" (admin_migrate) can't be used because it is not compatible with this version of ownCloud","level":3,"time":"2013-12-10T12:4 4:35+00:00"} {"app":"core","message":"can't remove app admin_migrate. It is not installed.","level":3,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"App \"\" (media) can't be used because it is not compatible with this version of ownCloud","level":3,"time":"2013-12-10T12:44:35+00: 00"} {"app":"core","message":"can't remove app media. It is not installed.","level":3,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"App \"\" (files_imageviewer) can't be used because it is not compatible with this version of ownCloud","level":3,"time":"2013-12-10T 12:44:35+00:00"} {"app":"core","message":"can't remove app files_imageviewer. It is not installed.","level":3,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"App \"\" (files_odfviewer) can't be used because it is not compatible with this version of ownCloud","level":3,"time":"2013-12-10T12 :44:35+00:00"} {"app":"core","message":"can't remove app files_odfviewer. It is not installed.","level":3,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"App \"\" (user_saml) can't be used because it is not compatible with this version of ownCloud","level":3,"time":"2013-12-10T12:44:35 +00:00"} {"app":"core","message":"can't remove app user_saml. It is not installed.","level":3,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"App \"\" (mozilla_sync) can't be used because it is not compatible with this version of ownCloud","level":3,"time":"2013-12-10T12:44 :35+00:00"} {"app":"core","message":"can't remove app mozilla_sync. It is not installed.","level":3,"time":"2013-12-10T12:44:35+00:00"} {"app":"core","message":"App \"\" (files_epubviewer) can't be used because it is not compatible with this version of ownCloud","level":3,"time":"2013-12-10T1 2:44:35+00:00"} {"app":"core","message":"can't remove app files_epubviewer. It is not installed.","level":3,"time":"2013-12-10T12:44:35+00:00"} {"app":"contacts","message":"starting app upgrade from 0.2.5 to 0.3","level":0,"time":"2013-12-10T12:44:35+00:00"} {"app":"gallery","message":"starting app upgrade from 0.5.2 to 0.5.3","level":0,"time":"2013-12-10T12:44:35+00:00"} {"app":"user_ldap","message":"starting app upgrade from 0.4.0 to 0.4.1","level":0,"time":"2013-12-10T12:44:36+00:00"} {"app":"search_lucene","message":"starting app upgrade from 0.5.0 to 0.5.2","level":0,"time":"2013-12-10T12:44:36+00:00"} {"app":"core","message":"Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Du plicate entry '1050' for key 'PRIMARY'' in \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php:742\nStack trace:\n#0 [internal fun ction]: PDO->query('ALTER TABLE `oc...')\n#1 \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(742): call_user_func_array(Array, Array)\n#2 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connection->query('ALTER TABLE`oc...')\n#3 \/var\/www\/oc2\/lib\/ private\/db\/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff))\n#4 \/var\/www\/oc2\/lib\/ private\/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/oc2\/ap...')\n#5 \/var\/www\/oc2\/lib\/private\/app.php(965): OC_DB::upda teDbFromStructure('\/var\/www\/oc2\/ap...')\n#6 \/var\/www\/oc2\/lib\/private\/app.php(867): OC_App::updateApp('search_lucene')\n#7 \/var\/www\/oc2\/lib\/pri vate\/app.php(92): OC_App::checkUpgrade('search_lucene')\n#8 \/var\/www\/oc2\/lib\/private\/app.php(66): OC_App::loadApp('search_lucene')\n#9 \/var\/www\/oc2 \/lib\/private\/updater.php(118): OC_App::loadApps()\n#10 \/var\/www\/oc2\/core\/ajax\/update.php(34): OC\Updater->upgrade()\n#11 {main}\n\nNext exception ' Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'ALTER TABLE `oc_lucene_status` ADD PRIMARY KEY (`fileid`)':\n\nSQLSTATE[2 3000]: Integrity constraint violation: 1062 Duplicate entry '1050' for key 'PRIMARY'' in \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBAL Exception.php:47\nStack trace:\n#0 \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(744): Doctrine\DBAL\DBALException::driver ExceptionDuringQuery(Object(PDOException), 'ALTER TABLE `oc...')\n#1 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connectio n->query('ALTER TABLE`oc...')\n#2 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctri ne\DBAL\Schema\SchemaDiff))\n#3 \/var\/www\/oc2\/lib\/private\/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/oc2\/ap...')\n#4 \/var\/www\/oc2\/lib\/private\/app.php(965): OC_DB::updateDbFromStructure('\/var\/www\/oc2\/ap...')\n#5 \/var\/www\/oc2\/lib\/private\/app.php(867): OC_App::updateApp('search_lucene')\n#6 \/var\/www\/oc2\/lib\/private\/app.php(92): OC_App::checkUpgrade('search_lucene')\n#7 \/var\/www\/oc2\/lib\/private\/app.php(66): OC_App::loadApp('search_lucene')\n#8 \/var\/www\/oc2\/lib\/private\/updater.php(118): OC_App::loadApps()\n#9 \/var\/www\/oc2\/core\/ajax\/update.php(34): OC\Updater->upgrade()\n#10 {main})","level":4,"time":"2013-12-10T12:44:36+00:00"} {"app":"PHP","message":"Failed to upgrade \"search_lucene\". at \/var\/www\/oc2\/lib\/private\/app.php#873","level":3,"time":"2013-12-10T12:44:36+00:00"} {"app":"search_lucene","message":"starting app upgrade from 0.5.0 to 0.5.2","level":0,"time":"2013-12-10T12:44:36+00:00"} {"app":"core","message":"Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1050' for key 'PRIMARY'' in \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php:742\nStack trace:\n#0 [internal function]: PDO->query('ALTER TABLE `oc...')\n#1 \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(742): call_user_func_array(Array, Array)\n#2 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connection->query('ALTER TABLE`oc...')\n#3 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff))\n#4 \/var\/www\/oc2\/lib\/private\/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/oc2\/ap...')\n#5 \/var\/www\/oc2\/lib\/private\/app.php(965): OC_DB::updateDbFromStructure('\/var\/www\/oc2\/ap...')\n#6 \/var\/www\/oc2\/lib\/private\/app.php(867): OC_App::updateApp('search_lucene')\n#7 \/var\/www\/oc2\/lib\/private\/app.php(92): OC_App::checkUpgrade('search_lucene')\n#8 \/var\/www\/oc2\/lib\/private\/app.php(66): OC_App::loadApp('search_lucene')\n#9 \/var\/www\/oc2\/lib\/base.php(689): OC_App::loadApps()\n#10 \/var\/www\/oc2\/index.php(30): OC::handleRequest()\n#11 {main}\n\nNext exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'ALTER TABLE `oc_lucene_status` ADD PRIMARY KEY (`fileid`)':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1050' for key 'PRIMARY'' in \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php:47\nStack trace:\n#0 \/var\/www\/oc2\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(744): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException), 'ALTER TABLE `oc...')\n#1 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connection->query('ALTER TABLE`oc...')\n#2 \/var\/www\/oc2\/lib\/private\/db\/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff))\n#3 \/var\/www\/oc2\/lib\/private\/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/oc2\/ap...')\n#4 \/var\/www\/oc2\/lib\/private\/app.php(965): OC_DB::updateDbFromStructure('\/var\/www\/oc2\/ap...')\n#5 \/var\/www\/oc2\/lib\/private\/app.php(867): OC_App::updateApp('search_lucene')\n#6 \/var\/www\/oc2\/lib\/private\/app.php(92): OC_App::checkUpgrade('search_lucene')\n#7 \/var\/www\/oc2\/lib\/private\/app.php(66): OC_App::loadApp('search_lucene')\n#8 \/var\/www\/oc2\/lib\/base.php(689): OC_App::loadApps()\n#9 \/var\/www\/oc2\/index.php(30): OC::handleRequest()\n#10 {main})","level":4,"time":"2013-12-10T12:44:36+00:00"} {"app":"index","message":"Exception: Failed to upgrade \"search_lucene\".","level":4,"time":"2013-12-10T12:44:36+00:00"}

torlasz avatar Dec 10 '13 17:12 torlasz

Was he ownCloud 5.0.13 installation a clean new installation? Or how old was that? Have you migrated from sqlite to mysql before? Thanks

karlitschek avatar Dec 10 '13 22:12 karlitschek

This oc 5.0.13 was set up as 4.x originally on Jan 2, 2013, and got upgraded gradually. I never used sqlite, had mysql from the start.

torlasz avatar Dec 11 '13 13:12 torlasz

@torlasz duplicate of https://github.com/owncloud/core/issues/6416 Please let us know if it is fixed with 6.0.1 there

VicDeo avatar Feb 08 '14 12:02 VicDeo