What the message looks like
Internal Server Error. The server encountered an internal error and was unable to complete your request. Request ID: aB3xYz9QkLmN0pRsCommon causes
- Database unreachable, password changed or tables locked.
- Data directory or config.php not writable for the web server user.
- Incomplete update: code and database schema do not match.
- Missing or incompatible PHP extension after a PHP update.
- A broken app after an app update.
Check
- Check basic Nextcloud status
sudo -u www-data php /var/www/nextcloud/occ status - Find the log entry for the request ID
grep 'aB3xYz9QkLmN0pRs' /var/www/nextcloud/data/nextcloud.log | jq -r '.message, .exception.Message? // empty' - Show the last entries of nextcloud.log in readable form
tail -n 20 /var/www/nextcloud/data/nextcloud.log | jq -r '[.time, .app, .message] | @tsv' - Check for errors at web server level
tail -n 20 /var/log/nginx/error.log
Fix
- Read the message for the request ID – it usually names the app, file or SQL error.
- For an incomplete update run
occ upgrade, thenocc maintenance:repair. - Disable a broken app:
occ app:disable appname. - Fix ownership:
chown -R www-data:www-data /var/www/nextcloud(check the data directory separately if it lives elsewhere). - Test the database connection directly with the values from config.php.
FAQ
Where is nextcloud.log if it is not in the data directory?
The path is in config.php under logfile. With log_type => syslog or systemd you find the entries with journalctl.
What if the log stays empty?
Then the request fails before Nextcloud, usually in PHP-FPM or nginx. Check their logs and set loglevel to 0 temporarily.