Sudden Internal Server Error after App Install

Nextcloud version: 22.0.0
OS: Uubntu 18.04
Server_: Apache 2.4
PHP version_: 7.4

Long time Nextcloud user. Just added 2 new apps and then a sudden Internal Server Error. New apps are: Circles and Collectives.

The login page still works fine, and even rejects the wrong user/pass. But once logged in, it goes to this error message:

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: [my.ip.address]
  • Request ID: YaeQgWScPGNoLgpMt0B2hAAAAAY

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

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

{"reqId":"YOn5A44mWMai9LHRiS@HNAAAAAU","level":2,"time":"2021-07-10T19:46:11+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5A44mWMai9LHRiS@HNAAAAAU","level":2,"time":"2021-07-10T19:46:11+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5CvUtUGCUFfsGnR5SgwAAAAA","level":2,"time":"2021-07-10T19:46:18+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PUT","url":"/drive/index.php/apps/user_status/heartbeat","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5CvUtUGCUFfsGnR5SgwAAAAA","level":2,"time":"2021-07-10T19:46:18+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PUT","url":"/drive/index.php/apps/user_status/heartbeat","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5Cgl4nQOgTy4bbDyXnAAAAAI","level":2,"time":"2021-07-10T19:46:18+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PUT","url":"/drive/index.php/apps/user_status/heartbeat","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5Cgl4nQOgTy4bbDyXnAAAAAI","level":2,"time":"2021-07-10T19:46:18+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PUT","url":"/drive/index.php/apps/user_status/heartbeat","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5CvV8c-H1BFvPlkCAgwAAAAQ","level":2,"time":"2021-07-10T19:46:18+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5CvV8c-H1BFvPlkCAgwAAAAQ","level":2,"time":"2021-07-10T19:46:18+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5Cwl4nQOgTy4bbDyXngAAAAI","level":2,"time":"2021-07-10T19:46:19+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5Cwl4nQOgTy4bbDyXngAAAAI","level":2,"time":"2021-07-10T19:46:19+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5C-UtUGCUFfsGnR5ShQAAAAA","level":2,"time":"2021-07-10T19:46:19+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5C-UtUGCUFfsGnR5ShQAAAAA","level":2,"time":"2021-07-10T19:46:19+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5DF6E1l3u1lbOoGjZQAAAAA0","level":2,"time":"2021-07-10T19:46:20+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PROPFIND","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5DF6E1l3u1lbOoGjZQAAAAA0","level":2,"time":"2021-07-10T19:46:20+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PROPFIND","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5EmzqxukAi@-Hml4azAAAAAc","level":2,"time":"2021-07-10T19:46:26+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5EmzqxukAi@-Hml4azAAAAAc","level":2,"time":"2021-07-10T19:46:26+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5IQX7A4MUJ1-T@6Rt4QAAAAY","level":2,"time":"2021-07-10T19:46:41+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5IQX7A4MUJ1-T@6Rt4QAAAAY","level":2,"time":"2021-07-10T19:46:41+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5KnIMxELuKjQtrb@wJAAAAAM","level":2,"time":"2021-07-10T19:46:50+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PROPFIND","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5KnIMxELuKjQtrb@wJAAAAAM","level":2,"time":"2021-07-10T19:46:50+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PROPFIND","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5PxxZwrzN8SPKevLDRQAAAAw","level":2,"time":"2021-07-10T19:47:11+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5PxxZwrzN8SPKevLDRQAAAAw","level":2,"time":"2021-07-10T19:47:11+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5RpmWWpXoVeGi@f@4fwAAAAg","level":2,"time":"2021-07-10T19:47:18+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5RpmWWpXoVeGi@f@4fwAAAAg","level":2,"time":"2021-07-10T19:47:18+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5SI4mWMai9LHRiS@HNgAAAAU","level":2,"time":"2021-07-10T19:47:20+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PROPFIND","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5SI4mWMai9LHRiS@HNgAAAAU","level":2,"time":"2021-07-10T19:47:20+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PROPFIND","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5XQl4nQOgTy4bbDyXoAAAAAI","level":2,"time":"2021-07-10T19:47:41+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5XQl4nQOgTy4bbDyXoAAAAAI","level":2,"time":"2021-07-10T19:47:41+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"GET","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36","version":""}
{"reqId":"YOn5Zl6E1l3u1lbOoGjZQgAAAA0","level":2,"time":"2021-07-10T19:47:50+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PROPFIND","url":"/drive/index.php","message":"Could not detect any host in https:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}
{"reqId":"YOn5Zl6E1l3u1lbOoGjZQgAAAA0","level":2,"time":"2021-07-10T19:47:50+00:00","remoteAddr":"207.172.132.16","user":"--","app":"no app in context","method":"PROPFIND","url":"/drive/index.php","message":"Could not detect any host in http:///drive/data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Linux) mirall/2.6.2-1build1 (Nextcloud)","version":""}

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

<?php
$CONFIG = array (
  'instanceid' => 'ocqs39dq8ik0',
  'passwordsalt' => '???',
  'secret' => '???',
  'trusted_domains' => 
  array (
    0 => 'niadrive.cloud',
  ),
  'datadirectory' => '/home/.../nextdata',
  'dbtype' => 'mysql',
  'version' => '22.0.0.11',
  'overwrite.cli.url' => 'https://niadrive.cloud/drive',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '???',
  'dbpassword' => '???',
  'installed' => true,
  'maintenance' => false,
  'mail_from_address' => 'support',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'niadrive.cloud',
  'mail_smtphost' => 'mail.niadrive.cloud',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '587',
  'mail_smtpname' => '???',
  'mail_smtppassword' => '???',
  'theme' => '',
  'loglevel' => 0,
  'default_phone_region' => 'US',
  'app_install_overwrite' => 
  array (
    0 => 'tasks',
  ),
);

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

PASTE HERE

Apparently, Circles caused the problem with some sort of faulty database entry.

I did not fix this myself, but a tech person deleted a bunch of database data related to the Circles App and the problem was resolved.