No more access via Browser, exception in nextcloud.log

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: 15.0.8.1
Operating system and version: _Ubuntu 18.04.02
Apache or nginx version: nginx 1.14.0-0ubuntu1.6
PHP version: 7.2+60ubuntu1

The issue you are facing:

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

Steps to replicate it:

  1. Acccess the nextcloud URL
  2. With Chrome, not even login page appears
  3. With Chrome Incognito, you can login but it says “Problem while loading page; will be reloaded in 5 seconds” (translated from German)
  4. Then, user is logged out.

The output of your Nextcloud log in Admin > Logging:

No browser access possible; nextcloud.log has the following (formatted for better viewing, slightly redacted to hide exact domain name and IP addresses).

{
  "reqId": "qdsQ6zL176x0JevYuWLW",
  "level": 3,
  "time": "2019-10-31T12:01:05+00:00",
  "remoteAddr": "27.3.8.7",
  "user": "--",
  "app": "index",
  "method": "GET",
  "url": "\/core\/preview?fileId=176295&c=03cfb6957afe6966f9e92a026ebed7cf&x=401&y=401&forceIcon=0",
  "message":
    {
      "Exception": "TypeError",
      "Message": "Argument 5 passed to OC\\Core\\Controller\\PreviewController::__construct() must be of the type string, null given",
      "Code": 0,
      "Trace":
        [
          {
            "function": "__construct",
            "class": "OC\\Core\\Controller\\PreviewController",
            "type": "->",
            "args":
              [
                "core",
                { "__class__": "OC\\AppFramework\\Http\\Request" },
                { "__class__": "OC\\PreviewManager" },
                { "__class__": "OC\\Files\\Node\\LazyRoot" },
                null,
                { "__class__": "OC\\AppFramework\\Utility\\TimeFactory" },
              ],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php",
            "line": 81,
            "function": "newInstanceArgs",
            "class": "ReflectionClass",
            "type": "->",
            "args":
              [
                [
                  "core",
                  { "__class__": "OC\\AppFramework\\Http\\Request" },
                  { "__class__": "OC\\PreviewManager" },
                  { "__class__": "OC\\Files\\Node\\LazyRoot" },
                  null,
                  { "__class__": "OC\\AppFramework\\Utility\\TimeFactory" },
                ],
              ],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php",
            "line": 98,
            "function": "buildClass",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args":
              [
                {
                  "name": "OC\\Core\\Controller\\PreviewController",
                  "__class__": "ReflectionClass",
                },
              ],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php",
            "line": 119,
            "function": "resolve",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": ["OC\\Core\\Controller\\PreviewController"],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/private\/AppFramework\/DependencyInjection\/DIContainer.php",
            "line": 424,
            "function": "query",
            "class": "OC\\AppFramework\\Utility\\SimpleContainer",
            "type": "->",
            "args": ["OC\\Core\\Controller\\PreviewController"],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/private\/AppFramework\/DependencyInjection\/DIContainer.php",
            "line": 397,
            "function": "queryNoFallback",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->",
            "args": ["OC\\Core\\Controller\\PreviewController"],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/private\/AppFramework\/App.php",
            "line": 105,
            "function": "query",
            "class": "OC\\AppFramework\\DependencyInjection\\DIContainer",
            "type": "->",
            "args": ["OC\\Core\\Controller\\PreviewController"],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php",
            "line": 47,
            "function": "main",
            "class": "OC\\AppFramework\\App",
            "type": "::",
            "args":
              [
                "OC\\Core\\Controller\\PreviewController",
                "getPreviewByFileId",
                {
                  "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer",
                },
                { "_route": "core.Preview.getPreviewByFileId" },
              ],
          },
          {
            "function": "__invoke",
            "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
            "type": "->",
            "args": [{ "_route": "core.Preview.getPreviewByFileId" }],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/private\/Route\/Router.php",
            "line": 297,
            "function": "call_user_func",
            "args":
              [
                {
                  "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler",
                },
                { "_route": "core.Preview.getPreviewByFileId" },
              ],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/lib\/base.php",
            "line": 987,
            "function": "match",
            "class": "OC\\Route\\Router",
            "type": "->",
            "args": ["\/core\/preview"],
          },
          {
            "file": "\/z\/www\/nextcloud\/cloud.example.com\/php\/index.php",
            "line": 42,
            "function": "handleRequest",
            "class": "OC",
            "type": "::",
            "args": [],
          },
        ],
      "File": "\/z\/www\/nextcloud\/cloud.example.com\/php\/core\/Controller\/PreviewController.php",
      "Line": 64,
      "CustomMessage": "--",
    },
  "userAgent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/78.0.3904.70 Safari\/537.36",
  "version": "15.0.8.1",
}

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

<?php
$CONFIG = array (
  'instanceid' => 'ocb3n931r7c0',
  'passwordsalt' => 'wR08O+v5KfQ5AJfMXX/VieR+GiHo++',
  'secret' => 'OeIhLZcSa4dHbG14Ktl/SiC5SvvmV9FYsdZPRNTNcZxm4fP/',
  'trusted_domains' =>
  array (
    0 => 'cloud.example.com',
  ),
  'datadirectory' => '/z/www/nextcloud/cloud.example.com/data',
  'overwrite.cli.url' => 'https://cloud.example.com',
  'dbtype' => 'mysql',
  'version' => '15.0.8.1',
  'dbname' => 'cloud_example_com',
  'dbhost' => 'localhost:/run/mysqld/mysqld.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'cii',
  'dbpassword' => 'XXXXXXXXXXX',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => false,
  'loglevel' => 2,
  'updater.release.channel' => 'production',
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'no-reply',
  'mail_domain' => 'cloud.example.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'mail.example.com',
  'mail_smtpport' => '587',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'theme' => '',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'no-reply@cloud.example.com',
  'mail_smtppassword' => 'XXXXXXXXXXX',
  'mail_smtpsecure' => 'tls',
);

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

1.2.3.4 - - [31/Oct/2019:12:56:02 +0000] "GET / HTTP/2.0" 503 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36"

Might have something to do with https://github.com/nextcloud/server/issues/16749 .