Desktop: Login -> HTTP 411 Length Required

Created on 3 Oct 2019  路  3Comments  路  Source: nextcloud/desktop

When loggin into an account the App cant connect to the server with version 2.6.0-rc1 and 2.6.0.
It seems that the webserver lighttpd rejects POST request without a Content-length with 411 Length Required.
Going back to Version 2.5.3 is a workaround for me.

Expected behaviour

Login after installing Nextcloud should give no error.

Actual behaviour

Trying to log in fails after typing in the server URL.

Steps to reproduce

  1. Install the Nextcloud Windows Desktop App 2.6.0 or 2.6.0-rc1
  2. Try to log in to a Nextcloud Server instance using lighttpd as a webserver.
  3. Login fails. "Error while connecting, try again later."
    (4. "Copy Link" copys an empty string. "Re-open Browser" throws the same error in logger)

Client configuration

Client version: 2.6.0 & 2.6.0-rc1
Operating system: Windows 10 1903
OS language: German
Installation path of client: C:\Program Files\Nextcloud

Server configuration

Nextcloud version: Nextcloud 16.0.5

Logs

Please use Gist (https://gist.github.com/) or a similar code paster for longer
logs.

  1. Client logfile: Output of nextcloud --logwindow or nextcloud --logfile log.txt
    [OCC::OwncloudSetupWizard::slotSystemProxyLookupDone No system proxy set by OS [OCC::AccessManager::createRequest 2 "" "https://myurl.org/nextcloud/status.php" has X-Request-ID "077da5f1-b74d-4e3c-8ac3-1c84c3cc836e" [OCC::AbstractNetworkJob::start OCC::CheckServerJob created for "https://myurl.org/nextcloud" + "status.php" "OCC::OwncloudSetupWizard" [OCC::CheckServerJob::finished No SSL session identifier / session ticket is used, this might impact sync performance negatively. [OCC::CheckServerJob::finished status.php returns: QJsonDocument({"edition":"","installed":true,"maintenance":false,"needsDbUpgrade":false,"productname":"Nextcloud","version":"16.0.5.1","versionstring":"16.0.5"}) QNetworkReply::NoError Reply: QNetworkReplyHttpImpl(0x174d787c4b0) [OCC::DetermineAuthTypeJob::start Determining auth type for QUrl("https://myurl.org/nextcloud/remote.php/webdav/") [OCC::AccessManager::createRequest 2 "" "https://myurl.org/nextcloud/remote.php/webdav/" has X-Request-ID "ef1d3c49-c876-4708-831a-56e7762b3a7f" [OCC::AbstractNetworkJob::start OCC::SimpleNetworkJob created for "https://myurl.org/nextcloud" + "" "OCC::Account" [OCC::AccessManager::createRequest 6 "PROPFIND" "https://myurl.org/nextcloud/remote.php/webdav/" has X-Request-ID "d7f320ff-996c-486f-8ac3-a36434adf02b" [OCC::AbstractNetworkJob::start OCC::SimpleNetworkJob created for "https://myurl.org/nextcloud" + "" "OCC::Account" [OCC::DetermineAuthTypeJob::checkBothDone Auth type for QUrl("https://myurl.org/nextcloud/remote.php/webdav/") is 4 [OCC::AccessManager::createRequest 4 "" "https://myurl.org/nextcloud/index.php/login/v2" has X-Request-ID "c096608f-79e4-4f1a-928d-56fdb39215ab" [OCC::AbstractNetworkJob::start OCC::SimpleNetworkJob created for "https://myurl.org/nextcloud" + "" "OCC::Account" [OCC::AbstractNetworkJob::slotFinished QNetworkReply::UnknownContentError "Server hat \"411 Length Required\" auf \"POST https://myurl.org/nextcloud/index.php/login/v2\" geantwortet" QVariant(int, 411) [OCC::Flow2Auth::openBrowser::::operator() Error when getting the loginUrl QJsonObject({"error":null,"login":null}) "Fehler beim Zugriff auf den 'Token'-Endpunkt: <br><em>Error transferring https://myurl.org/nextcloud/index.php/login/v2 - server replied: Length Required</em>"

  2. Web server error log:
    2019-10-03 17:42:50: (request.c.1173) POST-request, but content-length missing -> 411

  3. Server logfile: nextcloud log (data/nextcloud.log):
    nextcloud.log file does not get any entry.

bug feature authentication

Most helpful comment

I can confirm that this is fixed with Version 2.6.1rc1-Win64 (build 20191017). Thank you 馃憤

All 3 comments

I can confirm the same issue on the Linux client. Seems this request is the issue:

curl -X POST https://cloud.example.com/index.php/login/v2

in combination with a Nextcloud server running on lighttpd. The lighttpd server will respond with 411 Length required to a POST request with an empty body but no Content-Lengthheader. modifying the request to:

curl -d "" -X POST https://cloud.example.com/index.php/login/v2
or
curl -H "Content-Length: 0" -X POST https://cloud.example.com/index.php/login/v2

Will result in the expected response:

{
  "poll": {
    "token": "some-random-token",
    "endpoint": "https:\/\/cloud.example.com\/index.php\/login\/v2\/poll"
  },
  "login": "https:\/\/cloud.example.com\/index.php\/login\/v2\/flow\/some-random-token"
}

Downgrading to version 2.5.3 from the old releases, as a temporary workaround, was successful.

I was able to reproduce the issue and fixed it with PR #1495 馃樇

@Valdiralita Thanks for reporting! 馃憤

And @SirSkorpan Thanks for providing more technical details! 馃殌

The fix will be in our 2.6.1 release :-)

I can confirm that this is fixed with Version 2.6.1rc1-Win64 (build 20191017). Thank you 馃憤

Was this page helpful?
0 / 5 - 0 ratings