[SOLVED] Internal server error - no log entries

Nextcloud version (eg, 20.0.5): 21.0.0-9
Operating system and version (eg, Ubuntu 20.04): arch
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.46-3
PHP version (eg, 7.4): 8.0.3-1

The issue you are facing:

Internal Server Error message when accessing via website after upgrading to v21 from v20. No details given, but there is a request ID. There is no corresponding entry in the nextcloud log—in fact there are no messages generated from accessing the website despite lowering the log_level to 1. If I run occ log:tail from a shell, however, this generates an error that is appended to the log.

I cannot debug my internal server error because I cannot see any log messages from accessing nextcloud via a browser.

Is this the first time you’ve seen this error? Y

Steps to replicate it:

  1. Visit https://nextcloud.<domain>.com

The output of your Nextcloud log in Admin > Logging:

N/A - cannot access dashboard. The logfile /var/log/nextcloud/nextcloud.log (configured in my config.php file) is empty.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '<removed>',
  'passwordsalt' => '<removed>',
  'secret' => '<removed>',
  'trusted_domains' =>
  array (
    0 => '<removed domain>',
    1 => 'nextcloud.<removed domain>',
  ),
  'datadirectory' => '/Cloud/data',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => 1,
  'overwrite.cli.url' => 'https://nextcloud.<removed domain>',
  'dbtype' => 'pgsql',
  'version' => '21.0.0.18',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '<removed>',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'theme' => '',
  'maintenance' => false,
  'enable_previews' => false,
  'apps_paths' => [
    [
      'path'=> '/usr/share/webapps/nextcloud/apps',
      'url' => '/apps',
      'writable' => false,
    ],
    [
      'path'=> '/var/lib/nextcloud/apps',
      'url' => '/wapps',
      'writable' => true,
    ],
  ],
);

The output of your Apache/nginx/system log in /var/log/____:
Various logs. Unclear what is desired here… no apparent errors

In case anyone visits this with similar issues…

I enabled php logging by setting an error_log value in /etc/php/php.ini. This logged what was actually happening. Lots of permissions errors.

https://wiki.archlinux.org/index.php/Nextcloud

“If nextcloud keeps reporting an internal server error depending on your setup it might be needed to allow apache to access your files using nextcloud user permission. Install AUR: mod_itkAUR and add this to your vhost setup:”

With nextcloud 21, various directories should now be owned by the nextcloud user. This broke permissions with my setup, but the only place I found clear instructions for this was in the arch wiki. mod_itk allowed the http user to access directories owned by nextcloud and things are working again.

1 Like