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

Upgrade from 5.0.13 to 6.0.0 (search lucene) failed #6313

Closed
MeCias opened this issue Dec 11, 2013 · 45 comments
Closed

Upgrade from 5.0.13 to 6.0.0 (search lucene) failed #6313

MeCias opened this issue Dec 11, 2013 · 45 comments

Comments

@MeCias
Copy link

MeCias commented Dec 11, 2013

Hi,

after upgrading from 5.0.13 to 6.0.0 I got stuck in the maintenance page. Nothing happened after that, so I changed in the config the maintenance mode to false. After refreshing the web page I got a blue screen with red letters that say.

Konnte "search_lucene" nicht aktualisieren.

Quite not sure what to do now.

It is a hosted package with php 5.3.8 and Apache Server.

@karlitschek
Copy link
Contributor

@butonic What do you think?

@MeCias
Copy link
Author

MeCias commented Dec 11, 2013

I renamed under apps the folder search_lucene to search_lucene_old so I can atleast access OC6. Seems to work now except lucene search

The log entry:

Fatal remote Konnte "search_lucene" nicht aktualisieren. 2013-12-11T14:09:01+00:00
Fatal core Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'' in /home/www/web/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:742 Stack trace: #0 [internal function]: PDO->query('ALTER TABLE oc...') #1 /home/www/web/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(742): call_user_func_array(Array, Array) #2 /home/www/web/html/owncloud/lib/private/db/mdb2schemamanager.php(152): Doctrine\DBAL\Connection->query('ALTER TABLEoc...') #3 /home/www/web/html/owncloud/lib/private/db/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff)) #4 /home/www/web/html/owncloud/lib/private/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('/home/www/web...') #5 /home/www/web/html/owncloud/lib/private/app.php(965): OC_DB::updateDbFromStructure('/home/www/web...') #6 /home/www/web/html/owncloud/lib/private/app.php(867): OC_App::updateApp('search_lucene') #7 /home/www/web/html/owncloud/lib/private/app.php(92): OC_App::checkUpgrade('search_lucene') #8 /home/www/web/html/owncloud/lib/private/app.php(66): OC_App::loadApp('search_lucene') #9 /home/www/web/html/owncloud/apps/files/appinfo/remote.php(28): OC_App::loadApps(Array) #10 /home/www/web/html/owncloud/remote.php(43): require_once('/home/www/web...') #11 {main} Next exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'ALTER TABLE oc_lucene_status ADD PRIMARY KEY (fileid)': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'' in /home/www/web/html/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:47 Stack trace: #0 /home/www/web/ownhtml/cloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(744): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException), 'ALTER TABLE oc...') #1 /home/www/web/html/owncloud/lib/private/db/mdb2schemamanager.php(152): Doctrine\DBAL\Connection->query('ALTER TABLEoc...') #2 /home/www/web/html/owncloud/lib/private/db/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff)) #3 /home/www/web/html/owncloud/lib/private/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('/home/www/web...') #4 /home/www/web/html/owncloud/lib/private/app.php(965): OC_DB::updateDbFromStructure('/home/www/web...') #5 /home/www/web/html/owncloud/lib/private/app.php(867): OC_App::updateApp('search_lucene') #6 /home/www/web/html/owncloud/lib/private/app.php(92): OC_App::checkUpgrade('search_lucene') #7 /home/www/web/html/owncloud/lib/private/app.php(66): OC_App::loadApp('search_lucene') #8 /home/www/web/html/owncloud/apps/files/appinfo/remote.php(28): OC_App::loadApps(Array) #9 /home/www/web/html/owncloud/remote.php(43): require_once('/home/www/web...') #10 {main})

@enoch85
Copy link
Member

enoch85 commented Dec 11, 2013

I have the same error from 5.0.13 --> 6.0

