Internal Server Error - Installing NextCloud on my asus router

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 22.0.0.11
Operating system and version (eg, Ubuntu 20.04): Asuswrt-Merlin 386.2_6
Apache or nginx version (eg, Apache 2.4.25): nginx/1.19.6 (x86_64-pc-linux-gnu)
PHP version (eg, 7.4): 7.4.20

The issue you are facing: It’s my first time setting up nextcloud, and I installed it on Asuswrt-Merlin firmware on my router. I get an internal server error when creating a new admin account. For your information, I followed this guide to install nginx web server and the NextCloud: NextCloud through Nginx Entware – HQT, except that I installed the newest version of NextCloud (22.0.0)

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

Steps to replicate it:

  1. After setting up the nextcloud for the first time
  2. Go to the nextcloud home page to create an admin account
  3. Internal Error appears and I cant continue to set up the Nextcloud

The output of your Nextcloud log in Admin > Logging:

{"reqId":"VCRBLn0Y3e3WWXFBBn8V","level":2,"time":"2021-07-18T10:14:22+00:00","remoteAddr":"192.168.1.152","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host 192.168.1.1 was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","version":"22.0.0.11"}
{"reqId":"VCRBLn0Y3e3WWXFBBn8V","level":2,"time":"2021-07-18T10:14:22+00:00","remoteAddr":"192.168.1.152","user":"--","app":"no app in context","method":"GET","url":"/nextcloud/index.php","message":"Host 192.168.1.1 was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","version":"22.0.0.11"}
{"reqId":"3zWViQ5EAKw0ssP2fXGA","level":2,"time":"2021-07-18T10:14:42+00:00","remoteAddr":"192.168.1.152","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Host 192.168.1.1 was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","version":"22.0.0.11"}
{"reqId":"3zWViQ5EAKw0ssP2fXGA","level":2,"time":"2021-07-18T10:14:42+00:00","remoteAddr":"192.168.1.152","user":"--","app":"no app in context","method":"POST","url":"/nextcloud/index.php","message":"Host 192.168.1.1 was not connected to because it violates local access rules","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","version":"22.0.0.11"}
{"reqId":"3zWViQ5EAKw0ssP2fXGA","level":3,"time":"2021-07-18T10:15:03+00:00","remoteAddr":"192.168.1.152","user":"--","app":"index","method":"POST","url":"/nextcloud/index.php","message":"Call to undefined function OC\\Http\\Client\\dns_get_record()","userAgent":"Mozilla/5.0 (Windows NT 10.0;
 Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","version":"22.0.0.11","exception":{"Exception":"Error","Message":"Call to undefined function OC\\Http\\Client\\dns_get_record()","Code":0,"Trace":[{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":113,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["apps.nextcloud.com",0]},{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":
["*** sensitive parameters replaced ***"]},{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["get",{"__class__":"GuzzleHttp\\Psr7\\Uri"},{"verify":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/resources/config/ca-bundle.crt","timeout":60,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"nextcloud":
{"allow_local_address":false},"synchronous":true,"0":"And 6 more entries, set log level to debug to see all entries"}]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://apps.nextcloud.com/api/v1/apps.json",
{"verify":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/resources/config/ca-bundle.crt","timeout":60,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"nextcloud":{"allow_local_address":false},"headers":{"User-Agent":"Nextcloud Server Crawler","Accept-Encoding":"gzip"},"0":"And 1 more entries, set log level to debug to see all entries"}]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php","line":108,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://apps.nextcloud.com/api/v1/apps.json",{"timeout":60}]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php","line":79,"function":"fetch","class":"OC\\App\\AppStore\\Fetcher\\Fetcher","type":"->","args":["",""]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php","line":180,"function":"fetch","class":"OC\\App\\AppStore\\Fetcher\\AppFetcher","type":"->","args":["","",false]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/Installer.php","line":231,"function":"get","class":"OC\\App\\AppStore\\Fetcher\\Fetcher","type":"->","args":[false]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/Installer.php","line":532,"function":"downloadApp","class":"OC\\Installer","type":"->","args":["bruteforcesettings"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/Setup.php","line":407,"function":"installAppBundle","class":"OC\\Installer","type":"->","args":[{"__class__":"OC\\App\\AppStore\\Bundles\\CoreBundle"}]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/Controller/SetupController.php","line":74,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/base.php","line":939,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},
{"file":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","Line":52,"CustomMessage":"--"}}

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

<?php
$CONFIG = array (
  'instanceid' => '[redacted]',
  'passwordsalt' => '[redacted]',
  'secret' => 'deCLTC8C9S7H18bcmjg+Ay5/Oh0VTiHwaCiY7ON2IBjy0b7D',
  'trusted_domains' => 
  array (
    0 => '192.168.1.1:82',
  ),
  'datadirectory' => '/tmp/mnt/sda2/entware/share/nginx/html/nextcloud/data',
  'dbtype' => 'sqlite3',
  'version' => '22.0.0.11',
  'overwrite.cli.url' => 'http://192.168.1.1:82/nextcloud',
);

The output of nginx error log in /tmp/mnt/sda2/entware/var/log/nginx:

2021/07/18 16:19:07 [notice] 18860#0: signal process started
2021/07/18 16:22:26 [error] 1499#0: *1 open() "/opt/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 192.168.1.152, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.1:82", referrer: "http://192.168.1.1:82/"
2021/07/18 16:29:28 [error] 1499#0: *27 open() "/opt/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 192.168.1.152, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "[IP redacted]", referrer: "http://[IP redacted]/"
2021/07/18 08:39:05 [notice] 22263#0: signal process started
2021/07/18 09:30:37 [notice] 29159#0: signal process started

The output of nextcloud error log in /tmp/mnt/sda2/entware/var/log/nginx

2021/07/18 08:39:36 [error] 22267#0: *9 open() "/opt/share/nginx/html/nextcloud" failed (2: No such file or directory), client: 192.168.1.152, server: localhost, request: "GET /nextcloud HTTP/1.1", host: "192.168.1.1:82"
2021/07/18 09:31:03 [error] 29163#0: *9 FastCGI sent in stderr: "PHP Fatal error:  Cannot redeclare print_exception() (previously declared in /tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/templates/exception.php:7) in /tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/templates/exception.php on line 7" while reading response header from upstream, client: 192.168.1.152, server: localhost, request: "GET /nextcloud/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.1:82"
2021/07/18 09:31:03 [error] 29163#0: *9 FastCGI sent in stderr: "PHP Fatal error:  Cannot redeclare print_exception() (previously declared in /tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/templates/exception.php:7) in /tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/templates/exception.php on line 7" while reading response header from upstream, client: 192.168.1.152, server: localhost, request: "GET /nextcloud/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.1:82"
2021/07/18 09:31:13 [error] 29163#0: *9 FastCGI sent in stderr: "PHP Fatal error:  Cannot redeclare print_exception() (previously declared in /tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/templates/exception.php:7) in /tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/templates/exception.php on line 7" while reading response header from upstream, client: 192.168.1.152, server: localhost, request: "GET /nextcloud/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.1:82"
2021/07/18 09:31:13 [error] 29163#0: *9 FastCGI sent in stderr: "PHP Fatal error:  Cannot redeclare print_exception() (previously declared in /tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/templates/exception.php:7) in /tmp/mnt/sda2/entware/share/nginx/html/nextcloud/core/templates/exception.php on line 7" while reading response header from upstream, client: 192.168.1.152, server: localhost, request: "GET /nextcloud/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.1:82"
2021/07/18 11:36:02 [error] 29163#0: *97 "/opt/share/nginx/html/HNAP1/index.php" is not found (2: No such file or directory), client: 110.18.47.97, server: localhost, request: "GET /HNAP1/ HTTP/1.1", host: "[IP REDACTED]", referrer: "http://[IP REDACTED]/"
2021/07/18 11:36:02 [error] 29163#0: *97 "/opt/share/nginx/html/HNAP1/index.php" is not found (2: No such file or directory), client: [IP REDACTED], server: localhost, request: "GET /HNAP1/ HTTP/1.1", host: "[IP REDACTED]", referrer: "http://[IP REDACTED]/"
2021/07/18 13:25:30 [error] 29163#0: *119 open() "/opt/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 192.168.1.152, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.1:82", referrer: "http://192.168.1.1:82/"
2021/07/18 13:25:30 [error] 29163#0: *119 open() "/opt/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 192.168.1.152, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.1:82", referrer: "http://192.168.1.1:82/"

Interestingly, if I use nextcloud-19.0.3, there’s no such error. The error only occurs if I use the latest version.

Can someone please help? Any insight would be grateful.