Nextcloud: No logging

Hello, I did ‘apt disc-upgrade’ on Debian Buster. Since then nextcloud is not working anymore:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

I doublechecked and in /var/log/apache2/nextcloud_access.log there is just - - [16/May/2021:13:46:31 +0000] "GET / HTTP/1.0" 500 289

Then I doublechecked /var/log/apache2/nextcloud_error.log, but there is nothing if I try to access the page. The last error (I believe this happened while ‘apt dist-upgrade’ but not sure, also not sure if it’s related.

[Sun May 16 12:51:20.299236 2021] [php7:error] [pid 16283] [client] PHP Fatal error:  Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(448): OC\\DB\\Connection->connect()\n#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(410): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(354): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(710): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(181): OC\\DB\\Connection->__construct(Array, Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Ob in /var/www/nextcloud/lib/private/DB/Connection.php on line 64

Nextcloud version: 16.0.5 (I want to update, but have to fix the issue first)
Operating system and version: Debian GNU/Linux 9 \n \l
Apache or nginx version: Apache 2.4.25
PHP version: 7.3.28-1

The output of your config.php file in /path/to/nextcloud:

$CONFIG = array (
  'instanceid' => 'MASKED',
  'passwordsalt' => 'MASKED',
  'secret' => 'MASKED',
  'trusted_domains' => 
  array (
    0 => 'MASKED',
    1 => 'MASKED',
  'datadirectory' => '/var/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'MASKED',
  'overwriteprotocol' => 'https',
  'dbname' => 'MASKED',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'MASKED',
  'dbpassword' => 'MASKED',
  'htaccess.RewriteBase' => '/',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'MASKED',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'MASKED',
  'mail_smtpname' => 'MASKED',
  'mail_smtppassword' => 'MASKED',
  'mail_smtpport' => '587',
  'simpleSignUpLink.shown' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
  'maintenance' => false,
  'theme' => '',
  'log_type' => 'file',
  'log_file' => '/var/log/nextcloud.log',
  'loglevel' => 0,
  'logdateformat' => 'F d, Y H:i:s',
  'mysql.utf8mb4' => true,

The file /var/log/nextcloud.log is empty (I touched the file and chowned it to www-data:)
Since I don’t get any error/log about that issue I don’t have any idea where to start. :confused: I doublechecked with phpinfo() and it seems PHP is working (so module is loaded).

Best regards

Got it working. I just found the nextcloud.log in /var/nextcloud/data/nextcloud.log.

So, I want to know why is the parameter log_file ignored? Did I mistype anything?

About my issue: I had to install php7.3-apcu & php7.3-redis. Dunno why both packages were missing after ‘apt disc-upgrade’.

Best regards

Not sure, does the file exist, does www-data have the permission to write?

These dist-upgrades do not always install the same php modules. Not sure why, if a few names changed but it’s a common problem that some libraries can be missing.