Bug 962082 - Error while upgrading the database
Error while upgrading the database
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: owncloud (Show other bugs)
18
x86_64 Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Gregor Tätzner
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-11 11:04 EDT by Markku Korkeala
Modified: 2013-09-24 12:23 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-24 12:23:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Markku Korkeala 2013-05-11 11:04:22 EDT
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 12:11:01 EDT
Did you check upstream bug tracker for similar issues?
Comment 2 Markku Korkeala 2013-05-13 09:42:10 EDT
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 10:52:54 EDT
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 18:14:23 EDT
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 11:04:28 EDT
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 15:03:31 EDT
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 05:56:21 EDT
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 06:18:57 EDT
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.