Internal server error after installation, anybody knows what's wrong with this?

I’m using Nginx 1.8 + php7.4 on my OpenWrt router. After finishing the web installer, I got this message shows “Internal Server Error”

I check the log file, which contains:

{"reqId":"QQpstPqCX9fNDPD5HjtR","level":2,"time":"2020-07-09T09:54:33+00:00","remoteAddr":"192.168.31.22","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":""}
{"reqId":"QQpstPqCX9fNDPD5HjtR","level":2,"time":"2020-07-09T09:54:33+00:00","remoteAddr":"192.168.31.22","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":""}
{"reqId":"QQpstPqCX9fNDPD5HjtR","level":3,"time":"2020-07-09T09:54:33+00:00","remoteAddr":"192.168.31.22","user":"--","app":"jsresourceloader","method":"GET","url":"/","message":"Could not find resource js/setup.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":""}
{"reqId":"QQpstPqCX9fNDPD5HjtR","level":3,"time":"2020-07-09T09:54:33+00:00","remoteAddr":"192.168.31.22","user":"--","app":"PHP","method":"GET","url":"/","message":"chmod(): No such file or directory at /opt/wwwroot/nextcloud/lib/private/Log/File.php#86","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":""}
{"reqId":"MCUFO51w8Rya2S0G0DBW","level":3,"time":"2020-07-09T09:55:01+00:00","remoteAddr":"192.168.31.22","user":"--","app":"PHP","method":"POST","url":"/index.php","message":"session_start(): A session had already been started - ignoring at /opt/wwwroot/nextcloud/lib/private/Session/Internal.php#209","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":""}
{"reqId":"MCUFO51w8Rya2S0G0DBW","level":2,"time":"2020-07-09T09:55:01+00:00","remoteAddr":"192.168.31.22","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 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":""}
{"reqId":"MCUFO51w8Rya2S0G0DBW","level":2,"time":"2020-07-09T09:55:01+00:00","remoteAddr":"192.168.31.22","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 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":""}
{"reqId":"MCUFO51w8Rya2S0G0DBW","level":3,"time":"2020-07-09T09:55:05+00:00","remoteAddr":"192.168.31.22","user":"--","app":"index","method":"POST","url":"/index.php","message":{"Exception":"Error","Message":"Call to undefined function OC\\Files\\Storage\\filter_var()","Code":0,"Trace":[{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Storage/Common.php","line":558,"function":"scanForInvalidCharacters","class":"OC\\Files\\Storage\\Common","type":"->","args":["*** sensitive parameter replaced ***","\\/"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Storage/Common.php","line":549,"function":"verifyPosixPath","class":"OC\\Files\\Storage\\Common","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Cache/Scanner.php","line":136,"function":"verifyPath","class":"OC\\Files\\Storage\\Common","type":"->","args":[".","*** sensitive parameter replaced ***"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Cache/Scanner.php","line":338,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["*** sensitive parameter replaced ***",3,-1,null,false]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Cache/Updater.php","line":125,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["*** sensitive parameter replaced ***",false,3,false]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/View.php","line":323,"function":"update","class":"OC\\Files\\Cache\\Updater","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/View.php","line":1176,"function":"writeUpdate","class":"OC\\Files\\View","type":"->","args":[{"__class__":"OC\\Files\\Storage\\Local"},"*** sensitive parameter replaced ***"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/View.php","line":271,"function":"basicOperation","class":"OC\\Files\\View","type":"->","args":["mkdir","/appdata_oczupo70rk8y",["create","write"]]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Node/Folder.php","line":164,"function":"mkdir","class":"OC\\Files\\View","type":"->","args":["/appdata_oczupo70rk8y"]},{"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Node/LazyRoot.php","line":66,"function":"call_user_func_array","args":[[{"__class__":"OC\\Files\\Node\\Root"},"newFolder"],["*** sensitive parameter replaced ***"]]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Node/LazyRoot.php","line":392,"function":"__call","class":"OC\\Files\\Node\\LazyRoot","type":"->","args":["newFolder",["*** sensitive parameter replaced ***"]]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/AppData/AppData.php","line":92,"function":"newFolder","class":"OC\\Files\\Node\\LazyRoot","type":"->","args":["*** sensitive parameter replaced ***"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/AppData/AppData.php","line":110,"function":"getAppDataRootFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/AppData/AppData.php","line":139,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/opt/wwwroot/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php","line":141,"function":"getFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["/"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Installer.php","line":221,"function":"get","class":"OC\\App\\AppStore\\Fetcher\\Fetcher","type":"->","args":[]},{"file":"/opt/wwwroot/nextcloud/lib/private/Installer.php","line":506,"function":"downloadApp","class":"OC\\Installer","type":"->","args":["bruteforcesettings"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Setup.php","line":411,"function":"installAppBundle","class":"OC\\Installer","type":"->","args":[{"__class__":"OC\\App\\AppStore\\Bundles\\CoreBundle"}]},{"file":"/opt/wwwroot/nextcloud/core/Controller/SetupController.php","line":75,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/opt/wwwroot/nextcloud/lib/base.php","line":945,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/opt/wwwroot/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/opt/wwwroot/nextcloud/lib/private/Files/Storage/Common.php","Line":577,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"Dy2OA3UwesJIt5B8WsYn","level":3,"time":"2020-07-09T09:59:26+00:00","remoteAddr":"192.168.31.22","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"session_start(): A session had already been started - ignoring at /opt/wwwroot/nextcloud/lib/private/Session/Internal.php#209","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"Dy2OA3UwesJIt5B8WsYn","level":3,"time":"2020-07-09T09:59:26+00:00","remoteAddr":"192.168.31.22","user":"--","app":"index","method":"GET","url":"/index.php","message":{"Exception":"Error","Message":"Call to undefined function OC\\Http\\Client\\filter_var()","Code":0,"Trace":[{"file":"/opt/wwwroot/nextcloud/lib/private/Http/Client/Client.php","line":227,"function":"preventLocalAddress","class":"OC\\Http\\Client\\Client","type":"->","args":["http://192.168.31.1:83/data/htaccesstest.txt",[]]},{"file":"/opt/wwwroot/nextcloud/lib/private/legacy/OC_Util.php","line":1240,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["http://192.168.31.1:83/data/htaccesstest.txt"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Setup.php","line":234,"function":"isHtaccessWorking","class":"OC_Util","type":"->","args":[{"__class__":"OC\\AllConfig"}]},{"file":"/opt/wwwroot/nextcloud/core/Controller/SetupController.php","line":58,"function":"getSystemInfo","class":"OC\\Setup","type":"->","args":[]},{"file":"/opt/wwwroot/nextcloud/lib/base.php","line":945,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/opt/wwwroot/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/opt/wwwroot/nextcloud/lib/private/Http/Client/Client.php","Line":180,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"lo0PXpBQ5C8jucWXVicm","level":3,"time":"2020-07-09T09:59:30+00:00","remoteAddr":"192.168.31.22","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"session_start(): A session had already been started - ignoring at /opt/wwwroot/nextcloud/lib/private/Session/Internal.php#209","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"lo0PXpBQ5C8jucWXVicm","level":3,"time":"2020-07-09T09:59:30+00:00","remoteAddr":"192.168.31.22","user":"--","app":"jsresourceloader","method":"GET","url":"/index.php","message":"Could not find resource js/setup.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"pNEVVVnUGva65HsgleN1","level":3,"time":"2020-07-09T10:00:01+00:00","remoteAddr":"192.168.31.22","user":"--","app":"PHP","method":"POST","url":"/index.php","message":"session_start(): A session had already been started - ignoring at /opt/wwwroot/nextcloud/lib/private/Session/Internal.php#209","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"pNEVVVnUGva65HsgleN1","level":3,"time":"2020-07-09T10:00:03+00:00","remoteAddr":"192.168.31.22","user":"--","app":"jsresourceloader","method":"POST","url":"/index.php","message":"Could not find resource js/setup.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"DqaiuVYeD20VyWlrRLC8","level":3,"time":"2020-07-09T10:05:23+00:00","remoteAddr":"192.168.31.22","user":"--","app":"PHP","method":"GET","url":"/index.php","message":"session_start(): A session had already been started - ignoring at /opt/wwwroot/nextcloud/lib/private/Session/Internal.php#209","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"DqaiuVYeD20VyWlrRLC8","level":3,"time":"2020-07-09T10:05:23+00:00","remoteAddr":"192.168.31.22","user":"--","app":"jsresourceloader","method":"GET","url":"/index.php","message":"Could not find resource js/setup.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"mCUru18AHpEFn1UkhFr4","level":3,"time":"2020-07-09T10:05:53+00:00","remoteAddr":"192.168.31.22","user":"--","app":"PHP","method":"POST","url":"/index.php","message":"session_start(): A session had already been started - ignoring at /opt/wwwroot/nextcloud/lib/private/Session/Internal.php#209","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
{"reqId":"mCUru18AHpEFn1UkhFr4","level":3,"time":"2020-07-09T10:10:12+00:00","remoteAddr":"192.168.31.22","user":"--","app":"index","method":"POST","url":"/index.php","message":{"Exception":"Error","Message":"Call to undefined function OC\\Files\\Storage\\filter_var()","Code":0,"Trace":[{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Storage/Common.php","line":558,"function":"scanForInvalidCharacters","class":"OC\\Files\\Storage\\Common","type":"->","args":["appdata_oczupo70rk8y","\\/"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Storage/Common.php","line":549,"function":"verifyPosixPath","class":"OC\\Files\\Storage\\Common","type":"->","args":["appdata_oczupo70rk8y"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Cache/Scanner.php","line":136,"function":"verifyPath","class":"OC\\Files\\Storage\\Common","type":"->","args":[".","appdata_oczupo70rk8y"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Cache/Scanner.php","line":338,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["appdata_oczupo70rk8y",3,-1,null,true]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/View.php","line":1339,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["appdata_oczupo70rk8y",false]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/View.php","line":1383,"function":"getCacheEntry","class":"OC\\Files\\View","type":"->","args":[{"__class__":"OC\\Files\\Storage\\Local"},"appdata_oczupo70rk8y","/appdata_oczupo70rk8y"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Node/Root.php","line":201,"function":"getFileInfo","class":"OC\\Files\\View","type":"->","args":["/appdata_oczupo70rk8y"]},{"function":"get","class":"OC\\Files\\Node\\Root","type":"->","args":["/appdata_oczupo70rk8y"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Node/LazyRoot.php","line":66,"function":"call_user_func_array","args":[[{"__class__":"OC\\Files\\Node\\Root"},"get"],["appdata_oczupo70rk8y"]]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/Node/LazyRoot.php","line":143,"function":"__call","class":"OC\\Files\\Node\\LazyRoot","type":"->","args":["get",["appdata_oczupo70rk8y"]]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/AppData/AppData.php","line":88,"function":"get","class":"OC\\Files\\Node\\LazyRoot","type":"->","args":["appdata_oczupo70rk8y"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/AppData/AppData.php","line":110,"function":"getAppDataRootFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/opt/wwwroot/nextcloud/lib/private/Files/AppData/AppData.php","line":139,"function":"getAppDataFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":[]},{"file":"/opt/wwwroot/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php","line":141,"function":"getFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["/"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Installer.php","line":221,"function":"get","class":"OC\\App\\AppStore\\Fetcher\\Fetcher","type":"->","args":[]},{"file":"/opt/wwwroot/nextcloud/lib/private/Installer.php","line":506,"function":"downloadApp","class":"OC\\Installer","type":"->","args":["bruteforcesettings"]},{"file":"/opt/wwwroot/nextcloud/lib/private/Setup.php","line":411,"function":"installAppBundle","class":"OC\\Installer","type":"->","args":[{"__class__":"OC\\App\\AppStore\\Bundles\\CoreBundle"}]},{"file":"/opt/wwwroot/nextcloud/core/Controller/SetupController.php","line":75,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/opt/wwwroot/nextcloud/lib/base.php","line":945,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/opt/wwwroot/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/opt/wwwroot/nextcloud/lib/private/Files/Storage/Common.php","Line":577,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0","version":"19.0.0.12"}
1 Like

Hey,

are your permissions correct? www-data-Owner for the html and php files and data?

Is your Database Running and connected to nextcloud?

whats in your config-file? (while posting pay attention on your credentials)

Error massage: Did you create a htaccess file?
I also think - maybe your nextcloud has no domain-entry? Is it a local installation or also connected to a domain?

could not detect any host in https:///data/htaccesstest.txt"

openwrt, thus only one root user, all of my apps were running with root, webroot files are owned by root either.

it’s a local installation, IP only.

the htaccesstest.txt file was generated by nextcloud itself.

I think this could be problematic. Do you have a user for the webserver? Because normally the file-owner is the webserver-user.

In debian for example www-data?

my webserver-user is root, both nginx and php-fpm are running on the basis of root. thus files created by php are also root-owned.

Please post config/config.php

<?php
$CONFIG = array (
  'instanceid' => 'oczupo70rk8y',
  'passwordsalt' => 'ZMN5Jtpf0Hxb3MkYyuvHOPKM9RCiCV',
  'secret' => 'SbmntcWRnZ6PTjKY7WjuR4ErlRP2PD4ab5hIoRinXs+IAcVB',
  'trusted_domains' => 
  array (
    0 => '192.168.31.1:83',
  ),
  'datadirectory' => '/opt/wwwroot/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '19.0.0.12',
  'overwrite.cli.url' => 'http://192.168.31.1:83',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_test3',
  'dbpassword' => 'Nz8Nmy19nM7q5aFcUrDRfjdxiw+lg1',
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\Redis',
'redis' => array(
    'host' => '/opt/var/run/redis.sock',
    'port' => 0,
    ),
);

I do not know if this is correct with ip and port. Sorry

  'overwrite.cli.url' => 'http://192.168.31.1:83',

Perhapsy ou must change it to a value without port.

thanks, i’ll have a try

nothing changed

Please check if there is a .htaccess:

ls -l /opt/webroot/nextcloud/.htaccess

And why is there an entry htaccesstest.txt? That makes no sense.
Please post the content of the htaccesstest.txt (the first lines).
Please also look in other directorys and search .htaccess and htaccesstest.txt

yes, there is a .htaccess file under /data

Also under / in the nextcloud folder?

yes, is’n it was included by nextcloud by default?

Please check your .htaccess / rewrite rules and configuration on nginx.

The .htaccess files are used from the webserver (nginx/apache2) for mod-rewrite. Perhaps it does not work. Check if ngix is correct configured for using nextcloud. Sorry i only use apache2 and not nginx.

these tables are strange, most of them are empty, does it mean the installation actually failed?