Fatal remote Misslyckades med att uppgradera "search_lucene". 2013-12-11T14:57:31+00:00
Fatal core Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'' in /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:742 Stack trace: #0 [internal function]: PDO->query('ALTER TABLE oc...') #1 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(742): call_user_func_array(Array, Array) #2 /var/www/owncloud/lib/private/db/mdb2schemamanager.php(152): Doctrine\DBAL\Connection->query('ALTER TABLEoc...') #3 /var/www/owncloud/lib/private/db/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff)) #4 /var/www/owncloud/lib/private/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('/var/www/ownclo...') #5 /var/www/owncloud/lib/private/app.php(965): OC_DB::updateDbFromStructure('/var/www/ownclo...') #6 /var/www/owncloud/lib/private/app.php(867): OC_App::updateApp('search_lucene') #7 /var/www/owncloud/lib/private/app.php(92): OC_App::checkUpgrade('search_lucene') #8 /var/www/owncloud/lib/private/app.php(66): OC_App::loadApp('search_lucene') #9 /var/www/owncloud/apps/files/appinfo/remote.php(28): OC_App::loadApps(Array) #10 /var/www/owncloud/remote.php(43): require_once('/var/www/ownclo...') #11 {main} Next exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'ALTER TABLE oc_lucene_status ADD PRIMARY KEY (fileid)': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY'' in /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:47 Stack trace: #0 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(744): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException), 'ALTER TABLE oc...') #1 /var/www/owncloud/lib/private/db/mdb2schemamanager.php(152): Doctrine\DBAL\Connection->query('ALTER TABLEoc...') #2 /var/www/owncloud/lib/private/db/mdb2schemamanager.php(91): OC\DB\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\DBAL\Schema\SchemaDiff)) #3 /var/www/owncloud/lib/private/db.php(373): OC\DB\MDB2SchemaManager->updateDbFromStructure('/var/www/ownclo...') #4 /var/www/owncloud/lib/private/app.php(965): OC_DB::updateDbFromStructure('/var/www/ownclo...') #5 /var/www/owncloud/lib/private/app.php(867): OC_App::updateApp('search_lucene') #6 /var/www/owncloud/lib/private/app.php(92): OC_App::checkUpgrade('search_lucene') #7 /var/www/owncloud/lib/private/app.php(66): OC_App::loadApp('search_lucene') #8 /var/www/owncloud/apps/files/appinfo/remote.php(28): OC_App::loadApps(Array) #9 /var/www/owncloud/remote.php(43): require_once('/var/www/ownclo...') #10 {main}) 2013-12-11T14:57:31+00:00
Fatal remote Failed to upgrade "search_lucene". 2013-12-11T14:57:31+00:00

@exic
Copy link

exic commented Dec 11, 2013

Same here, suspicious log entries:

