General error: 11 database disk image is malformed

10

#1

Hello,

During XMas time but probably during the last 48 hours, something happened.
I didn't do anything specific on the server itself (OVH hosting)
I've got up to 3 computer synchronizing as well as an Android phone. I've noticed today that I can't connect any more, and I got this error in my log, several time

General error: 11 database disk image is malformed

Complete error looks like:

{"reqId":"WlEXigoAfqkAAGIHsV4AAABM","level":3,"time":"2018-01-06T18:38:03+00:00","remoteAddr":"109.190.228.210","user":"--","app":"index","method":"GET","url":"\/owncloudX\/","message":"Exception: {\"Exception\":\"Doctrine\\DBAL\\Exception\\DriverException\",\"Message\":\"An exception occurred while executing 'SELECT * FROM \\"oc_appconfig\\"':\n\nSQLSTATE[HY000]: General error: 11 database disk image is malformed\",\"Code\":0,\"Trace\":\"#0 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/composer\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractSQLiteDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/composer\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Connection.php(855): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOSqlite\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'SELECT * FROM \\"...', Array)\n#2 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/DB\\/Connection.php(190): Doctrine\\DBAL\\Connection->executeQuery('SELECT * FROM \\"...', Array, Array, NULL)\n#3 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/composer\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Query\\/QueryBuilder.php(206): OC\\DB\\Connection->executeQuery('SELECT * FROM `...', Array, Array)\n#4 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/DB\\/QueryBuilder\\/QueryBuilder.php(141): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/AppConfig.php(277): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/AppConfig.php(78): OC\\AppConfig->loadConfigValues()\n#7 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/AppConfig.php(254): OC\\AppConfig->getApps()\n#8 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/legacy\\/app.php(1045): OC\\AppConfig->getValues(false, 'installed_versi...')\n#9 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/Server.php(372): OC_App::getAppVersions()\n#10 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/composer\\/pimple\\/pimple\\/src\\/Pimple\\/Container.php(113): OC\\Server->OC\\{closure}(Object(OC\\Server))\n#11 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/AppFramework\\/Utility\\/SimpleContainer.php(111): Pimple\\Container->offsetGet('MemCacheFactory')\n#12 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/ServerContainer.php(87): OC\\AppFramework\\Utility\\SimpleContainer->query('MemCacheFactory')\n#13 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/Server.php(1092): OC\\ServerContainer->query('MemCacheFactory')\n#14 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/Server.php(513): OC\\Server->getMemCacheFactory()\n#15 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/composer\\/pimple\\/pimple\\/src\\/Pimple\\/Container.php(113): OC\\Server->OC\\{closure}(Object(OC\\Server))\n#16 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/AppFramework\\/Utility\\/SimpleContainer.php(111): Pimple\\Container->offsetGet('AppManager')\n#17 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/ServerContainer.php(87): OC\\AppFramework\\Utility\\SimpleContainer->query('AppManager')\n#18 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/Server.php(1298): OC\\ServerContainer->query('AppManager')\n#19 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/legacy\\/app.php(313): OC\\Server->getAppManager()\n#20 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/private\\/legacy\\/app.php(107): OC_App::getEnabledApps()\n#21 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/base.php(579): OC_App::loadApps(Array)\n#22 \\/home\\/teebo\\/www\\/owncloudX\\/lib\\/base.php(1003): OC::init()\n#23 \\/home\\/teebo\\/www\\/owncloudX\\/index.php(47): require_once('\\/home\\/teebo\\/www...')\n#24 {main}\",\"File\":\"\\/home\\/teebo\\/www\\/owncloudX\\/lib\\/composer\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Driver\\/AbstractSQLiteDriver.php\",\"Line\":85}"}

Any help appreciate as there is nothing to undo and I've got no clue where to start...

Thanks.


#2

Other than google the problem I can't be of more help link

There is a post in the old forums pointing to https://techblog.dorogin.com/sqliteexception-database-disk-image-is-malformed-77e59d547c50 that might also help

Note that I'm not sure if that will solve the problem or cause a bigger problem, so make sure you can at least restore to the current state.


#3

Hi,
Thanks for the tips. Google is not really helping, at least with my understanding...

What I already did:
Try to restore database from the week before (thanks to OVH), with no effect

I went in PHP My admin and add a look at all table, but they all seems OK (no SQL error while trying to look at them)

Database: MySQL 5.5, oc tables are of type InnoDB, other applications in the same database (other tables of course) are working fine.

Any clue is welcome :-/


#4

Can you tell us about what software versions you're running? Also, the error seems to refer to SQLite, but am I right in thinking that you're running MySQL 5.5? What about the system logs (/var/log/messages, /var/log/syslog)?


#5

Based on the error trace I assume you're connecting to a corrupted sqlite3 database, or maybe to a sqlite with a sqlite3 client.

Check your owncloud's configuration about this.


#6

I have had the same problem (but with nextcloud), also in shared host with OVH.

The following fixed my problem:

  • Download the nextcloud/data/owncloud.db file to your PC (make two copies of this file just in case and keep one in a safe place).
  • Dump the file to a backup file
    sqlite3 owncloud.db .dump > nextcloud-sqlbkp_date +"%Y%m%d".bak
  • Erase the owncloud.db file
    rm owncloud.db
  • Dump the backuped file to a new owncloud.db file
    sqlite3 owncloud.db < nextcloud-sqlbkp.bak
  • Upload this restored file to your hosting.

This worked for me, hope that it helps.


#7

Hi All,

Thanks for the help, it appears that :slight_smile:
1-I should be more organized in my private stough and note what I do
2-This instance of owncloud is based on sqlite as jvillafanez suggested, and I checked the older owncloud tables from an old old instance that I'm not running anymore
3- That Lareamikel saved the day for me as I did what he suggested and now, back online!

So again thanks to all of you, and specially to larreamikel !


#8

uhm... It seems that this is a temporal solution. I have the same problem again. So, make a backup while it's up. :wink:


#9

Note that ownCloud recommend to use mysql / mariaDB or postgresql instead of sqlite3. sqlite3 is fine for small instances with low load but once the load grows it starts to be problematic.