Bug 962082 - Error while upgrading the database
Summary: Error while upgrading the database
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: owncloud
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Gregor Tätzner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-11 15:04 UTC by Markku Korkeala
Modified: 2013-09-24 16:23 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-24 16:23:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
HTTPD error log (1.67 KB, text/plain)
2013-05-11 15:04 UTC, Markku Korkeala
no flags Details

Description Markku Korkeala 2013-05-11 15:04:22 UTC
Created attachment 746580 [details]
HTTPD error log

Description of problem:
After updating to the latest version (4.5.10) the database upgrade (postgresql) fails leaving owncloud unusable state.

Version-Release number of selected component (if applicable):
owncloud-4.5.10-1.fc18.noarch
owncloud-httpd-4.5.10-1.fc18.noarch
owncloud-postgresql-4.5.10-1.fc18.noarch
php-pear-MDB2-Driver-pgsql-1.5.0-0.7.b4.fc18.noarch

How reproducible:

Steps to Reproduce:
1.Install owncloud 4.5.9, use postgresql as the database backend.
2.Upgrade to 4.5.10
3.Go to the login page.
 
Actual results:
"Error while upgrading the database" page is displayed.

Expected results:
Database upgrade succeeds and owncloud loginpage is displayed.

Additional info:
First the was problem with pear's pgsql driver (see attachment), I made the compatible and now it doesn't output anything to HTTPD's error log. In the syslog ( /var/log/messages ):
ownCloud[29092]: {core} Failed to update database structure (MDB2 Error: syntax error, _doQuery: [Error message: Could not execute statement]

Comment 1 Gregor Tätzner 2013-05-11 16:11:01 UTC
Did you check upstream bug tracker for similar issues?

Comment 2 Markku Korkeala 2013-05-13 13:42:10 UTC
I tried checking, did not find exact match. Some reports about SQLite databases getting locked and then some similiar error about "Failed to update database structure". There was usually a SQL statement in log files, that would help getting to the root cause, which statement fails. My logfiles just have the:

ownCloud[29092]: {core} Failed to update database structure (MDB2 Error: syntax error, _doQuery: [Error message: Could not execute statement]

But no indication of what statement fails. As this quite small update (from 4.5.9 to 4.5.10) is there even modifications to the database structure?

Comment 3 James Szinger 2013-08-06 14:52:54 UTC
I'm having this same problem upgrading from owncloud-4.5.11-2.fc19 to owncloud-4.5.13-1.fc19 under Fedora 19.  Owncloud is working again after a yum downgrade to the previous version.

The error message in the httpd error_log is
PHP Strict standards:  Declaration of MDB2_Driver_Manager_pgsql::listTables() should be compatible with MDB2_Driver_Manager_Common::listTables($database = NULL) in /usr/share/pear/MDB2/Driver/Manager/pgsql.php on line 57

It seems that this code path is only used after an upgrade of a postgresql-backed owncloud.  The error message suggests that the actual bug might be in php-pear-MDB2-Driver-pgsql, but I don't know PHP well enough to confirm it or write a test case.

My searching led straight to this bug report.  I wasn't able to find anything upstream or on the broader internet.

Comment 4 James Szinger 2013-08-14 22:14:23 UTC
This bug seems similar to
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717579
https://github.com/owncloud/core/issues/4158
and https://github.com/owncloud/core/issues/4305

These reports are for owncloud 5, but I think it also applies to owncloud 4.5.  Owncloud bundles a patched version of MDB2-Driver-pgsql, which I've found in upstream's  owncloud-4.5.13.tar.bz2 under owncloud/3rdparty/MDB2.

Comment 5 James Szinger 2013-08-15 15:04:28 UTC
I just copied MBD2.php and the MDB2 tree from the owncloud tarfile to /usr/share/owncloud/3rdparty and successfully updated to owncloud-4.5.13-1.fc19.noarch.  So yes, owncloud's patches to MDB2 are needed to work with PostgreSQL.

Comment 6 Gregor Tätzner 2013-08-15 19:03:31 UTC
can you repeat your test case with this build?

http://koji.fedoraproject.org/koji/taskinfo?taskID=5819897

Comment 7 David Jaša 2013-09-17 09:56:21 UTC
Hi Gregor, would you mind to reschedule the scratch build? I encountered the problem, too, and I'm willing to test the fix. FWIW, I've updated from owncloud-4.5.12-1.fc19.noarch to owncloud-4.5.13-1.fc19.noarch.

Comment 8 David Jaša 2013-09-17 10:18:57 UTC
I now noticed the owncloud-4.5.13-3.fc19.noarch in updates-testing (it didn't apparently make to the stable on ARM yet) and it indeed fixes the issue. Sorry for the noise in comment 7. The bug should be closed now IMO.


Note You need to log in before you can comment on or make changes to this bug.