{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' 
doesn't exist","level":4,"time":"2013-12-11T14:31:28+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' 
doesn't exist","level":4,"time":"2013-12-11T14:31:58+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' 
doesn't exist","level":4,"time":"2013-12-11T14:31:58+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' 
doesn't exist","level":4,"time":"2013-12-11T14:31:59+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' 
doesn't exist","level":4,"time":"2013-12-11T14:32:29+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' 
doesn't exist","level":4,"time":"2013-12-11T14:32:29+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' 
doesn't exist","level":4,"time":"2013-12-11T14:32:29+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' 
doesn't exist","level":4,"time":"2013-12-11T14:32:59+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:32:59+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:32:59+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:33:29+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:33:29+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:33:30+00:00"}
{"app":"index","message":"Exception: An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:33:30+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:34:00+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:34:00+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:34:00+00:00"}
{"app":"index","message":"Exception: An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:34:24+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:34:30+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:34:30+00:00"}
{"app":"remote","message":"An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:34:30+00:00"}
{"app":"index","message":"Exception: An exception occurred while executing 'SELECT `id` FROM `oc_jobs` WHERE `class` = ? AND `argument` = ?':\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'owncloud.oc_jobs' doesn't exist","level":4,"time":"2013-12-11T14:34:57+00:00"}

and

{"app":"core","message":"Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4' for key 'PRIMARY'' in \/var\/www\/own...

@butonic
Copy link
Member

butonic commented Dec 11, 2013

The oc_jobs table does not exist in OC5 and search_lucene only deletes jobs from the oc_queuedtasks table. So I don't think the exceptions are caused by the update.php. investigating...

@lexipimenidis
Copy link

Any hotfix? I tried "DELETE FROM oc_lucene_status", which I found in some forum, but that didn't worked.

Is it possible/safe to downgrade? So I can at least resume operation?

I used the hotfix as described by "MeCias" before to re-access my instance. It would be good to learn how to get a solution for (a) the original bug and (b) how to rollback the hotfix ;-)

@butonic
Copy link
Member

butonic commented Dec 11, 2013

DELETE FROM oc_lucene_status will resolve the update problem. Reloading owncloud in the browser should then complete the migration successfully. If the maintenance mode is not deactivated try setting maintenance to false in the config.php

@butonic
Copy link
Member

butonic commented Dec 11, 2013

The underlying problem is that app updates are executed only after the schema migration which will fail. We are working on a solution.

@butonic
Copy link
Member

butonic commented Dec 11, 2013

Sorry for the messed up release.

fixed in stable6: owncloud-archive/apps@47f8ef0
fixed in master: owncloud-archive/apps@f177aff

I vote for peer review in the apps repository ...

solution is adding a new file: apps/search_lucene/appinfo/preupdate.php

<?php

$currentVersion=OC_Appconfig::getValue('search_lucene', 'installed_version');

if (version_compare($currentVersion, '0.5.2', '<')) {
    //delete duplicate id entries
    $stmt = OCP\DB::prepare('
        DELETE FROM `*PREFIX*lucene_status`
        WHERE `fileid` IN (
            SELECT `fileid`
            FROM (
                SELECT `fileid`
                FROM `*PREFIX*lucene_status`
                GROUP BY `fileid`
                HAVING count(`status`) > 1
            ) AS `mysqlerr1093hack`
        )
    ');
    $stmt->execute();
}

@butonic
Copy link
Member

butonic commented Dec 11, 2013

@lexipimenidis @MeCias does adding the above file and setting maintenance to false in the config.php fix the issue for you?

@MeCias
Copy link
Author

MeCias commented Dec 11, 2013

Hi butonic,

Thanks a lot for your effort. It seems like that it is working, but I can not tell if to delete "DELETE FROM oc_lucene_status" was the reason or adding the file.

@enoch85
Copy link
Member

enoch85 commented Dec 11, 2013

I can confirm that it works with the new file preupdate.php in combination with removal of the following code in update.php.

}
if (version_compare($currentVersion, '0.5.2', '<')) {
//delete duplicate id entries
$stmt = OCP\DB::prepare('
DELETE FROM *PREFIX*lucene_status
WHERE fileid IN (
SELECT fileid
FROM (
SELECT fileid
FROM *PREFIX*lucene_status
GROUP BY fileid
HAVING count(status) > 1
) AS mysqlerr1093hack
)
');
$stmt->execute();

@hdering
Copy link

hdering commented Dec 11, 2013

@butonic
I added the file preupdate.php into the dir and it works now

@l0bster
Copy link

l0bster commented Dec 11, 2013

Confirmed,

adding preupdate.php as described by @butonic works...

@lexipimenidis
Copy link

Thanks - the fix worked!

@sthag
Copy link

sthag commented Dec 11, 2013

I did as described by @butonic and it fixed the issue. Owncloud still displays the following log entry

Warning  PHP     Undefined variable: currentVersion at /path/to/owncloud/apps/search_lucene/appinfo/preupdate.php#3

@butonic butonic reopened this Dec 11, 2013
@butonic
Copy link
Member

butonic commented Dec 11, 2013

Will fix the undefined variable in the next 30min.

@wolkenschieber
Copy link

Issue #6330 is not a duplicate of this one!
This one is about a specific table failing, #6330 is about database scheme upgrade failing in general, at least with postgres.

@butonic
Copy link
Member

butonic commented Dec 11, 2013

fixed in stable6 with owncloud-archive/apps@74ca2bd
fixed in master with owncloud-archive/apps@0c6f6c5

@butonic butonic closed this as completed Dec 11, 2013
@enoch85
Copy link
Member

enoch85 commented Dec 11, 2013

Don´t know what this is, but maybe it has something to do with this issue?

Error search_lucene Cross-reference streams are not supported yet. Trace:\n#0 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf/Parser.php(460): Zend_Pdf_Parser->_loadXRefTable('1391213') #1 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf.php(318): Zend_Pdf_Parser->__construct('%PDF-1.5?%?????...', Object(Zend_Pdf_ElementFactory_Proxy), false) #2 /var/www/owncloud/apps/search_lucene/3rdparty/Zend/Pdf.php(255): Zend_Pdf->__construct('%PDF-1.5?%?????...', NULL) #3 /var/www/owncloud/apps/search_lucene/document/Pdf.php(21): Zend_Pdf::parse('%PDF-1.5?%?????...') #4 /var/www/owncloud/apps/search_lucene/document/Pdf.php(69): OCA\Search_Lucene\Document\Pdf->__construct('%PDF-1.5?%?????...', false, false) #5 /var/www/owncloud/apps/search_lucene/lib/indexer.php(94): OCA\Search_Lucene\Document\Pdf::loadPdf('%PDF-1.5?%?????...') #6 /var/www/owncloud/apps/search_lucene/lib/hooks.php(79): OCA\Search_Lucene\Indexer::indexFile('/ownCloudUserMa...', 'enoch') #7 [internal function]: OCA\Search_Lucene\Hooks::doIndexFile('{"path":"/ownC...') #8 /var/www/owncloud/lib/private/backgroundjob/legacy/queuedjob.php(16): call_user_func(Array, '{"path":"/ownC...') #9 /var/www/owncloud/lib/private/backgroundjob/job.php(34): OC\BackgroundJob\Legacy\QueuedJob->run(Array) #10 /var/www/owncloud/lib/private/backgroundjob/queuedjob.php(27): OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log)) #11 /var/www/owncloud/cron.php(114): OC\BackgroundJob\QueuedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log)) #12 {main} 2013-12-11T21:33:59+00:00

@butonic
Copy link
Member

butonic commented Dec 11, 2013

@enoch85 yes. this is a separete issue. PDF 1.5 is not yet supported by the zend libraries we use. Please open a new issue in the apps repository https://github.com/owncloud/apps/issues/new

@enoch85
Copy link
Member

enoch85 commented Dec 11, 2013

/apps/issues/1547 :)

This was referenced Dec 12, 2013
@Tie-fighter
Copy link

69f6d003f9c05238238e8df900efb435c6b577012be58a2fa48237c67a0e6552 owncloud-6.0.0.tar.bz2
Downloaded today.

{"app":"files_sharing","message":"starting app upgrade from 0.3.3 to 0.3.5","level":0,"time":"2013-12-12T09:49:07+00:00"}
{"app":"index","message":"Exception: Failed to upgrade \"files_sharing\".","level":4,"time":"2013-12-12T09:49:07+00:00"}
{"app":"core","message":"starting upgrade from 5.0.22 to 6.0.0.2","level":0,"time":"2013-12-12T09:49:09+00:00"}
{"app":"files_sharing","message":"starting app upgrade from 0.3.3 to 0.3.5","level":0,"time":"2013-12-12T09:49:10+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-12T09:49:10+00:00"}
{"app":"core","message":"can't remove app media. It is not installed.","level":3,"time":"2013-12-12T09:49:10+00:00"}
{"app":"files_sharing","message":"starting app upgrade from 0.3.3 to 0.3.5","level":0,"time":"2013-12-12T09:49:10+00:00"}
{"app":"index","message":"Exception: Failed to upgrade \"files_sharing\".","level":4,"time":"2013-12-12T09:49:10+00:00"}
{"app":"files_sharing","message":"starting app upgrade from 0.3.3 to 0.3.5","level":0,"time":"2013-12-12T09:51:21+00:00"}
{"app":"index","message":"Exception: Failed to upgrade \"files_sharing\".","level":4,"time":"2013-12-12T09:51:21+00:00"}
{"app":"core","message":"starting upgrade from 6.0.0.2 to 6.0.0.13","level":0,"time":"2013-12-12T09:51:22+00:00"}
{"app":"files_sharing","message":"starting app upgrade from 0.3.3 to 0.3.5","level":0,"time":"2013-12-12T09:51:23+00:00"}
{"app":"contacts","message":"starting app upgrade from 0.2.81 to 0.3","level":0,"time":"2013-12-12T09:51:23+00:00"}
{"app":"gallery","message":"starting app upgrade from 0.5.2 to 0.5.3","level":0,"time":"2013-12-12T09:51:23+00:00"}
{"app":"core","message":"Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at end of input\nLINE 1: ALTER TABLE \"oc_pictures_images_cache\" ALTER width SET \n                                                               ^' in \/var\/www\/thomas-steinbrenner.net\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php:742\nStack trace:\n#0 [internal function]: PDO->query('ALTER TABLE \"oc...')\n#1 \/var\/www\/thomas-steinbrenner.net\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(742): call_user_func_array(Array, Array)\n#2 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connection->query('ALTER TABLE \"oc...')\n#3 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(91): OC\\DB\\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\\DBAL\\Schema\\SchemaDiff))\n#4 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/db.php(373): OC\\DB\\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/thomas...')\n#5 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php(965): OC_DB::updateDbFromStructure('\/var\/www\/thomas...')\n#6 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php(867): OC_App::updateApp('gallery')\n#7 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php(92): OC_App::checkUpgrade('gallery')\n#8 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php(66): OC_App::loadApp('gallery')\n#9 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/updater.php(118): OC_App::loadApps()\n#10 \/var\/www\/thomas-steinbrenner.net\/owncloud\/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_pictures_images_cache\" ALTER width SET ':\n\nSQLSTATE[42601]: Syntax error: 7 ERROR:  syntax error at end of input\nLINE 1: ALTER TABLE \"oc_pictures_images_cache\" ALTER width SET \n                                                               ^' in \/var\/www\/thomas-steinbrenner.net\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php:47\nStack trace:\n#0 \/var\/www\/thomas-steinbrenner.net\/owncloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(744): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(PDOException), 'ALTER TABLE \"oc...')\n#1 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(152): Doctrine\\DBAL\\Connection->query('ALTER TABLE \"oc...')\n#2 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(91): OC\\DB\\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\\DBAL\\Schema\\SchemaDiff))\n#3 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/db.php(373): OC\\DB\\MDB2SchemaManager->updateDbFromStructure('\/var\/www\/thomas...')\n#4 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php(965): OC_DB::updateDbFromStructure('\/var\/www\/thomas...')\n#5 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php(867): OC_App::updateApp('gallery')\n#6 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php(92): OC_App::checkUpgrade('gallery')\n#7 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php(66): OC_App::loadApp('gallery')\n#8 \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/updater.php(118): OC_App::loadApps()\n#9 \/var\/www\/thomas-steinbrenner.net\/owncloud\/core\/ajax\/update.php(34): OC\\Updater->upgrade()\n#10     {main})","level":4,"time":"2013-12-12T09:51:24+00:00"}
{"app":"PHP","message":"Failed to upgrade \"gallery\". at \/var\/www\/thomas-steinbrenner.net\/owncloud\/lib\/private\/app.php#873","level":3,"time":"2013-12-12T09:51:24+00:00"}
{"app":"files_sharing","message":"starting app upgrade from 0.3.3 to 0.3.5","level":0,"time":"2013-12-12T09:51:24+00:00"}
{"app":"index","message":"Exception: Failed to upgrade \"files_sharing\".","level":4,"time":"2013-12-12T09:51:24+00:00"}

@agherzan
Copy link

Any idea on this error:
{"app":"core","message":"OC\Tags::getFavorites, exception: Could not find category "$!!$"","level":3,"time":"2013-12-12T15:36:13+00:00"}
{"app":"core","message":"OC\Tags::getFavorites, exception: Could not find category "$!!$"","level":3,"time":"2013-12-12T15:36:33+00:00"}
{"app":"core","message":"OC\Tags::getFavorites, exception: Could not find category "$!!$"","level":3,"time":"2013-12-12T15:36:58+00:00"}

@DeepDiver1975
Copy link
Member

@agherzan please open a new issue - this one is closed and the issues are unrelated - THX

@ulfklose
Copy link

Adding preupdate.php worked for me, too.

@mabasic
Copy link

mabasic commented Dec 14, 2013

Added the preupdate.php file and now everything works. No errors or warnings. But the update center is blank

@alexalouit
Copy link

Same here, apps/search_lucene/appinfo/preupdate.php work.

@GuillaumeBibaut
Copy link

This does not fix my problem. I've upgraded from 5.0.25 to 6.0.0.
I've used the preupdate.php file and the modified update.php, I've installed the 6.0.0 in an empty folder, then copied data and config from the 5.0.25 backup and I'm still getting the same error, then reloading tells that "oc_jobs" table does not exist.

Unknown database type varchar requested, Doctrine\DBAL\Platforms\SqlitePlatform may not support it.

That's the first message I'm getting

and

An exception occurred while executing 'SELECT "id" FROM "oc_jobs" WHERE "class" = ? AND "argument" = ?': SQLSTATE[HY000]: General error: 1 no such table: oc_jobs

this message is the one I'm getting if I refresh the page.
So I don't really understand what's going on.

@karlitschek
Copy link
Contributor

Can you test again with 6.0.0a please? http://download.owncloud.org/community/owncloud-6.0.0a.tar.bz2

@prologic
Copy link

I just updated to 6.0.0a via yum update and whilst I see no errors anymore in owncloud.log (that I can see) I still see the upgrade page and no login.

@hdering
Copy link

hdering commented Dec 16, 2013

only for your information:
update from 5.0.13 to 6.0.0a without database errors!

@prologic
Copy link

I believe my upgrade has no database errors too, hwoever why does the
upgrade page still persist on the main index page?

James Mills / prologic

E: prologic@shortcircuit.net.au
W: prologic.shortcircuit.net.au

On Mon, Dec 16, 2013 at 6:27 PM, hdering notifications@github.com wrote:

only for your information:
update from 5.0.13 to 6.0.0a without database errors!


Reply to this email directly or view it on GitHubhttps://github.com//issues/6313#issuecomment-30643370
.

@prologic
Copy link

I had to edit config/config.php and set maintenance to false to
fix this.

The failed upgrade obviously did not change the "maintenance" mode back.

James Mills / prologic

E: prologic@shortcircuit.net.au
W: prologic.shortcircuit.net.au

On Mon, Dec 16, 2013 at 6:35 PM, James Mills
prologic@shortcircuit.net.auwrote:

I believe my upgrade has no database errors too, hwoever why does the
upgrade page still persist on the main index page?

James Mills / prologic

E: prologic@shortcircuit.net.au
W: prologic.shortcircuit.net.au

On Mon, Dec 16, 2013 at 6:27 PM, hdering notifications@github.com wrote:

only for your information:
update from 5.0.13 to 6.0.0a without database errors!


Reply to this email directly or view it on GitHubhttps://github.com//issues/6313#issuecomment-30643370
.

@portedaix
Copy link

Hello,

Still buggy...

Just updated yesterday from version 5 (don't recall exactly which one) to 6.0.0a-0 and it bugs. I did 'apt-get dist-upgrade'

"apps/search_lucene/appinfo/preupdate.php" is already existing, I did not have to create it, "update" seems correct, I checked that "maintenance" is on "false" but still I have at login page :

"An exception occurred while executing 'SELECT "id" FROM "oc_jobs" WHERE "class" = ? AND "argument" = ?': SQLSTATE[HY000]: General error: 1 no such table: oc_jobs".

Somebody has a clue how to bring owncloud back to life ?

Thanks

@karlitschek
Copy link
Contributor

@butonic

@butonic
Copy link
Member

butonic commented Jan 17, 2014

It seems the issue with oc_jobs was tracked nowhere. I think @PVince81 first mentioned it in owncloud-archive/3rdparty#65 (comment)
A PR to fix the issue was already merged into stable6 #6406
My guess is that only addRegularTask has been patched. addQueuedTask does not yet contain the upgrade check. Investigating.
@portedaix which database are you using? postgresql?

@butonic
Copy link
Member

butonic commented Jan 17, 2014

@PVince81 I tried to reproduce the oc_jobs issue by migrating OC5.0.14a to OC6.0.0a on mysql and postgresql. I installed OC5, clicked in the search filed (which added three errors to the log regarding duplicate entries, but thats another issue), added a few files to add entries in the oc_queuedjobs table, closed the browser window, updated the files to OC6 and then opened owncloud again. It always finished the upgrade without an error. Even when I tried the postgres migration again with the added step of copying files into the users files folder before starting the migration. My idea was to force search lucene to add queued jobs during the upgrade .. but even that would not breag the upgrade or produce the oc_jobs error log.

I never added the DEBUG flag or increased logging. Do I need to do that to see the error? Do you know of a way to reliably reproduce the oc_jobs error?

@butonic
Copy link
Member

butonic commented Jan 17, 2014

@portedaix could you try with the Pull Request #6828 applied? It basically adds a check in addQueuedTask() at line 176 in lib/public/backgroundjob.php:

    public static function addQueuedTask($app, $class, $method, $parameters) {
        if (!\OC::needUpgrade()) {
            self::registerJob('OC\BackgroundJob\Legacy\QueuedJob', array('app' => $app, 'klass' => $class, 'method' => $method, 'parameters' => $parameters));
            return true;
        }
    }

@PVince81
Copy link
Contributor

@butonic I haven't been able to reproduce the oc_jobs issue since. Also, when it happened it was only a warning in the logs and didn't affect the update. Many people mistook it for the error they were having (since the message looked suspicious) but their errors were something else. The issue were it was fixed was #6294 (comment)

And the PR #6392 where addQueuedTask() seems to have been omitted.

@portedaix
Copy link

@butonic lib/public/backgroundjob.php is modified but there are no changes. I still have 'An exception occurred while executing 'SELECT "id" FROM "oc_jobs" WHERE "class" = ? AND "argument" = ?': SQLSTATE[HY000]: General error: 1 no such table: oc_jobs'

Regarding the database, I checked what is runing on the server. owncloud is an 'out of the box' installation on a dedicated server, rented to my provider. I did not install it myself. There is no mysql or pstgresql runing, but I found sqlite. What is surprising is that there are no tables. Is that normal ? 'sqlite> .tables' returned nothing.

Should I create an 'oc_jobs' tables as it was done here (with mysql) ? Or is it a dirty fix ? This server is a production server and I do not want to spoil it.
#6294

@func0der
Copy link

func0der commented Sep 2, 2014

Sorry, but this is still a problem when upgrading from 5.0.20 to the current 7.0.2.

Same error (partial):
ADD PRIMARY KEY (fileid)': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

Truncating the table helped, but is this the solution? And if yes, why is it not implemented?

@versae
Copy link

versae commented Sep 5, 2014

Same error here upgrading from 5.0.8 to the current 7.0.2.

@func0der, is there any other step you followed to make it work?

@func0der
Copy link

func0der commented Sep 7, 2014

Since my whole installation broke during the process, I did a lot of stuff.

But as I already mentioned, truncating the table oc_lucene_status got me at least rid this error message.
Afterwards my encryption broke, which I could rescue with a backup. It was a lot of work, but now it is working again. You should not have any syncing devices running during the update/upgrade process, because it can cause data corruption. With one of my devices it did and I had to abort the syncing, delete the sync in my owncloud client, delete all files in it, re-add the sync folder to my owncloud client and let it sync again.
But this is not really part of this problem, I think. Just mentioning it ^^

@versae
Copy link

versae commented Sep 7, 2014

Thanks @func0der. I tried truncating the table and it seems to work. Fortunately there was no devices sync'ing at that time :)

@lock lock bot locked as resolved and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests