Internal Server Error Please help

Hello everbody,

I get after a apt-get update and uprade the Internal Server Error after opening my nextcloud. I have installed the nextcloud new an have installed only 2-3 Apps in it.

nextcloud.log
{“reqId”:“X10i674Pe7Vy5SEi5oHnSQAATSA”,“level”:3,“time”:“2020-09-12T19:35:07+00:00”,“remoteAddr”:“192.168.20.43”,“user”:"–",“app”:“core”,“method”:“GET”,“url”:"/favicon.ico",“message”:{“Exception”:“Doctrine\DBAL\DBALException”,“Message”:“Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user ‘weaver’@‘localhost’ (using password: YES)”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",“line”:889,“function”:“connect”,“class”:“OC\DB\Connection”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/DB/Connection.php",“line”:194,“function”:“executeQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:"->",“args”:[“SELECT * FROM oc_appconfig“,[],[],null]},{“file”:”/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php”,“line”:200,“function”:“executeQuery”,“class”:“OC\DB\Connection”,“type”:"->",“args”:[“SELECT * FROM oc_appconfig“,[],[]]},{“file”:”/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php”,“line”:216,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuilder”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“line”:331,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“line”:109,“function”:“loadConfigValues”,“class”:“OC\AppConfig”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“line”:287,“function”:“getApps”,“class”:“OC\AppConfig”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_App.php",“line”:883,“function”:“getValues”,“class”:“OC\AppConfig”,“type”:"->",“args”:[false,“installed_version”]},{“file”:"/var/www/nextcloud/lib/private/TemplateLayout.php",“line”:164,“function”:“getAppVersions”,“class”:“OC_App”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_Template.php",“line”:185,“function”:"__construct",“class”:“OC\TemplateLayout”,“type”:"->",“args”:[“error”,""]},{“file”:"/var/www/nextcloud/lib/private/Template/Base.php",“line”:132,“function”:“fetchPage”,“class”:“OC_Template”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_Template.php",“line”:334,“function”:“printPage”,“class”:“OC\Template\Base”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/index.php",“line”:63,“function”:“printExceptionErrorPage”,“class”:“OC_Template”,“type”:"::",“args”:[{“class”:“Doctrine\DBAL\DBALException”},500]}],“File”:"/var/www/nextcloud/lib/private/DB/Connection.php",“Line”:67,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36 Edg/85.0.564.51”,“version”:“19.0.2.2”}
{“reqId”:“APIoPRlojV9WbEL4vQEA”,“level”:3,“time”:“2020-09-12T19:45:01+00:00”,“remoteAddr”:"",“user”:"–",“app”:“cron”,“method”:"",“url”:"–",“message”:{“Exception”:“Doctrine\DBAL\DBALException”,“Message”:“Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user ‘weaver’@‘localhost’ (using password: YES)”,“Code”:0,“Trace”:[{“file”:"/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php",“line”:889,“function”:“connect”,“class”:“OC\DB\Connection”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/DB/Connection.php",“line”:194,“function”:“executeQuery”,“class”:“Doctrine\DBAL\Connection”,“type”:"->",“args”:[“SELECT * FROM oc_appconfig“,[],[],null]},{“file”:”/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php”,“line”:200,“function”:“executeQuery”,“class”:“OC\DB\Connection”,“type”:"->",“args”:[“SELECT * FROM oc_appconfig“,[],[]]},{“file”:”/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php”,“line”:216,“function”:“execute”,“class”:“Doctrine\DBAL\Query\QueryBuilder”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“line”:331,“function”:“execute”,“class”:“OC\DB\QueryBuilder\QueryBuilder”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“line”:109,“function”:“loadConfigValues”,“class”:“OC\AppConfig”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/AppConfig.php",“line”:287,“function”:“getApps”,“class”:“OC\AppConfig”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_App.php",“line”:883,“function”:“getValues”,“class”:“OC\AppConfig”,“type”:"->",“args”:[false,“installed_version”]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:663,“function”:“getAppVersions”,“class”:“OC_App”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:"->",“args”:["*** sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:124,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:"->",“args”:[“OC\Memcache\Factory”]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:1701,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“OC\Memcache\Factory”]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:854,“function”:“getMemCacheFactory”,“class”:“OC\Server”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:118,“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:"->",“args”:[" sensitive parameters replaced "]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:124,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:"->",“args”:[“OC\App\AppManager”]},{“file”:"/var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php",“line”:163,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“OC\App\AppManager”]},{“file”:"/var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php",“line”:114,“function”:“OC\AppFramework\Utility\{closure}”,“class”:“OC\AppFramework\Utility\SimpleContainer”,“type”:"->",“args”:[" sensitive parameters replaced ***"]},{“file”:"/var/www/nextcloud/lib/private/ServerContainer.php",“line”:124,“function”:“offsetGet”,“class”:“Pimple\Container”,“type”:"->",“args”:[“OCP\App\IAppManager”]},{“file”:"/var/www/nextcloud/lib/private/Server.php",“line”:1891,“function”:“query”,“class”:“OC\ServerContainer”,“type”:"->",“args”:[“OCP\App\IAppManager”]},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_App.php",“line”:347,“function”:“getAppManager”,“class”:“OC\Server”,“type”:"->",“args”:[]},{“file”:"/var/www/nextcloud/lib/private/legacy/OC_App.php",“line”:114,“function”:“getEnabledApps”,“class”:“OC_App”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:648,“function”:“loadApps”,“class”:“OC_App”,“type”:"::",“args”:[[“session”]]},{“file”:"/var/www/nextcloud/lib/base.php",“line”:1095,“function”:“init”,“class”:“OC”,“type”:"::",“args”:[]},{“file”:"/var/www/nextcloud/cron.php",“line”:42,“args”:["/var/www/nextcloud/lib/base.php"],“function”:“require_once”}],“File”:"/var/www/nextcloud/lib/private/DB/Connection.php",“Line”:67,“CustomMessage”:"–"},“userAgent”:"–",“version”:“19.0.2.2”}

MySQL Errorlog
2020-09-12 20:49:18 29011 [Warning] Access denied for user ‘xxx’@‘localhost’ (using password: YES)

But the User xxx has got the rights on the database

an here is my config.log

<?php $CONFIG = array ( 'passwordsalt' => 'xxx', 'secret' => 'xxx', 'trusted_domains' => array ( 0 => 'xxx', 11 => 'xxx', 1 => 'xxx', 12 => 'xxx', ), 'datadirectory' => '/var/www/nextcloud/data', 'dbtype' => 'mysql', 'version' => '19.0.2.2', 'overwrite.cli.url' => 'xxx', 'dbname' => 'xxx, 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'xxx', 'dbpassword' => 'xxxx', 'memcache.local' => '\\OC\\Memcache\\Redis', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'timeout' => 0.0, 'password' => 'xxx', ), 'instanceid' => 'xxx', 'installed' => true, ); Can anybody help me please????

Please explain IN DETAIL how you’ve tested that the user has access to the database.

Instead of using “localhost”, have you tried to access the database using a socket, like e.g.:

'dbhost'        => 'localhost:/run/mysql/mysql.sock',

BTW, why are you using such a strange trusted domains setting (0 …, 11 …, 1 …, 12 …) ?

I created a database when I set it up. I followed the following steps:

mysql -u root -p
create database DBNAME;
GRANT ALL ON nextcloud. * TO ‘USER’ @ ‘localhost’ IDENTIFIED BY ‘PW’;
flush privileges;

Everything successful. Everything went well. After an apt-get update and upgrade and finally a restart, no more.

The XXX is just a placeholder!
I give

‘dbhost’ => ‘localhost: /run/mysql/mysql.sock’,

in the config, nothing changes! The problem continues

I don’t know if it makes a difference but I used the following command to grant access rights:

GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'${DB_HOST}' IDENTIFIED BY '${DB_PASS}';

Have you modified the socket path so that it matches your installation?

Make sure that the socket can be accessed by the web servers user and run your access tests under this user first BEFORE you use Nextcloud, like e.g.:

su - web-server-user -s /bin/sh
mysql  -h localhost -Dnextcloud -u waever -p
  or
mysql  -S /run/mysql/mysql.sock -Dnextcloud -u waever -p