500 - Internal Server Error

Nextcloud version 24.0.3
Operating system and version Debian 10 ARM64
Apache or nginx version
Server version: Apache/2.4.38 (Debian)
Server built: 2021-12-21T16:50:43
PHP version 8.0
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

The issue you are facing:

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.

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

Steps to replicate it:

The system worked correctly. It offered to update one app. It showed an update, but then it went back to the same page and kept offering the update. After refreshing the page, it said that it is in Maintenec mode. I found on the Internet that it is enough to override False in config.php. The system started up again. After restarting the PC, it didn’t start anymore and only writes this error

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

<?php
$CONFIG = array (
  'instanceid' => 'removed by mod/JK',
  'passwordsalt' => 'removed by mod/JK',
  'secret' => 'removed by mod/JK',
  'trusted_domains' => 
  array (
    0 => '192.168.1.251',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '24.0.3.2',
  'overwrite.cli.url' => 'http://192.168.1.251/nextcloud',
  'dbname' => 'xxxxxxxxxx',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxxxxxxxx',
  'dbpassword' => 'xxxxxxxxxxxx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'xxxxxxxxxxx',
  'maintenance' => false,
  'updater.secret' => '$2y$10$YabVFjRaZbQzhant8CNsT.Gi3kfv5C5osHT9Wb9.5.OaCO5QpmkWC',
  'mail_domain' => 'gmail.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxxxxxxxxx@gmail.com',
  'mail_smtppassword' => 'removed by mod/JK',
  'theme' => '',
  'loglevel' => 0,
  'app_install_overwrite' => 
  array (
    0 => 'fulltextsearch_elasticsearch',
  ),
);

The output of your Apache access log in :

192.168.1.22 - - [22/Aug/2022:15:50:19 +0200] "GET /nextcloud/index.php HTTP/1.1" 500 477 "http://192.168.1.251/nextcloud/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 OPR/89.0.4447.83"
192.168.1.22 - - [22/Aug/2022:15:50:20 +0200] "GET /favicon.ico HTTP/1.1" 404 492 "http://192.168.1.251/nextcloud/index.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36 OPR/89.0.4447.83"
192.168.1.22 - karel [22/Aug/2022:15:52:42 +0200] "GET /nextcloud/status.php HTTP/1.1" 500 185 "-" "Mozilla/5.0 (Windows) mirall/3.5.4stable-Win64 (build 20220802) (Nextcloud, windows-10.0.22000 ClientArchitecture: x86_64 OsArchitecture: x86_64)"

The output of your Apache error log in :

[Mon Aug 22 15:50:05.492936 2022] [mpm_prefork:notice] [pid 4827] AH00163: Apache/2.4.38 (Debian) configured -- resuming normal operations
[Mon Aug 22 15:50:05.493287 2022] [core:notice] [pid 4827] AH00094: Command line: '/usr/sbin/apache2'

The output of your Apache error log when logleve is set to DEBUG in :

[Mon Aug 22 17:32:48.178899 2022] [watchdog:debug] [pid 3659] mod_watchdog.c(454): AH010033: Watchdog: Running with WatchdogInterval 1000ms
[Mon Aug 22 17:32:48.179197 2022] [watchdog:debug] [pid 3659] mod_watchdog.c(462): AH02974: Watchdog: found parent providers.
[Mon Aug 22 17:32:48.179233 2022] [watchdog:debug] [pid 3659] mod_watchdog.c(508): AH02977: Watchdog: found child providers.
[Mon Aug 22 17:32:48.179252 2022] [watchdog:debug] [pid 3659] mod_watchdog.c(516): AH02978: Watchdog: Looking for child (_singleton_).
[Mon Aug 22 17:32:48.179267 2022] [watchdog:debug] [pid 3659] mod_watchdog.c(516): AH02978: Watchdog: Looking for child (_default_).
[Mon Aug 22 17:32:48.190196 2022] [watchdog:debug] [pid 3660] mod_watchdog.c(567): AH02980: Watchdog: nothing configured?
[Mon Aug 22 17:32:48.192228 2022] [watchdog:debug] [pid 3661] mod_watchdog.c(567): AH02980: Watchdog: nothing configured?
[Mon Aug 22 17:32:48.194640 2022] [mpm_prefork:notice] [pid 3659] AH00163: Apache/2.4.38 (Debian) configured -- resuming normal operations
[Mon Aug 22 17:32:48.194760 2022] [mpm_prefork:info] [pid 3659] AH00164: Server built: 2021-12-21T16:50:43
[Mon Aug 22 17:32:48.194794 2022] [core:notice] [pid 3659] AH00094: Command line: '/usr/sbin/apache2'
[Mon Aug 22 17:32:48.194815 2022] [core:debug] [pid 3659] log.c(1571): AH02639: Using SO_REUSEPORT: yes (1)
[Mon Aug 22 17:32:48.194848 2022] [mpm_prefork:debug] [pid 3659] prefork.c(919): AH00165: Accept mutex: none (default: sysvsem)
[Mon Aug 22 17:32:48.195734 2022] [watchdog:debug] [pid 3662] mod_watchdog.c(567): AH02980: Watchdog: nothing configured?
[Mon Aug 22 17:32:48.198962 2022] [watchdog:debug] [pid 3663] mod_watchdog.c(567): AH02980: Watchdog: nothing configured?
[Mon Aug 22 17:32:48.200723 2022] [watchdog:debug] [pid 3664] mod_watchdog.c(567): AH02980: Watchdog: nothing configured?
[Mon Aug 22 17:32:54.209637 2022] [watchdog:debug] [pid 3665] mod_watchdog.c(567): AH02980: Watchdog: nothing configured?
[Mon Aug 22 17:32:54.270439 2022] [authz_core:debug] [pid 3661] mod_authz_core.c(820): [client 192.168.1.22:55700] AH01626: authorization result of Require all granted: granted, referer: http://192.168.1.251/nextcloud/index.php
[Mon Aug 22 17:32:54.270546 2022] [authz_core:debug] [pid 3661] mod_authz_core.c(820): [client 192.168.1.22:55700] AH01626: authorization result of <RequireAny>: granted, referer: http://192.168.1.251/nextcloud/index.php
[Mon Aug 22 17:32:54.270637 2022] [core:info] [pid 3661] [client 192.168.1.22:55700] AH00128: File does not exist: /var/www/html/favicon.ico, referer: http://192.168.1.251/nextcloud/index.php

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.

NO NEXTCLOU LOG

Thank you for all advice
Karel.

ahead of going into things: you seem to have access to commandline. so why not trying disabling and removing problematic app?

like sudo -u www-data php occ app:disable <app> and sudo -u www-data php occ app:remove <app>

Not sure which app it was. Is it possible that a failed upgrade of the application can kill the entire nextcloud like this?

The worst thing is that I can’t find any LOG and determine the reason why it doesn’t work

I backed up the entire nextcloud directory in www and using a script
https://download.nextcloud.com/server/installer/setup-nextcloud.php

i downloaded the clean version of nextcloud and it works.
i just copied the old config.php file so nextcloud stopped working. Something is wrong either in config.php or there is a problem in connecting to the database that is set in config.php.

For me your setup seems a bit too local. You avoid using proper SSL-certificates and want to run your instance locally only.

Apart from NC needing a proper certificate to run securely ( and flawlessly) i’m afraid it could cause strange problems as well. Plus you won’t be able to share things outside your homenetwork.

Though maybe you need to tell your DB at which port it has to look on localhost. Could be 3306 but I’m not sure

1 Like

I only use it on the local network. Our mobile phones sync photos to nextcloud and only on our local wifi, so I don’t need SSL. Nextcloud is not accessible from the Internet. MySQL runs on port 3306 - it is his default. I’ll check it today and get back to you

SOLVED :slight_smile:
The problem was in mysql database. It looks like it working, but database was corrupted.
After restore database from backup, nextcloud again works .

Thank you for your time spent on this request

Karel.

2 Likes