Internal Server Error after running out of space

Nextcloud version (eg, 12.0.2): 16.0.3.0 (as reported from next cloud pi web interface)
Operating system and version: Raspbian 9
Apache or nginx version: Apache/2.4.25 (Raspbian)
PHP version: 7.2

The issue you are facing: After starting NC following my sdcard running out of space and me freeing up plenty of space, getting error:
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/N): Yes

Steps to replicate it:

  1. Start NC

The output of your Nextcloud log in Admin > Logging:
Can’t get to NC console…

The output of your config.php file:
`<?php
$CONFIG = array (
‘passwordsalt’ => ‘xxx’,
‘secret’ => ‘xxx’,
‘trusted_domains’ =>
array (
0 => ‘localhost’,
5 => ‘nextcloudpi.local’,
7 => ‘nextcloudpi’,
8 => ‘nextcloudpi.lan’,
2 => ‘xxx.ngrok.io’,
1 => ‘192.168.0.62’,
11 => ‘xxx’,
),
‘datadirectory’ => ‘/var/www/nextcloud/data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘16.0.1.1’,
‘overwrite.cli.url’ => ‘http://localhost’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘mysql.utf8mb4’ => true,
‘dbuser’ => ‘ncadmin’,
‘dbpassword’ => ‘xxx’,
‘installed’ => true,
‘instanceid’ => ‘xxx’,
‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘/var/run/redis/redis.sock’,
‘port’ => 0,
‘timeout’ => 0.0,
‘password’ => ‘xxx’,
),
‘tempdirectory’ => ‘/var/www/nextcloud/data/tmp’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_from_address’ => ‘xxx’,
‘mail_domain’ => ‘gmail.com’,
‘overwriteprotocol’ => ‘https’,
‘jpeg_quality’ => ‘60’,
‘maintenance’ => false,
‘theme’ => ‘’,
‘loglevel’ => 2,
‘app_install_overwrite’ =>
array (
0 => ‘nextcloudpi’,
),
‘mail_sendmailmode’ => ‘smtp’,
‘mail_smtpauth’ => 1,
‘mail_smtphost’ => ‘smtp.gmail.com’,
‘mail_smtpport’ => ‘465’,
‘mail_smtpname’ => ‘xxx@gmail.com’,
‘mail_smtppassword’ => ‘xxx’,
‘mail_smtpsecure’ => ‘ssl’,
‘has_rebuilt_cache’ => true,
‘updater.secret’ => ‘xxx’,
);

The output of your Apache/nginx/system log in /var/log/____:
[Sat Aug 24 18:08:30.561606 2019] [authz_host:error] [pid 912:tid 1758225456] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to / failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:30.963215 2019] [authz_host:error] [pid 912:tid 1758225456] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to / failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:30.964018 2019] [authz_host:error] [pid 912:tid 1758225456] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /index.php failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:31.368385 2019] [authz_host:error] [pid 912:tid 1758225456] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /index.php failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:31.805979 2019] [proxy_fcgi:error] [pid 912:tid 1758225456] [client 192.168.0.25:49289] AH01071: Got error ‘PHP message: PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /var/www/ncp-web/elements.php on line 188\nPHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/ncp-web/elements.php on line 21\nPHP message: PHP Notice: Undefined index: app in /var/www/ncp-web/index.php on line 238\nPHP message: PHP Notice: Undefined index: app in /var/www/ncp-web/index.php on line 244\n’
[Sat Aug 24 18:08:34.490971 2019] [authz_host:error] [pid 912:tid 1741440048] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to / failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:34.894793 2019] [authz_host:error] [pid 912:tid 1741440048] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to / failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:34.895579 2019] [authz_host:error] [pid 912:tid 1741440048] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /index.php failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:35.194741 2019] [authz_host:error] [pid 912:tid 1741440048] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /index.php failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:35.624873 2019] [proxy_fcgi:error] [pid 912:tid 1741440048] [client 192.168.0.25:49289] AH01071: Got error ‘PHP message: PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /var/www/ncp-web/elements.php on line 188\nPHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/ncp-web/elements.php on line 21\nPHP message: PHP Notice: Undefined index: app in /var/www/ncp-web/index.php on line 238\nPHP message: PHP Notice: Undefined index: app in /var/www/ncp-web/index.php on line 244\n’
[Sat Aug 24 18:08:40.661499 2019] [authz_host:error] [pid 912:tid 1758225456] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /js/ncp.js failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:40.661532 2019] [authz_host:error] [pid 912:tid 1724646448] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /css/ncp.css failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:40.662738 2019] [authz_host:error] [pid 912:tid 1791796272] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/ncp-logo.svg failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:40.662789 2019] [authz_host:error] [pid 912:tid 1707844656] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/loading-small.gif failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:40.673743 2019] [authz_host:error] [pid 912:tid 1741440048] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /js/minified.js failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:40.730620 2019] [authz_host:error] [pid 912:tid 1699443760] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/toggle.svg failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:40.731473 2019] [authz_host:error] [pid 912:tid 1749832752] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/poweroff.svg failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:40.732595 2019] [authz_host:error] [pid 912:tid 1766618160] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/reboot.svg failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:40.733169 2019] [authz_host:error] [pid 912:tid 1733047344] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/defaults.svg failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:45.707959 2019] [authz_host:error] [pid 912:tid 1741440048] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/search.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.770700 2019] [authz_host:error] [pid 912:tid 1766618160] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/dashboard.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.775353 2019] [authz_host:error] [pid 912:tid 1791796272] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/menu.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.776071 2019] [authz_host:error] [pid 912:tid 1733047344] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/nc-button.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.776097 2019] [authz_host:error] [pid 912:tid 1699443760] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/settings-white.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.776314 2019] [authz_host:error] [pid 912:tid 1724646448] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/wizard.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.830700 2019] [authz_host:error] [pid 912:tid 1758225456] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/info-white.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.831128 2019] [authz_host:error] [pid 912:tid 1707844656] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/files.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.831504 2019] [authz_host:error] [pid 912:tid 1749832752] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /img/defaults-white.svg failed, reason: unable to get the remote host name, referer: https://192.168.0.62:4443/css/ncp.css
[Sat Aug 24 18:08:45.860934 2019] [authz_host:error] [pid 912:tid 1775010864] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /ncp-launcher.php failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:45.871902 2019] [authz_host:error] [pid 912:tid 1783403568] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /ncp-output.php failed, reason: unable to get the remote host name
[Sat Aug 24 18:08:58.105769 2019] [authz_host:error] [pid 912:tid 1775010864] [client 192.168.0.25:49289] AH01753: access check of ‘localhost’ to /ncp-launcher.php failed, reason: unable to get the remote host name

Well, I fixed my own issue…

I found that all the folders/files within /var/www/nextcloud/data
appdata_xxx, files_external, ncp, news, updater_xxx, etc…
were missing! I unpacked a backup copy, moved them over to /var/www/nextcloud/data and then updated the permissions on the folders and files. Opened a browser to NC server and it asked me to update to the latest version… Sure…
After I did that, all seems to be good.

BTW - Today, I receive a USB Drive in the mail to move my data folder off my SD card. :slight_smile: