500 error after upgrading from easyApache 3 to easyApache 4


#1

Hi there,

We upgraded our server from easyApache3 to easyApache4, since that moment owncloud stopped working. We were using:
'dbtype' => 'sqlite3',
'version' => '9.1.4.2',

All was working well until upgrade. I found this post https://central.owncloud.org/t/internal-server-error-with-easy-apache-4/1705 , which is having a similar problem, but I checked and as per config file, we were using already sqlite3.

In Owncloud log, we are getting this:
7-06-15T16:00:39+00:00","method":"GET","url":"\/owncloud\/","user":"--"}
{"reqId":"WUK2yB@AbpQhIRibHiY3pAAAAAg","remoteAddr":"66.117.15.155","app":"index","message":"Exception: {\"Exception\":\"Doctrine\\DBAL\\Exception\\DriverException\",\"Message\":\"An exception occurred while executing 'SELECT * FROM \\"oc_appconfig\\"':\n\nSQLSTATE[HY000]: General error: 26 file is encrypted or is not a database\",\"Code\":0,\"Trace\":\"#0 \\/home\\/jamenk5\\/public_html\\/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 \\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Connection.php(836): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOSqlite\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'SELECT * FROM \\"...', Array)\n#2 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/DB\\/Connection.php(188): Doctrine\\DBAL\\Connection->executeQuery('SELECT * FROM \\"...', Array, Array, NULL)\n#3 \\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Query\\/QueryBuilder.php(206): OC\\DB\\Connection->executeQuery('SELECT * FROM \\"...', Array, Array)\n#4 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/DB\\/QueryBuilder\\/QueryBuilder.php(141): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppConfig.php(274): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppConfig.php(77): OC\\AppConfig->loadConfigValues()\n#7 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppConfig.php(253): OC\\AppConfig->getApps()\n#8 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/legacy\\/app.php(1102): OC\\AppConfig->getValues(false, 'installed_versi...')\n#9 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/Server.php(328): OC_App::getAppVersions()\n#10 \\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/pimple\\/pimple\\/src\\/Pimple\\/Container.php(113): OC\\Server->OC\\{closure}(Object(OC\\Server))\n#11 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppFramework\\/Utility\\/SimpleContainer.php(102): Pimple\\Container->offsetGet('MemCacheFactory')\n#12 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/ServerContainer.php(87): OC\\AppFramework\\Utility\\SimpleContainer->query('MemCacheFactory')\n#13 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/Server.php(954): OC\\ServerContainer->query('MemCacheFactory')\n#14 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/Server.php(461): OC\\Server->getMemCacheFactory()\n#15 \\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/pimple\\/pimple\\/src\\/Pimple\\/Container.php(113): OC\\Server->OC\\{closure}(Object(OC\\Server))\n#16 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppFramework\\/Utility\\/SimpleContainer.php(102): Pimple\\Container->offsetGet('AppManager')\n#17 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/ServerContainer.php(87): OC\\AppFramework\\Utility\\SimpleContainer->query('AppManager')\n#18 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/Server.php(1150): OC\\ServerContainer->query('AppManager')\n#19 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/legacy\\/app.php(285): OC\\Server->getAppManager()\n#20 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/legacy\\/app.php(106): OC_App::getEnabledApps()\n#21 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/base.php(573): OC_App::loadApps(Array)\n#22 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/base.php(973): OC::init()\n#23 \\/home\\/jamenk5\\/public_html\\/owncloud\\/index.php(52): require_once('\\/home\\/jamenk5\\/p...')\n#24 {main}\",\"File\":\"\\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Driver\\/AbstractSQLiteDriver.php\",\"Line\":85}","level":3,"time":"2017-06-15T16:33:12+00:00","method":"GET","url":"\/owncloud\/","user":"--"}
{"reqId":"WUK2yB@AbpQhIRibHiY3pAAAAAg","remoteAddr":"66.117.15.155","app":"core","message":"Exception: {\"Exception\":\"Doctrine\\DBAL\\Exception\\DriverException\",\"Message\":\"An exception occurred while executing 'SELECT * FROM \\"oc_appconfig\\"':\n\nSQLSTATE[HY000]: General error: 26 file is encrypted or is not a database\",\"Code\":0,\"Trace\":\"#0 \\/home\\/jamenk5\\/public_html\\/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 \\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Connection.php(836): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOSqlite\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'SELECT * FROM \\"...', Array)\n#2 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/DB\\/Connection.php(188): Doctrine\\DBAL\\Connection->executeQuery('SELECT * FROM \\"...', Array, Array, NULL)\n#3 \\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Query\\/QueryBuilder.php(206): OC\\DB\\Connection->executeQuery('SELECT * FROM \\"...', Array, Array)\n#4 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/DB\\/QueryBuilder\\/QueryBuilder.php(141): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppConfig.php(274): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppConfig.php(77): OC\\AppConfig->loadConfigValues()\n#7 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppConfig.php(253): OC\\AppConfig->getApps()\n#8 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/legacy\\/app.php(1102): OC\\AppConfig->getValues(false, 'installed_versi...')\n#9 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/Server.php(328): OC_App::getAppVersions()\n#10 \\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/pimple\\/pimple\\/src\\/Pimple\\/Container.php(113): OC\\Server->OC\\{closure}(Object(OC\\Server))\n#11 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppFramework\\/Utility\\/SimpleContainer.php(102): Pimple\\Container->offsetGet('MemCacheFactory')\n#12 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/ServerContainer.php(87): OC\\AppFramework\\Utility\\SimpleContainer->query('MemCacheFactory')\n#13 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/Server.php(954): OC\\ServerContainer->query('MemCacheFactory')\n#14 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/Server.php(461): OC\\Server->getMemCacheFactory()\n#15 \\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/pimple\\/pimple\\/src\\/Pimple\\/Container.php(113): OC\\Server->OC\\{closure}(Object(OC\\Server))\n#16 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/AppFramework\\/Utility\\/SimpleContainer.php(102): Pimple\\Container->offsetGet('AppManager')\n#17 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/ServerContainer.php(87): OC\\AppFramework\\Utility\\SimpleContainer->query('AppManager')\n#18 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/Server.php(1150): OC\\ServerContainer->query('AppManager')\n#19 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/legacy\\/app.php(285): OC\\Server->getAppManager()\n#20 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/private\\/legacy\\/app.php(106): OC_App::getEnabledApps()\n#21 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/base.php(573): OC_App::loadApps(Array)\n#22 \\/home\\/jamenk5\\/public_html\\/owncloud\\/lib\\/base.php(973): OC::init()\n#23 \\/home\\/jamenk5\\/public_html\\/owncloud\\/index.php(52): require_once('\\/home\\/jamenk5\\/p...')\n#24 {main}\",\"File\":\"\\/home\\/jamenk5\\/public_html\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Driver\\/AbstractSQLiteDriver.php\",\"Line\":85}","level":3,"time":"2017-06-15T16:33:12+00:00","method":"GET","url":"\/owncloud\/","user":"--"}

Any help would be appreciate it.

Thanks a lot,


#2

From the page you linked to, it sounds like ownCloud can't open the SQLite database (presumably because it's version 2 and wasn't upgraded as part of the easyApache upgrade). It sounds like you need to manage the upgrade of the SQLite database from version 2 to 3.


#3

Thanks for your reply. I tried to do it, running this in putty: sqlite OLD.DB .dump | sqlite3 NEW.DB
And also tried to do it in Windows, but always I get this error "file is encrypted or is not a database"

I am not sure if database is in sqlite3 or 2. I recently upgraded version to owncloud 9 and when backing up I use this sqlite3 data/owncloud.db .dump > owncloud-dbbackup_date +"%Y%m%d".bak and worked fine. Not an expert in working with putty and server really.

And when I try to view database, at the beginning it says Sqlite3.... so I am not sure what version the db has.

Thanks