Symlinked nextcloud returns 500 error

Nextcloud version (eg, 18.0.2): 19.0.1-1
Operating system and version (eg, Ubuntu 20.04): Archarm
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.43 (Unix) OpenSSL/1.1.1g PHP/7.4.8
PHP version (eg, 7.1):7.4.8

The issue you are facing:

I’ve been usingnextcloud symlinked from /var/www/html/nextcloud → /usr/share/webapps/nextcloud (which is the location where pacman installs nextcloud to) this worked finbe until I realized that I’m running short on space on the partition that contains /var/www so I copied and symlinked it to /mnt/usb/some/path. I then realized that I’m nextcloud is giving me a 500 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.
After I cleaned up my partition, I copied /var/www/html back to it’s original location and removed that symlink, i.e. it’s all back in place of how it used to work but nextcloud is still giving me that same error :frowning:
in /usr/share/webapps/nextcloud/data/nextcloud.log I get:

{"reqId":"omP3LQpe2Vgmuwr7fAYu","level":3,"time":"2020-07-26T03:52:00+00:00","remoteAddr":"192.168.1.1","user":"--","app":"PHP","method":"PROPFIND","url":"/nextcloud/remote.php/dav/files/stdcerr/","message":"Error: Class 'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' not found at /usr/share/webapps/nextcloud/remote.php#61","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.5git (Nextcloud)","version":"19.0.1.1"}
{"reqId":"GzNVGwa2leXASoL5NTPi","level":3,"time":"2020-07-26T03:52:02+00:00","remoteAddr":"192.168.1.1","user":"--","app":"index","method":"GET","url":"/nextcloud/index.php","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":889,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/Connection.php","line":194,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":200,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":216,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":331,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":109,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":287,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_App.php","line":883,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":662,"function":"getAppVersions","class":"OC_App","type":"::"},{"file":"/usr/share/webapps/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/webapps/nextcloud/lib/private/ServerContainer.php","line":124,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":1699,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":853,"function":"getMemCacheFactory","class":"OC\\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/webapps/nextcloud/lib/private/ServerContainer.php","line":124,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":163,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/usr/share/webapps/nextcloud/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":"/usr/share/webapps/nextcloud/lib/private/ServerContainer.php","line":124,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":1889,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_App.php","line":347,"function":"getAppManager","class":"OC\\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_App.php","line":114,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":647,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":1090,"function":"init","class":"OC","type":"::"},{"file":"/usr/share/webapps/nextcloud/index.php","line":35,"args":["/usr/share/webapps/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/usr/share/webapps/nextcloud/lib/private/DB/Connection.php","Line":67,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.119 Safari/537.36","version":"19.0.1.1"}
{"reqId":"GzNVGwa2leXASoL5NTPi","level":3,"time":"2020-07-26T03:52:02+00:00","remoteAddr":"192.168.1.1","user":"--","app":"core","method":"GET","url":"/nextcloud/index.php","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":889,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/Connection.php","line":194,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":200,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":216,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":331,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":109,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":287,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_App.php","line":883,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":662,"function":"getAppVersions","class":"OC_App","type":"::"},{"file":"/usr/share/webapps/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/webapps/nextcloud/lib/private/ServerContainer.php","line":124,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":1699,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":853,"function":"getMemCacheFactory","class":"OC\\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/webapps/nextcloud/lib/private/ServerContainer.php","line":124,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":163,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/usr/share/webapps/nextcloud/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":"/usr/share/webapps/nextcloud/lib/private/ServerContainer.php","line":124,"function":"offsetGet","class":"Pimple\\Container","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Server.php","line":1889,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_App.php","line":347,"function":"getAppManager","class":"OC\\Server","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_App.php","line":114,"function":"getEnabledApps","class":"OC_App","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":647,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/base.php","line":1090,"function":"init","class":"OC","type":"::"},{"file":"/usr/share/webapps/nextcloud/index.php","line":35,"args":["/usr/share/webapps/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/usr/share/webapps/nextcloud/lib/private/DB/Connection.php","Line":67,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.119 Safari/537.36","version":"19.0.1.1"}
{"reqId":"GzNVGwa2leXASoL5NTPi","level":3,"time":"2020-07-26T03:52:02+00:00","remoteAddr":"192.168.1.1","user":"--","app":"core","method":"GET","url":"/nextcloud/index.php","message":{"Exception":"Doctrine\\DBAL\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory","Code":0,"Trace":[{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":889,"function":"connect","class":"OC\\DB\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/Connection.php","line":194,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":200,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":216,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":331,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":109,"function":"loadConfigValues","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/AppConfig.php","line":287,"function":"getApps","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_App.php","line":883,"function":"getValues","class":"OC\\AppConfig","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/TemplateLayout.php","line":164,"function":"getAppVersions","class":"OC_App","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":185,"function":"__construct","class":"OC\\TemplateLayout","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/usr/share/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":334,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/usr/share/webapps/nextcloud/index.php","line":63,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/usr/share/webapps/nextcloud/lib/private/DB/Connection.php","Line":67,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.119 Safari/537.36","version":"19.0.1.1"}

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

Steps to replicate it:

  1. go to https://myhost/nextcloud
  2. instead of displaying the nextcloud login, I get:
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.

The output of your Nextcloud log in Admin > Logging:

NA

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

<?php
$CONFIG = array (
  'instanceid' => 'ocy4w4gp6x34',
  'passwordsalt' => 'DoJ1ZFNR0uezFlkirehLSkazt1pZ1X',
  'secret' => 'YfRBvmPcOlnisWDCt63ffsLpFKbsMu4Qm9y6YtyV3Mz0DflA',
  'trusted_domains' => 
  array (
    0 => '*',
  ),
  'datadirectory' => '/usr/share/webapps/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '19.0.1.1',
  'overwrite.cli.url' => 'http://raspi/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'user',
  'dbpassword' => 'pwd',
  'installed' => true,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'mail_from_address' => 'stdcerr',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'maildomain.com',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.maildomain.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'user@ymaildomain.com',
  'mail_smtppassword' => 'pwd',
);

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

192.168.1.1 - - [25/Jul/2020:21:02:11 -0700] "GET /nextcloud/index.php HTTP/1.1" 500 289 "https://stdcerr.duckdns.org/nextcloud/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.119 Safari/537.36"
192.168.1.1 - - [25/Jul/2020:21:02:12 -0700] "GET /nextcloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 200 - "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.119 Safari/537.36"
192.168.1.1 - stdcerr [25/Jul/2020:21:02:21 -0700] "GET /nextcloud/ocs/v1.php/cloud/user?format=json HTTP/1.1" 200 - "-" "Mozilla/5.0 (Linux) mirall/2.6.5git (Nextcloud)"
192.168.1.1 - stdcerr [25/Jul/2020:21:02:21 -0700] "GET /nextcloud/remote.php/dav/avatars/stdcerr/128.png HTTP/1.1" 500 289 "-" "Mozilla/5.0 (Linux) mirall/2.6.5git (Nextcloud)"
192.168.1.1 - stdcerr [25/Jul/2020:21:02:24 -0700] "GET /nextcloud/status.php HTTP/1.1" 500 - "-" "Mozilla/5.0 (Linux) mirall/2.6.5git (Nextcloud)"
192.168.1.1 - stdcerr [25/Jul/2020:21:02:30 -0700] "PROPFIND /nextcloud/remote.php/dav/files/stdcerr/ HTTP/1.1" 200 - "-" "Mozilla/5.0 (Linux) mirall/2.6.5git (Nextcloud)"

You database is perhaps not running?

1 Like

Ouch
You’re exactly correct! I’ve been messing around wit the things and missed to enable mariadb afterwards… grrr! Easy fix,
Thank you!