owncloud-archive / news

:newspaper: News app for ownCloud
GNU Affero General Public License v3.0
290 stars 106 forks source link

8.7.5 upgrade results in malformed DB image #993

Closed Zotan closed 8 years ago

Zotan commented 8 years ago

Upgrading from 8.7.4 to 8.7.5 results in a malformed DB error message and an unusable news app installation Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TEMPORARY TABLE tempoc_news_items AS SELECT id, guid_hash, guid, author, body, enclosure_mime, enclosure_link, url, title, pub_date, feed_id, status, last_modified, search_index, rtl, fingerprint FROM oc_news_items': SQLSTATE[HY000]: General error: 11 database disk image is malformed

Steps to Reproduce

  1. Upgrade app through the web interface
  2. Redirected to owncloud mainetnance mode upgrade page
  3. attempt upgrade

    System Information

    • News app version: 8.7.5
    • ownCloud version: 9.0.2.2
    • PHP version: 5.6
    • Database and version: sqlite3
    • Browser and version: Firefox 46
    • Distribution and version: Debian Jessie

      Contents of owncloud/data/owncloud.log


{"reqId":"+5uDxk4Y5dxfeRVLAOwV","remoteAddr":"2001:8b0:cacf:efd9:f9bf:a66d:91ec:aea4","app":"core","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'CREATE TEMPORARY TABLE __temp__oc_news_items AS SELECT id, guid_hash, guid, author, body, enclosure_mime, enclosure_link, url, title, pub_date, feed_id, status, last_modified, search_index, rtl, fingerprint FROM oc_news_items':\\n\\nSQLSTATE[HY000]: General error: 11 database disk image is malformed\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(116): Doctrine\\\\DBAL\\\\Driver\\\\AbstractSQLiteDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(945): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOSqlite\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'CREATE TEMPORAR...')\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/repair\\\/sqliteautoincrement.php(93): Doctrine\\\\DBAL\\\\Connection->query('CREATE TEMPORAR...')\\n#3 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/repair.php(87): OC\\\\Repair\\\\SqliteAutoincrement->run()\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/updater.php(313): OC\\\\Repair->run()\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/updater.php(215): OC\\\\Updater->doUpgrade('9.0.2.2', '9.0.2.2')\\n#6 \\\/var\\\/www\\\/owncloud\\\/core\\\/ajax\\\/update.php(120): OC\\\\Updater->upgrade()\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractSQLiteDriver.php\",\"Line\":85}","level":3,"time":"2016-05-11T15:27:07+00:00","method":"GET","url":"\/owncloud\/core\/ajax\/update.php?requesttoken=BwgwBAkgDDoWdiIaEjkoMW0cWDsNc3ItZklFOmk2Iws%3D%3A1BS%2FpfKoQ3VREtNcYI1Nl%2BDyMxrC%2BPtrmqTOMh0fBzM%3D","user":"--"}
BernhardPosselt commented 8 years ago

See https://forum.owncloud.org/viewtopic.php?t=22343

Not a News issue ;)

BernhardPosselt commented 8 years ago

PS: Don't use Sqlite, it's buggy, slow, missing features and prone to locked databases. An exapmle of a missing feature is support for ALTER TABLE statements. This means that for any column that you want to change or add you need to copy the whole table to a new table (which is the temporary table stuff that you are experiencing). Your bug is probably unrelated to this though. It's just that your database got corrupted (dont ask why, bad hard drive?)

Also: