Error occurred while checking server setup after having upgraded nextcloud

Hello,

I’ve been having trouble going further upgrading my nextcloud server and I’m not sure what is going on exactly. Any help is appreciated.

Nextcloud version (eg, 12.0.2): 16.05
Operating system and version (eg, Ubuntu 17.04): Centos 7.7
Apache or nginx version (eg, Apache 2.4.25): 1.12.2-3.el7.x86_64
PHP version (eg, 7.1): 7.3.10

The issue you are facing:
I cannot upgrade my nextcloud instance further to version 17.

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

Steps to replicate it:

  1. I’ve updated from version 15 to version 16.05 using the GUI.
  2. Went to Settings - Overview
  3. I get Error occurred while checking server setup when checking the system

The output of your Nextcloud log in Admin > Logging:

{“reqId”:“pgy5QU15koJLKOETlh88”,“level”:3,“time”:“2019-10-11T18:24:16+00:00”,“remoteAddr”:“91.65.192.204”,“user”:“root”,“app”:“index”,“method”:“GET”,“url”:“/nextcloud/settings/ajax/checksetup”,“message”:{“Exception”:“GuzzleHttp\Exception\RequestException”,“Message”:“cURL error 60: Peer’s certificate issuer has been marked as not trusted by the user. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)”,“Code”:0,“Trace”:[{“file”:“/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php”,“line”:149,“function”:“createRejection”,“class”:“GuzzleHttp\Handler\CurlFactory”,“type”:“::”,“args”:[{“sink”:{“class”:“GuzzleHttp\Psr7\Stream”},“headers”:,“response”:null,“request”:{“class”:“GuzzleHttp\Psr7\Request”},“options”:{“verify”:“/var/www/html/nextcloud/data/files_external/rootcerts.crt”,“synchronous”:true,“handler”:{“class”:“GuzzleHttp\HandlerStack”},“allow_redirects”:{“max”:5,“protocols”:[“http”,“https”],“strict”:false,“referer”:false,“track_redirects”:false},“http_errors”:true,“decode_content”:true,“cookies”:false},“errno”:60,“onHeadersException”:null,“class”:“GuzzleHttp\Handler\EasyHandle”},{“errno”:60,“error”:“Peer’s certificate issuer has been marked as not trusted by the user.”,“url”:“https://nextcloud.com/“,“content_type”:null,“http_code”:0,“header_size”:0,“request_size”:0,“filetime”:-1,“ssl_verify_result”:-8172,“redirect_count”:0,“total_time”:0.17208800000000002,“namelookup_time”:0.004151,“connect_time”:0.063272,“pretransfer_time”:0,“size_upload”:0,“size_download”:0,“speed_download”:0,“speed_upload”:0,“download_content_length”:-1,“upload_content_length”:-1,“starttransfer_time”:0,“redirect_time”:0,“redirect_url”:”“,“primary_ip”:“95.217.53.153”,“certinfo”:[],“primary_port”:443,“local_ip”:“91.206.161.137”,“local_port”:56298}]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php",“line”:102,“function”:“finishError”,“class”:“GuzzleHttp\\Handler\\CurlFactory”,“type”:“::”,“args”:[{“__class__”:“GuzzleHttp\\Handler\\CurlHandler”},{“sink”:{“__class__”:“GuzzleHttp\\Psr7\\Stream”},“headers”:[],“response”:null,“request”:{“__class__”:“GuzzleHttp\\Psr7\\Request”},“options”:{“verify”:“/var/www/html/nextcloud/data/files_external/rootcerts.crt”,“synchronous”:true,“handler”:{“__class__”:“GuzzleHttp\\HandlerStack”},“allow_redirects”:{“max”:5,“protocols”:[“http”,“https”],“strict”:false,“referer”:false,“track_redirects”:false},“http_errors”:true,“decode_content”:true,“cookies”:false},“errno”:60,“onHeadersException”:null,“__class__”:“GuzzleHttp\\Handler\\EasyHandle”},{“__class__”:“GuzzleHttp\\Handler\\CurlFactory”}]},{“file”:“/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php”,“line”:43,“function”:“finish”,“class”:“GuzzleHttp\\Handler\\CurlFactory”,“type”:“::”,“args”:[{“__class__”:“GuzzleHttp\\Handler\\CurlHandler”},{“sink”:{“__class__”:“GuzzleHttp\\Psr7\\Stream”},“headers”:[],“response”:null,“request”:{“__class__”:“GuzzleHttp\\Psr7\\Request”},“options”:{“verify”:“/var/www/html/nextcloud/data/files_external/rootcerts.crt”,“synchronous”:true,“handler”:{“__class__”:“GuzzleHttp\\HandlerStack”},“allow_redirects”:{“max”:5,“protocols”:[“http”,“https”],“strict”:false,“referer”:false,“track_redirects”:false},“http_errors”:true,“decode_content”:true,“cookies”:false},“errno”:60,“onHeadersException”:null,“__class__”:“GuzzleHttp\\Handler\\EasyHandle”},{“__class__”:“GuzzleHttp\\Handler\\CurlFactory”}]},{“file”:“/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php”,“line”:28,“function”:“__invoke”,“class”:“GuzzleHttp\\Handler\\CurlHandler”,“type”:"->”,“args”:[“*** sensitive parameter replaced “,” sensitive parameter replaced “]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php",“line”:51,“function”:“GuzzleHttp\Handler\{closure}”,“class”:“GuzzleHttp\Handler\Proxy”,“type”:“::”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php",“line”:37,“function”:“GuzzleHttp\Handler\{closure}”,“class”:“GuzzleHttp\Handler\Proxy”,“type”:“::”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",“line”:30,“function”:“__invoke”,“class”:“GuzzleHttp\PrepareBodyMiddleware”,“type”:“->”,“args”:[" sensitive parameter replaced “,” sensitive parameter replaced “]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php",“line”:70,“function”:“GuzzleHttp\{closure}”,“class”:“GuzzleHttp\Middleware”,“type”:“::”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",“line”:60,“function”:“__invoke”,“class”:“GuzzleHttp\RedirectMiddleware”,“type”:“->”,“args”:[" sensitive parameter replaced “,” sensitive parameter replaced “]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php",“line”:67,“function”:“GuzzleHttp\{closure}”,“class”:“GuzzleHttp\Middleware”,“type”:“::”,“args”:[" sensitive parameters replaced “]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",“line”:277,“function”:“__invoke”,“class”:“GuzzleHttp\HandlerStack”,“type”:“->”,“args”:[" sensitive parameter replaced “,” sensitive parameter replaced “]},{“file”:”/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",“line”:125,“function”:“transfer”,“class”:“GuzzleHttp\Client”,“type”:“->”,“args”:[" sensitive parameter replaced “,” sensitive parameter replaced ***”]},{“file”:“/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php”,“line”:131,“function”:“requestAsync”,“class”:“GuzzleHttp\Client”,“type”:“->”,“args”:[“get”,{“class”:“GuzzleHttp\Psr7\Uri”},{“verify”:“/var/www/html/nextcloud/data/files_external/rootcerts.crt”,“synchronous”:true,“handler”:{“class”:“GuzzleHttp\HandlerStack”},“allow_redirects”:{“max”:5,“protocols”:[“http”,“https”],“strict”:false,“referer”:false,“track_redirects”:false},“http_errors”:true,“decode_content”:true,“cookies”:false,“_conditional”:{“User-Agent”:“GuzzleHttp/6.3.3 curl/7.29.0 PHP/7.3.10”}}]},{“file”:“/var/www/html/nextcloud/lib/private/Http/Client/Client.php”,“line”:161,“function”:“request”,“class”:“GuzzleHttp\Client”,“type”:“->”,“args”:[“get”,“https://nextcloud.com/“,{“verify”:”/var/www/html/nextcloud/data/files_external/rootcerts.crt",“synchronous”:true}]},{“file”:“/var/www/html/nextcloud/settings/Controller/CheckSetupController.php”,“line”:242,“function”:“get”,“class”:“OC\\Http\\Client\\Client”,“type”:"->”,“args”:[“https://nextcloud.com/“]},{“file”:”/var/www/html/nextcloud/settings/Controller/CheckSetupController.php",“line”:678,“function”:“isUsedTlsLibOutdated”,“class”:“OC\\Settings\\Controller\\CheckSetupController”,“type”:"->”,“args”:},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:166,“function”:“check”,“class”:“OC\Settings\Controller\CheckSetupController”,“type”:“->”,“args”:},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:99,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”,“args”:[{“class”:“OC\Settings\Controller\CheckSetupController”},“check”]},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/App.php”,“line”:126,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”,“args”:[{“class”:“OC\Settings\Controller\CheckSetupController”},“check”]},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php”,“line”:47,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”,“args”:[“OC\Settings\Controller\CheckSetupController”,“check”,{“class”:“OC\AppFramework\DependencyInjection\DIContainer”},{“_route”:“settings.CheckSetup.check”}]},{“function”:“__invoke”,“class”:“OC\AppFramework\Routing\RouteActionHandler”,“type”:“->”,“args”:[{“_route”:“settings.CheckSetup.check”}]},{“file”:“/var/www/html/nextcloud/lib/private/Route/Router.php”,“line”:297,“function”:“call_user_func”,“args”:[{“class”:“OC\AppFramework\Routing\RouteActionHandler”},{“_route”:“settings.CheckSetup.check”}]},{“file”:“/var/www/html/nextcloud/lib/base.php”,“line”:975,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”,“args”:[“/settings/ajax/checksetup”]},{“file”:“/var/www/html/nextcloud/index.php”,“line”:42,“function”:“handleRequest”,“class”:“OC”,“type”:“::”,“args”:}],“File”:“/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php”,“Line”:186,“CustomMessage”:“–”},“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36”,“version”:“16.0.5.1”,“id”:“5da0cb16627c1”}

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

<?php
$CONFIG = array (
  'instanceid' => 'ocajde3l7pxq',
  'passwordsalt' => 'hash',
  'secret' => 'hash',
  'trusted_domains' =>
  array (
    0 => 'mydomain.com',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '16.0.5.1',
  'overwrite.cli.url' => 'https://mydomain.com/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'hash',
  'installed' => true,
  'updater.secret' => 'hash',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
);

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

2019/10/11 07:22:52 [error] 6367#0: *47994 directory index of "/var/www/html/" is forbidden, client: 74.82.47.4, server: mydomain.com, request: "GET / HTTP/1.1", host: "91.206.161.137"
2019/10/11 08:00:03 [error] 6366#0: *48005 directory index of "/var/www/html/" is forbidden, client: 207.46.13.38, server: mydomain.com, request: "GET / HTTP/1.1", host: "mydomain.com"
2019/10/11 10:03:14 [error] 6366#0: *48578 open() "/usr/share/nginx/html/editBlackAndWhiteList" failed (2: No such file or directory), client: 187.228.24.206, server: _, request: "POST /editBlackAndWhiteList HTTP/1.1", host: "91.206.161.137"
2019/10/11 10:35:18 [error] 6367#0: *48580 directory index of "/var/www/html/" is forbidden, client: 51.15.191.81, server: mail.mydomain.com, request: "GET / HTTP/1.1", host: "mail.mydomain.com"
2019/10/11 10:37:08 [error] 6366#0: *48582 "/usr/share/nginx/html/phpmyadmin/index.html" is not found (2: No such file or directory), client: 87.147.192.104, server: _, request: "GET /phpmyadmin/ HTTP/1.1", host: "91.206.161.137"
2019/10/11 10:43:15 [error] 6367#0: *48584 directory index of "/var/www/html/" is forbidden, client: 163.172.89.21, server: mydomain.com, request: "GET / HTTP/1.1", host: "mydomain.com"
2019/10/11 10:43:16 [error] 6367#0: *48585 directory index of "/var/www/html/" is forbidden, client: 163.172.89.63, server: mydomain.com, request: "GET / HTTP/1.1", host: "mydomain.com"
2019/10/11 10:47:03 [error] 6367#0: *48587 directory index of "/var/www/html/" is forbidden, client: 51.15.191.81, server: mydomain.com, request: "GET / HTTP/1.1", host: "mydomain.com"
2019/10/11 11:49:39 [error] 6367#0: *48676 directory index of "/var/www/html/" is forbidden, client: 104.42.137.111, server: mydomain.com, request: "GET / HTTP/1.1", host: "91.206.161.137"
2019/10/11 12:24:49 [error] 6367#0: *48785 open() "/usr/share/nginx/html/.env" failed (2: No such file or directory), client: 91.121.209.213, server: _, request: "GET /.env HTTP/1.0"
2019/10/11 12:46:06 [error] 6366#0: *48988 directory index of "/var/www/html/" is forbidden, client: 34.210.110.19, server: mydomain.com, request: "GET / HTTP/1.1", host: "mydomain.com"
2019/10/11 12:46:07 [error] 6366#0: *48989 directory index of "/var/www/html/" is forbidden, client: 34.210.110.19, server: mydomain.com, request: "GET / HTTP/1.1", host: "mydomain.com"
2019/10/11 14:57:00 [error] 6367#0: *49810 open() "/usr/share/nginx/html/robots.txt" failed (2: No such file or directory), client: 77.247.110.222, server: _, request: "HEAD /robots.txt HTTP/1.0"
2019/10/11 15:03:31 [error] 6366#0: *49893 open() "/usr/share/nginx/html/robots.txt" failed (2: No such file or directory), client: 77.247.110.222, server: _, request: "HEAD /robots.txt HTTP/1.0"
2019/10/11 15:14:48 [error] 6367#0: *50046 open() "/var/www/html/api/v1/pod" failed (2: No such file or directory), client: 178.128.200.121, server: mydomain.com, request: "GET /api/v1/pod HTTP/1.1", host: "91.206.161.137"
2019/10/11 15:30:54 [error] 6366#0: *50156 directory index of "/var/www/html/" is forbidden, client: 137.226.113.26, server: mydomain.com, request: "GET / HTTP/1.1", host: "www.mydomain.com"
2019/10/11 16:17:08 [error] 6367#0: *50309 open() "/usr/share/nginx/html/robots.txt" failed (2: No such file or directory), client: 77.247.110.222, server: _, request: "HEAD /robots.txt HTTP/1.0"
2019/10/11 17:01:39 [error] 6366#0: *50316 open() "/usr/share/nginx/html/robots.txt" failed (2: No such file or directory), client: 54.36.149.105, server: _, request: "GET /robots.txt HTTP/1.1", host: "ns1.mydomain.com"
2019/10/11 18:22:02 [error] 6367#0: *50407 directory index of "/var/www/html/" is forbidden, client: 54.183.12.197, server: mydomain.com, request: "GET / HTTP/1.1", host: "mydomain.com"
2019/10/11 19:42:23 [error] 6367#0: *50951 access forbidden by rule, client: 91.65.192.204, server: mydomain.com, request: "GET /nextcloud/data/.ocdata?t=1570815676205 HTTP/2.0", host: "mydomain.com"
2019/10/11 19:42:30 [error] 6367#0: *50951 access forbidden by rule, client: 91.65.192.204, server: mydomain.com, request: "GET /nextcloud/data/.ocdata?t=1570815683332 HTTP/2.0", host: "mydomain.com"
2019/10/11 19:42:33 [error] 6367#0: *50951 access forbidden by rule, client: 91.65.192.204, server: mydomain.com, request: "GET /nextcloud/data/.ocdata?t=1570815686215 HTTP/2.0", host: "mydomain.com"

The access forbidden rules are consistent with the recommended nginx configuration found on nextcloud’s official site:

  location ~ ^\/nextcloud\/(?:build|tests|config|lib|3rdparty|templates|data)\/ {
            deny all;

Thank you!