Desktop-client cannot connect after upgrade to NC17

Nextcloud version 17.0.2:
Operating system and version Ubuntu 19.10 and Windows:
I am using the docker-image

Since the Upgrade, I cannot connect to my cloud with the desktop client, neither from Windows, nor Ubuntu 19.10. Before it all worked fine and also the web-version of the cloud all works fine.

Is this the first time you’ve seen this error? Y

Steps to replicate it:

  1. start the Nextcloud Client
  2. enter your credentials
  3. wait for connecting

The output of your Nextcloud log in Admin > Logging:

there is no logging any more, since the day of the upgrade to NC17!
Maybe that is a related problem? the last log entry was:

[no app in context] Warning: Login failed: xxxx (Remote IP: x.x.x.189)

POST /login
from x.x.x.189 at 2020-01-16T10:56:21+00:00

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

89.15.238.21 - - [29/Jan/2020:15:52:28 +0100] "GET /core/img/actions/confirm-white.svg?v=2 HTTP/1.1" 200 405 "https://next.cvkev.de/core/css/guest.css?v=bb265635-20" "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)"

Now I updated to NC 18.0.0 and logging works again, but still it is not possible to connect on a new windows or Ubuntu machine with the desktop-client. The log shows:

[
  {
    "reqId": "AnjIVxWGgSuE8jhr5HV9",
    "level": 1,
    "time": "2020-01-30T08:36:38+00:00",
    "remoteAddr": "2003:a:133a:3600:eeff:994:ffee:125b",
    "user": "Bueros",
    "app": "no app in context",
    "method": "PROPFIND",
    "url": "/remote.php/webdav/",
    "message": "Deprecated event type for {\"[object] (OCP\\SabrePluginEvent)\":{\"*statusCode\":200,\"*message\":\"\",\"*server\":{\"[object] (OCA\\DAV\\Connector\\Sabre\\Server)\":{\"tree\":\"[object] (OCA\\DAV\\Connector\\Sabre\\ObjectTree)\",\"*baseUri\":\"/remote.php/webdav/\",\"httpResponse\":\"[object] (Sabre\\HTTP\\Response)\",\"httpRequest\":\"[object] (Sabre\\HTTP\\Request)\",\"sapi\":\"[object] (Sabre\\HTTP\\Sapi)\",\"*plugins\":[],\"transactionType\":null,\"protectedProperties\":{\"...\":\"Over 20 items, aborting normalization\"},\"debugExceptions\":false,\"resourceTypeMapping\":[],\"enablePropfindDepthInfinity\":true,\"xml\":\"[object] (Sabre\\DAV\\Xml\\Service)\",\"*listeners\":{\"...\":\"Over 20 items, aborting normalization\"},\"*logger\":null}},\"Symfony\\Contracts\\EventDispatcher\\EventpropagationStopped\":false}}: null",
    "userAgent": "Mozilla/5.0 (Windows) mirall/2.5.2git (build 20190319) (Nextcloud)",
    "version": "18.0.0.10",
    "id": "5e3295a0373e9"
  },
  {
    "reqId": "K5yGKOp00pI1dU84hWkO",
    "level": 0,
    "time": "2020-01-30T08:36:30+00:00",
    "remoteAddr": "89.15.11.11",
    "user": "--",
    "app": "core",
    "method": "GET",
    "url": "/login/flow/grant?clientIdentifier=&stateToken=xxxx",
    "message": {
      "Exception": "OC\\AppFramework\\Middleware\\Security\\Exceptions\\NotLoggedInException",
      "Message": "Current user is not logged in",
      "Code": 401,
      "Trace": [
        {
          "file": "/var/www/html/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php",
          "line": 97,
          "function": "beforeController",
          "class": "OC\\AppFramework\\Middleware\\Security\\SecurityMiddleware",
          "type": "->",
          "args": [
            {
              "__class__": "OC\\Core\\Controller\\ClientFlowLoginController"
            },
            "grantPage"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 97,
          "function": "beforeController",
          "class": "OC\\AppFramework\\Middleware\\MiddlewareDispatcher",
          "type": "->",
          "args": [
            {
              "__class__": "OC\\Core\\Controller\\ClientFlowLoginController"
            },
            "grantPage"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/App.php",
          "line": 125,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            {
              "__class__": "OC\\Core\\Controller\\ClientFlowLoginController"
            },
            "grantPage"
          ]
        },
        {
          "file": "/var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php",
          "line": 47,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::",
          "args": [
            "OC\\Core\\Controller\\ClientFlowLoginController",
            "grantPage",
            {
              "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
            },
            {
              "_route": "core.ClientFlowLogin.grantPage"
            }
          ]
        },
        {
          "function": "__invoke",
          "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
          "type": "->",
          "args": [
            {
              "_route": "core.ClientFlowLogin.grantPage"
            }
          ]
        },
        {
          "file": "/var/www/html/lib/private/Route/Router.php",
          "line": 299,
          "function": "call_user_func",
          "args": [
            {
              "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
            },
            {
              "_route": "core.ClientFlowLogin.grantPage"
            }
          ]
        },
        {
          "file": "/var/www/html/lib/base.php",
          "line": 1008,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->",
          "args": [
            "/login/flow/grant"
          ]
        },
        {
          "file": "/var/www/html/index.php",
          "line": 38,
          "function": "handleRequest",
          "class": "OC",
          "type": "::",
          "args": []
        }
      ],
      "File": "/var/www/html/lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php",
      "Line": 142,
      "CustomMessage": "--"
    },
    "userAgent": "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)",
    "version": "18.0.0.10",
    "id": "5e3295a037476"
  },
  {
    "reqId": "GvW5GVqyehVOqrrKgxpV",
    "level": 0,
    "time": "2020-01-30T08:36:18+00:00",
    "remoteAddr": "89.15.11.11",
    "user": "--",
    "app": "webdav",
    "method": "PROPFIND",
    "url": "/remote.php/webdav/",
    "message": {
      "Exception": "Sabre\\DAV\\Exception\\NotAuthenticated",
      "Message": "No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured",
      "Code": 0,
      "Trace": [
        {
          "function": "beforeMethod",
          "class": "Sabre\\DAV\\Auth\\Plugin",
          "type": "->",
          "args": [
            {
              "absoluteUrl": "http://next.myserver.de/remote.php/webdav/",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        },
        {
          "file": "/var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php",
          "line": 105,
          "function": "call_user_func_array",
          "args": [
            [
              {
                "autoRequireLogin": true,
                "__class__": "Sabre\\DAV\\Auth\\Plugin"
              },
              "beforeMethod"
            ],
            [
              {
                "absoluteUrl": "http://next.myserver.de/remote.php/webdav/",
                "__class__": "Sabre\\HTTP\\Request"
              },
              {
                "__class__": "Sabre\\HTTP\\Response"
              }
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 466,
          "function": "emit",
          "class": "Sabre\\Event\\EventEmitter",
          "type": "->",
          "args": [
            "beforeMethod",
            [
              {
                "absoluteUrl": "http://next.myserver.de/remote.php/webdav/",
                "__class__": "Sabre\\HTTP\\Request"
              },
              {
                "__class__": "Sabre\\HTTP\\Response"
              }
            ]
          ]
        },
        {
          "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 254,
          "function": "invokeMethod",
          "class": "Sabre\\DAV\\Server",
          "type": "->",
          "args": [
            {
              "absoluteUrl": "http://next.myserver.de/remote.php/webdav/",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        },
        {
          "file": "/var/www/html/apps/dav/appinfo/v1/webdav.php",
          "line": 82,
          "function": "exec",
          "class": "Sabre\\DAV\\Server",
          "type": "->",
          "args": []
        },
        {
          "file": "/var/www/html/remote.php",
          "line": 165,
          "args": [
            "/var/www/html/apps/dav/appinfo/v1/webdav.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php",
      "Line": 168,
      "CustomMessage": "--"
    },
    "userAgent": "Mozilla/5.0 (Linux) mirall/2.5.3git (Nextcloud)",
    "version": "18.0.0.10",
    "id": "5e3295a0374f1"
  }
]

I solved it by adding a new config parameter in config.php:

'overwriteprotocol' => 'https',

see manual:

When generating URLs, Nextcloud attempts to detect whether the server is accessed via https or http . However, if Nextcloud is behind a proxy and the proxy handles the https calls, Nextcloud would not know that ssl is in use, which would result in incorrect URLs being generated.

Since my NC is behind a proxy, this seems to be needed since Nextcloud 17.

( I found the hint here: After Nextcloud 17 Update, I can't sync my linux client with nextcloud - #10 by Exchizz )

1 Like