"Internal Server Error" after rebooting for the first time

Hi,
I’ve recently installed Nextcloud + MariaDB using docker containers and everything worked perfect. I’ve been using Nextcloud for a couple of days but I needed to reboot my homeserver and after booting up, Nextcloud is not working anymore. I have no clue why this is happening and I have not changed anything previously to the reboot.

Whenever I try to enter Nextcloud I get the following message in a white screen:

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.

Nextcloud version (eg, 20.0.5): latest
Operating system and version (eg, Ubuntu 20.04): Ubuntu Server 20.04.2
Apache or nginx version (eg, Apache 2.4.25): apache
PHP version (eg, 7.4): PHP7.4

The issue you are facing:

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

Steps to replicate it:

  1. Create and run fresh mariadb and nextcloud docker containers.
  2. Reboot.
  3. Not accessible anymore.

The output of your Nextcloud log in Admin > Logging:

{"reqId":"0nhZ6kgmVwnojG4U2u6e","level":2,"time":"2021-02-26T12:07:23+00:00","remoteAddr":"192.168.1.48","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0","version":""}
{"reqId":"0nhZ6kgmVwnojG4U2u6e","level":2,"time":"2021-02-26T12:07:23+00:00","remoteAddr":"192.168.1.48","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0","version":""}
{"reqId":"wayXU4DhLJcHE44LuCK6","level":2,"time":"2021-02-26T12:09:10+00:00","remoteAddr":"184.105.247.254","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"--","version":""}
{"reqId":"wayXU4DhLJcHE44LuCK6","level":2,"time":"2021-02-26T12:09:10+00:00","remoteAddr":"184.105.247.254","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"--","version":""}
{"reqId":"caUFksF9bulGweM04ocR","level":2,"time":"2021-02-26T12:10:04+00:00","remoteAddr":"192.168.1.48","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0","version":""}
{"reqId":"caUFksF9bulGweM04ocR","level":2,"time":"2021-02-26T12:10:04+00:00","remoteAddr":"192.168.1.48","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0","version":""}
{"reqId":"caUFksF9bulGweM04ocR","level":3,"time":"2021-02-26T12:10:14+00:00","remoteAddr":"192.168.1.48","user":"admin","app":"no app in context","method":"POST","url":"/index.php","message":{"Exception":"OCP\\AppFramework\\QueryException","Message":"Could not resolve trashManager! Class trashManager does not exist","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["trashManager"]},{"file":"/var/www/html/lib/private/ServerContainer.php","line":162,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["trashManager",true]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":434,"function":"query","class":"OC\\ServerContainer","type":"->","args":["trashManager",true]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":56,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["trashManager"]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":58,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["trashManager"]},{"function":"OC\\AppFramework\\Bootstrap\\{closure}","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":68,"function":"array_map","args":[{"__class__":"Closure"},[{"name":"serverContainer","__class__":"ReflectionParameter"},{"name":"logger","__class__":"ReflectionParameter"},{"name":"appManager","__class__":"ReflectionParameter"},"*** sensitive parameter replaced ***"]]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/BootContext.php","line":52,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->","args":[[{"__class__":"OCA\\Files_Trashbin\\AppInfo\\Application"},"registerTrashBackends"]]},{"file":"/var/www/html/apps/files_trashbin/lib/AppInfo/Application.php","line":57,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->","args":[[{"__class__":"OCA\\Files_Trashbin\\AppInfo\\Application"},"registerTrashBackends"]]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":176,"function":"boot","class":"OCA\\Files_Trashbin\\AppInfo\\Application","type":"->","args":[{"__class__":"OC\\AppFramework\\Bootstrap\\BootContext"}]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":197,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["files_trashbin"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":137,"function":"loadApp","class":"OC_App","type":"::","args":["files_trashbin"]},{"file":"/var/www/html/apps/dav/lib/AppInfo/Application.php","line":124,"function":"loadApps","class":"OC_App","type":"::","args":[["dav"]]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":176,"function":"boot","class":"OCA\\DAV\\AppInfo\\Application","type":"->","args":[{"__class__":"OC\\AppFramework\\Bootstrap\\BootContext"}]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":197,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["dav"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":137,"function":"loadApp","class":"OC_App","type":"::","args":["dav"]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":203,"function":"loadApps","class":"OC_App","type":"::","args":[["filesystem"]]},{"file":"/var/www/html/lib/private/User/Session.php","line":554,"function":"setupFS","class":"OC_Util","type":"::","args":["*** sensitive parameter replaced ***"]},{"file":"/var/www/html/lib/private/User/Session.php","line":415,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->","args":[true,"*** sensitive parameter replaced ***"]},{"file":"/var/www/html/lib/private/User/Session.php","line":624,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/User/Session.php","line":367,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Setup.php","line":440,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":75,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":932,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","Line":115,"CustomMessage":"Could not boot files_trashbinCould not resolve trashManager! Class trashManager does not exist"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0","version":"21.0.0.18"}
{"reqId":"caUFksF9bulGweM04ocR","level":3,"time":"2021-02-26T12:10:14+00:00","remoteAddr":"192.168.1.48","user":"admin","app":"no app in context","method":"POST","url":"/index.php","message":{"Exception":"OCP\\AppFramework\\QueryException","Message":"Could not resolve OCA\\Files_Versions\\Versions\\IVersionManager! Class can not be instantiated","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Files_Versions\\Versions\\IVersionManager"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":459,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Files_Versions\\Versions\\IVersionManager"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":431,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Files_Versions\\Versions\\IVersionManager"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":56,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Files_Versions\\Versions\\IVersionManager"]},{"file":"/var/www/html/apps/files_versions/lib/AppInfo/Application.php","line":119,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Files_Versions\\Versions\\IVersionManager"]},{"file":"/var/www/html/apps/files_versions/lib/AppInfo/Application.php","line":106,"function":"loadBackend","class":"OCA\\Files_Versions\\AppInfo\\Application","type":"->","args":[{"@attributes":{"for":"OCP\\Files\\Storage\\IStorage"},"@value":"OCA\\Files_Versions\\Versions\\LegacyVersionsBackend"},{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"__class__":"OC\\AppFramework\\Logger"}]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":68,"function":"registerVersionBackends","class":"OCA\\Files_Versions\\AppInfo\\Application","type":"->","args":[{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"__class__":"OC\\App\\AppManager"},{"__class__":"OC\\AppFramework\\Logger"}]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/BootContext.php","line":52,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->","args":[{"__class__":"Closure"}]},{"file":"/var/www/html/apps/files_versions/lib/AppInfo/Application.php","line":91,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->","args":[{"__class__":"Closure"}]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":176,"function":"boot","class":"OCA\\Files_Versions\\AppInfo\\Application","type":"->","args":[{"__class__":"OC\\AppFramework\\Bootstrap\\BootContext"}]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":197,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["files_versions"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":137,"function":"loadApp","class":"OC_App","type":"::","args":["files_versions"]},{"file":"/var/www/html/apps/dav/lib/AppInfo/Application.php","line":124,"function":"loadApps","class":"OC_App","type":"::","args":[["dav"]]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":176,"function":"boot","class":"OCA\\DAV\\AppInfo\\Application","type":"->","args":[{"__class__":"OC\\AppFramework\\Bootstrap\\BootContext"}]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":197,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["dav"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":137,"function":"loadApp","class":"OC_App","type":"::","args":["dav"]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":203,"function":"loadApps","class":"OC_App","type":"::","args":[["filesystem"]]},{"file":"/var/www/html/lib/private/User/Session.php","line":554,"function":"setupFS","class":"OC_Util","type":"::","args":["*** sensitive parameter replaced ***"]},{"file":"/var/www/html/lib/private/User/Session.php","line":415,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->","args":[true,"*** sensitive parameter replaced ***"]},{"file":"/var/www/html/lib/private/User/Session.php","line":624,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/User/Session.php","line":367,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Setup.php","line":440,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":75,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":932,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","Line":111,"CustomMessage":"Could not boot files_versionsCould not resolve OCA\\Files_Versions\\Versions\\IVersionManager! Class can not be instantiated"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0","version":"21.0.0.18"}

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  '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,
    ),
  ),
  'instanceid' => 'ocd7hwb7n7k7',
  'passwordsalt' => 'snYrgWIfGEEA5RFmzRCUzO3Wsyxs+b',
  'secret' => '7vNgdKpUdzGoXo/Nldh7L65lST0RfQlgXIgl39+ma5JK4Y5H',
  'trusted_domains' => 
  array (
    0 => '192.168.1.11:8080',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'overwrite.cli.url' => 'http://192.168.1.11:8080',
  'dbname' => 'nextcloud',
  'dbhost' => '172.17.0.4:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => 'jba08IgVFYUuavR7CR8tlrxuAgSh7O',
  'installed' => true,
);

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

I cannot provide it since it seems to not be saving to the log file o.O

Hey,
Did you use docker-compose ?

Hi,

Nope. I used portainer for both containers. Does it matters?

It worked correctly for a couple of days…

Same issue here. My set up is working for years and suddenly overnight i got the internal error message. I did upgrade to the latest version last week.

Hello,
Sorry to answer so late. I wanted to know more about your configuration. I don’t use portainer and I didn’t know before you that portainer exists… So I don’t know if I can help you.
But with official docker compose file, there is no issue like that.
Internal server error often come from a misconfiguration of the database (Apache works because you have an error from your server and not from your navigator). The most plausible hypothesis is that mariadb is not running

Hi!

I finally managed to solved it using docker compose. It’s not what I wanted initially but finally the setup is working. And I can even manage it using portainer, so its perfect.

Now I’m facing another issue with large files upload, since I have no php.ini file loaded >.<

Thanks for your help!

1 Like

I have the same issue. I guess it’s because the data folder is not persistant in my setup.
I will update my post once it’s solved.