Internal Server Error + Logs not working

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 24.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.4 LTS
Apache or nginx version (eg, Apache 2.4.25): 2.4.53
PHP version (eg, 7.4): 8.0.20

The issue you are facing:
Nextcloud was working wonderfully for me, then I shutdown my server to relocate it to a different shelf in the entertainment stand (all wires, etc. reinstalled properly) and now all of a sudden, I’m getting an internal server error and my page won’t load. As the prompt suggests, I checked the logs for more information, but I’m surprised to find that the last time my logs were updated was 3/26/22. There is no new information. I’ve tried to troubleshoot that, so then I can troubleshoot the internal server error, but I can’t figure out how to get the logs outputting. I’ve tried checking/updating permissions. I changed the file location and name in config.php. Nothing is getting a log file to show up.

I’m using docker, so I just deleted the container and redownloaded and recreated the container. Continues to have the error and not log. At least when I went backwards to 23-apache docker version, I got a new error which was 502 nginx error (I’m using a nginx reverse proxy+lets encrypt container). went back to the “latest” docker version. It seems that I must first figure out how to get my instance logging correctly, then I can track down the internal error.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. load nextcloud by webpage “https://nextcloud.[mydomain]” or by ip address (from inside the network) “http://[serverip]:[exposed port]”

The output of your Nextcloud log in Admin > Logging:

None available. Can't get to Admin page.

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'overwriteprotocol' => 'https',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'redis',
    'password' => '[redacted]',
    'port' => 6379,
  ),
  'passwordsalt' => '[redacted]',
  'secret' => '[redacted]',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'nextcloud.[redacted].duckdns.org',
    2 => '10.0.0.[redacted]',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '24.0.1.1',
  'overwrite.cli.url' => 'http://10.0.0.[redacted]',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '[redacted]',
  'installed' => true,
  'instanceid' => 'ocgkjimikbui',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud.log',
  'loglevel' => 0,
  'logdateformat' => 'F d, Y H:i:s',
  'maintenance' => false,
  'mail_from_address' => '[redacted]',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'icloud.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.mail.me.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => '[redacted]@icloud.com',
  'mail_smtppassword' => '[redacted]',
  'default_phone_region' => 'US',
  'filelocking.enabled' => true,
);

The output of your Apache/nginx/system log in /var/log/____:

[redacted] - [redacted] [20/Jun/2022:05:16:32 +0000] "GET /status.php HTTP/1.1" 500 397 "-" "Mozilla/5.0 (Windows) mirall/3.5.1stable-Win64 (build 20220517) (Nextcloud, windows-10.0.22000 ClientArchitecture: x86_64 OsArchitecture: x86_64)"
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.4. Set the 'ServerName' directive globally to suppress this message
[Mon Jun 20 05:00:45.233151 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.53 (Debian) PHP/8.0.20 configured -- resuming normal operations
[Mon Jun 20 05:00:45.233237 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

None available. This is part of the problem!

Set loglevel to 3. you should start to get logs then.

Thanks for the suggestion. Tried it just now and still not getting anything in the log. Isn’t going to 3 the wrong direction though? 0 is Debug, should be the most verbose log level there is.

I dont know that rn, all i know is that i have set it to 3 and in case that i do get an error its always enough there…

Just to close the loop. I couldn’t figure this out. Moved all my files (not that many <1TB) rebuilt the whole container from scratch. Logs seem to work and server error went away. Annoying. Good thing I have good backups.