Internal server error, cannot connect to db

Expected and actual behaviour

Server should reply something else than “500 internal server error” when connecting to it. That’s what my client reports.
Opening in a web browser should display the oc file explorer. White page is shown instead.
This server has worked fine until a recent software update (webserver, DB and others).
I wish, to repair this and/or to upgrade to newer version of the server (my clients started complaining about outdated server version recently).

Server configuration

Operating system: DSM 6.2 (Synology)

Web server: Apache 2.2

Database: MariaDB

PHP version: 5.6

ownCloud version: (see ownCloud admin page) 9.1.4.2

Updated from an older ownCloud or fresh install: fresh

Where did you install ownCloud from: downloaded zip

Signing status (ownCloud 9.0 and above): ??

sudo -u http php occ config:list system
An unhandled exception has been thrown:
exception 'Doctrine\DBAL\DBALException' with message 'Failed to connect to the database: An exception occured in driver: could not find driver' in /volume1/web/owncloud/lib/private/DB/Connection.php:58
Stack trace:
#0 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(621): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /volume1/web/owncloud/lib/private/DB/Connection.php(141): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#6 /volume1/web/owncloud/lib/private/DB/ConnectionFactory.php(122): Doctrine\DBAL\DriverManager::getConnection(Array, Object(Doctrine\DBAL\Configuration), Object(Doctrine\Common\EventManager))
#7 /volume1/web/owncloud/lib/private/Server.php(414): OC\DB\ConnectionFactory->getConnection('mysql', Array)
#8 /volume1/web/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#9 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('DatabaseConnect...')
#10 /volume1/web/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('DatabaseConnect...')
#11 /volume1/web/owncloud/lib/private/Server.php(973): OC\ServerContainer->query('DatabaseConnect...')
#12 /volume1/web/owncloud/lib/private/Server.php(219): OC\Server->getDatabaseConnection()
#13 /volume1/web/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#14 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('OC\\Authenticati...')
#15 /volume1/web/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...')
#16 /volume1/web/owncloud/lib/private/Server.php(223): OC\ServerContainer->query('OC\\Authenticati...')
#17 /volume1/web/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#18 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('OC\\Authenticati...')
#19 /volume1/web/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...')
#20 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(150): OC\ServerContainer->query('OC\\Authenticati...')
#21 /volume1/web/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(109): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#22 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('OC\\Authenticati...')
#23 /volume1/web/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('OC\\Authenticati...')
#24 /volume1/web/owncloud/lib/private/Server.php(238): OC\ServerContainer->query('OC\\Authenticati...')
#25 /volume1/web/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#26 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('UserSession')
#27 /volume1/web/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('UserSession')
#28 /volume1/web/owncloud/lib/private/Server.php(850): OC\ServerContainer->query('UserSession')
#29 /volume1/web/owncloud/lib/private/Server.php(458): OC\Server->getUserSession()
#30 /volume1/web/owncloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#31 /volume1/web/owncloud/lib/private/AppFramework/Utility/SimpleContainer.php(102): Pimple\Container->offsetGet('AppManager')
#32 /volume1/web/owncloud/lib/private/ServerContainer.php(87): OC\AppFramework\Utility\SimpleContainer->query('AppManager')
#33 /volume1/web/owncloud/lib/private/Server.php(1150): OC\ServerContainer->query('AppManager')
#34 /volume1/web/owncloud/lib/private/legacy/app.php(285): OC\Server->getAppManager()
#35 /volume1/web/owncloud/lib/private/legacy/app.php(106): OC_App::getEnabledApps()
#36 /volume1/web/owncloud/lib/base.php(573): OC_App::loadApps(Array)
#37 /volume1/web/owncloud/lib/base.php(973): OC::init()
#38 /volume1/web/owncloud/console.php(58): require_once('/volume1/web/ow...')
#39 /volume1/web/owncloud/occ(11): require_once('/volume1/web/ow...')
#40 {main}

Logs

Web server error log

2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: PHP message: PHP Fatal error:  Uncaught exception 'Doctrine\\DBAL\\DBALException' with message 'Failed to connect to the database: An exception occured in driver: could not find driver' in /volume1/web/owncloud/lib/private/DB/Connection.php:58
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: Stack trace:
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #0 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #1 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #2 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #3 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(621): Doctrine\\DBAL\\Connection->getDatabasePlatform()
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #4 /volume1/web/owncloud/lib/private/DB/Connection.php(141): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #5 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(A...
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: PHP message: PHP Fatal error:  Uncaught exception 'Doctrine\\DBAL\\DBALException' with message 'Failed to connect to the database: An exception occured in driver: could not find driver' in /volume1/web/owncloud/lib/private/DB/Connection.php:58
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: Stack trace:
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #0 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #1 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #2 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #3 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(621): Doctrine\\DBAL\\Connection->getDatabasePlatform()
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #4 /volume1/web/owncloud/lib/private/DB/Connection.php(141): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)
2018-11-04T21:29:46+01:00 somaxluan [Sun Nov 04 21:29:46 2018] [error] [client 192.168.1.254] FastCGI: server "/default-php-517ba3c5-2333-43d6-8421-da8e953b26c2" stderr: #5 /volume1/web/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(A...

ownCloud log (data/owncloud.log)

sudo tail data/owncloud.log 
{"reqId":"PIqJhRBhviaOrEXSRaD5","remoteAddr":"192.168.1.44","app":"PHP","message":"Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php:\/\/input stream instead. at Unknown#0","level":3,"time":"2017-03-15T09:18:35+00:00","method":"POST","url":"\/owncloud\/index.php\/heartbeat","user":"--"}
{"reqId":"SHdnBV0xWKp07aXCY2HR","remoteAddr":"192.168.1.44","app":"PHP","message":"Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php:\/\/input stream instead. at Unknown#0","level":3,"time":"2017-03-15T09:33:35+00:00","method":"POST","url":"\/owncloud\/index.php\/heartbeat","user":"--"}
{"reqId":"HaGkRoEsQ06iE4PASALF","remoteAddr":"192.168.1.44","app":"PHP","message":"Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php:\/\/input stream instead. at Unknown#0","level":3,"time":"2017-03-15T09:48:35+00:00","method":"POST","url":"\/owncloud\/index.php\/heartbeat","user":"--"}

Well, this ‘others’ might be of interest. :wink:

Maybe this helps:

3 Likes