Internal Server Error when trying different things in NextCloud

Nextcloud version (eg, 20.0.5): 23.0.0
Operating system and version (eg, Ubuntu 20.04): Linux 4.4.180+ x86_64 (Synology)
Apache or nginx version (eg, Apache 2.4.25): 2.4.51
PHP version (eg, 7.4): 8.0.14

The issue you are facing:

Many operations illicit an Internal Server Error such as clicking on:

  • Mail
  • Contacts
  • Calendar
  • Settings > Notification
  • Settings > External Storage

The error is:

Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.
Technical details

    Remote Address: 70.181.192.116
    Request ID: BOSq9rqRZj8M1tcH2Xqv

Other operations work fine like:

  • Files
  • Settings > Personal Info
  • Settings > Security
  • Settings > Audio Player

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

Steps to replicate it:

  1. Log into NextCloud
  2. Execute operations listed above

The output of your Nextcloud log in Admin > Logging:

Logging in via Firefox, I see nothing when clicking in Settings > Administration > Logging. I have, however, captured a nextcloud.log exhibiting the problem and pasted its ugliness below

{"reqId":"9hpRPrUz0aCwlRbhzE5p","level":3,"time":"2021-12-27T00:35:20+00:00","remoteAddr":"70.181.192.116","user":"root","app":"index","method":"GET","url":"/settings/user","message":"Could not create folder","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0","version":"23.0.0.10","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create folder","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Node/Root.php","line":386,"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->","args":["/root/files"]},{"function":"getUserFolder","class":"OC\\Files\\Node\\Root","type":"->","args":["root"]},{"file":"/var/www/html/lib/private/Files/Node/LazyFolder.php","line":65,"function":"call_user_func_array","args":[[{"__class__":"OC\\Files\\Node\\Root"},"getUserFolder"],["root"]]},{"file":"/var/www/html/lib/private/Files/Node/LazyRoot.php","line":40,"function":"__call","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["getUserFolder",["root"]]},{"file":"/var/www/html/lib/private/Server.php","line":1606,"function":"getUserFolder","class":"OC\\Files\\Node\\LazyRoot","type":"->","args":["root"]},{"file":"/var/www/html/custom_apps/mail/lib/AppInfo/Application.php","line":92,"function":"getUserFolder","class":"OC\\Server","type":"->","args":["root"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":160,"function":"OCA\\Mail\\AppInfo\\{closure}","class":"OCA\\Mail\\AppInfo\\Application","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":127,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["userFolder"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":457,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["userFolder"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["userFolder"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["userFolder",true]},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map","args":[{"__class__":"Closure"},["*** sensitive parameter replaced ***",{"__class__":"ReflectionParameter","name":"accountService"},{"__class__":"ReflectionParameter","name":"attachmentService"},{"__class__":"ReflectionParameter","name":"mailManager"},{"__class__":"ReflectionParameter","name":"imapClientFactory"},"And 6 more entries, set log level to debug to see all entries"]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[{"__class__":"ReflectionClass","name":"OCA\\Mail\\Service\\MailTransmission"}]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Service\\MailTransmission"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Service\\MailTransmission"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Mail\\Service\\MailTransmission"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":56,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Mail\\Service\\MailTransmission"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":182,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Service\\MailTransmission"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":160,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php","line":114,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":127,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OCA\\Mail\\Contracts\\IMailTransmission"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":457,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Contracts\\IMailTransmission"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Mail\\Contracts\\IMailTransmission"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Mail\\Contracts\\IMailTransmission",true]},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map","args":[{"__class__":"Closure"},[{"__class__":"ReflectionParameter","name":"config"},{"__class__":"ReflectionParameter","name":"messageMapper"},"*** sensitive parameter replaced ***"]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[{"__class__":"ReflectionClass","name":"OCA\\Mail\\Service\\AntiSpamService"}]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Service\\AntiSpamService"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Service\\AntiSpamService"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":435,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Mail\\Service\\AntiSpamService"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":87,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Mail\\Service\\AntiSpamService",true]},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":106,"function":"array_map","args":[{"__class__":"Closure"},[{"__class__":"ReflectionParameter","name":"initialStateService"},{"__class__":"ReflectionParameter","name":"provisioningManager"},"*** sensitive parameter replaced ***"]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":114,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[{"__class__":"ReflectionClass","name":"OCA\\Mail\\Settings\\AdminSettings"}]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":131,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Settings\\AdminSettings"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":463,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Settings\\AdminSettings"]},{"file":"/var/www/html/lib/private/ServerContainer.php","line":145,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Mail\\Settings\\AdminSettings"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":56,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OCA\\Mail\\Settings\\AdminSettings"]},{"file":"/var/www/html/lib/private/Settings/Manager.php","line":194,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Mail\\Settings\\AdminSettings"]},{"file":"/var/www/html/lib/private/Settings/Manager.php","line":349,"function":"getSettings","class":"OC\\Settings\\Manager","type":"->","args":["admin","overview"]},{"file":"/var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php","line":82,"function":"getAllowedAdminSettings","class":"OC\\Settings\\Manager","type":"->","args":["overview",{"__class__":"OC\\User\\User"}]},{"file":"/var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php","line":115,"function":"formatSections","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":[[[{"__class__":"OCA\\Settings\\Sections\\Admin\\Overview"}],[{"__class__":"OCA\\Support\\Settings\\Section"},{"__class__":"OCA\\Settings\\Sections\\Admin\\Server"}],[{"__class__":"OCA\\Settings\\Sections\\Admin\\Sharing"}],[{"__class__":"OCA\\Settings\\Sections\\Admin\\Security"},{"__class__":"OCA\\audioplayer\\Settings\\AdminSection"},{"__class__":"OCA\\Files_External\\Settings\\Section"}],[{"__class__":"OCA\\Theming\\Settings\\Section"}],"And 6 more entries, set log level to debug to see all entries"],"personal-info","admin","personal"]},{"file":"/var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php","line":67,"function":"formatAdminSections","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal","personal-info"]},{"file":"/var/www/html/apps/settings/lib/Controller/CommonSettingsTrait.php","line":139,"function":"getNavigationParameters","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal","personal-info"]},{"file":"/var/www/html/apps/settings/lib/Controller/PersonalSettingsController.php","line":64,"function":"getIndexResponse","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal","personal-info"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"index","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal-info"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\PersonalSettingsController"},"index"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\PersonalSettingsController"},"index"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\PersonalSettingsController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"section":"personal-info","_route":"settings.PersonalSettings.index"}]},{"file":"/var/www/html/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/user"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/Node/Folder.php","Line":173,"CustomMessage":"--"}}
{"reqId":"ocMJLEowgYGJxlF2RXaV","level":2,"time":"2021-12-27T00:37:55+00:00","remoteAddr":"2600:8801:d802:ff00:c4c6:81b2:7347:151f","user":"--","app":"core","method":"PROPFIND","url":"/remote.php/dav/files/andrew//","message":"Login failed: 'andrew' (Remote IP: '2600:8801:d802:ff00:c4c6:81b2:7347:151f')","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.18.1","version":"23.0.0.10"}

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' => 'oc0attz22a89',
  'passwordsalt' => 'salt',
  'secret' => 'secret',
  'trusted_domains' => 
  array (
    0 => 'cloud.defariahome.com',
    1 => 'defaria.synology.me',
    2 => 'jupiter',
    3 => '192.168.0.251',
  ),
  'default_phone_region' => 'US',
  'datadirectory' => '/data',
  'dbtype' => 'mysql',
  'version' => '23.0.0.10',
  'overwrite.cli.url' => 'http://cloud.defariahome.com',
  'dbname' => 'nextcloud',
  'dbhost' => '192.168.0.251:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'nextcloud',
  'installed' => true,
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'Andrew',
  'mail_domain' => 'DeFaria.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'gmail address',
  'mail_smtppassword' => 'smtppassword',
  'app_install_overwrite' => 
  array (
    0 => 'files_external_dropbox',
  ),
);

Note: I’m running Nextcloud in a container. The output from docker logs nextcloud is huge and I see no way to attach it but it can be obtained via this link - https://earth.defariahome.com/tmp/docker.log.

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

Available upon request