[GH-ISSUE #1263] More human WebDAV configuration support #839

Closed
opened 2026-02-25 22:38:15 +03:00 by kerem · 9 comments
Owner

Originally created by @khinsen on GitHub (Oct 6, 2022).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1263

Describe the feature you'd like to request

WebDAV is an eternal source of frustration, and floccus is no exception. My first attempt to use floccus has been a failure so far because of "Could not connect to server: 500", with no explanation and no support for debugging, for a WebDAV account that works fine with several other clients. I'd love to get help from floccus to explore and fix the issue.

Describe the solution you'd like

  1. Better documentation. The user guide says "The URL should end with a slash" right after quoting an example that doesn't end with a slash. In the next sentence, it refers to a list of URLs, none of which end with a slash.
  2. More lenient configuration. floccus could add a slash by itself if the URL doesn't have one. Or do the opposite, if that's what it takes.
  3. Debugging aids:
  • Explanation of error messages
  • Suggestions of what's worth trying
  • As a last resort: show the JavaScript code that floccus uses to connect, to enable experiments in a JS console for those who know a bit of JS.

Describe alternatives you've considered

Give up and use some other tool than floccus (sorry for the flippant reply, but since this is a required field, I had to come up with something).

Originally created by @khinsen on GitHub (Oct 6, 2022). Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1263 ### Describe the feature you'd like to request WebDAV is an eternal source of frustration, and floccus is no exception. My first attempt to use floccus has been a failure so far because of "Could not connect to server: 500", with no explanation and no support for debugging, for a WebDAV account that works fine with several other clients. I'd love to get help from floccus to explore and fix the issue. ### Describe the solution you'd like 1) Better documentation. The user guide says "The URL should end with a slash" right after quoting an example that doesn't end with a slash. In the next sentence, it refers to a list of URLs, none of which end with a slash. 2) More lenient configuration. floccus could add a slash by itself if the URL doesn't have one. Or do the opposite, if that's what it takes. 3) Debugging aids: - Explanation of error messages - Suggestions of what's worth trying - As a last resort: show the JavaScript code that floccus uses to connect, to enable experiments in a JS console for those who know a bit of JS. ### Describe alternatives you've considered Give up and use some other tool than floccus (sorry for the flippant reply, but since this is a required field, I had to come up with something).
kerem 2026-02-25 22:38:15 +03:00
Author
Owner

@marcelklehr commented on GitHub (Oct 7, 2022):

Thank you for your feedback. You've done exactly the right thing by coming here with your problem.

500 in this case means HTTP Status 500, so your HTTP server responds to a PROPFIND on the webdav URL you entered with a 500. I recommend checking your server log. The error message in this case is indeed a bit glib. I'll extend it to be more useful.

<!-- gh-comment-id:1271494334 --> @marcelklehr commented on GitHub (Oct 7, 2022): Thank you for your feedback. You've done exactly the right thing by coming here with your problem. 500 in this case means HTTP Status 500, so your HTTP server responds to a PROPFIND on the webdav URL you entered with a 500. I recommend checking your server log. The error message in this case is indeed a bit glib. I'll extend it to be more useful.
Author
Owner

@khinsen commented on GitHub (Oct 7, 2022):

Thanks for your reply, and for improving the error message!

Unfortunately, "check the server log" is a solution only for the server administrator. Not my case - I am a "mere" user on an owncloud instance run by my employer.

That said, knowing that the operation is PROFIND is potentially useful for debugging, so that should be in the floccus error message. But for me, PROPFIND works just fine when done with curl:

$ curl -X PROPFIND  -u <user>:<pass> <my-url>
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns"><d:response><d:href>/remote.php/webdav/</d:href><d:propstat><d:prop><d:getlastmodified>Fri, 07 Oct 2022 11:34:47 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>8646280100</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;63400ed77a413&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/Sync/</d:href><d:propstat><d:prop><d:getlastmodified>Fri, 07 Oct 2022 06:49:18 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>3206412378</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;633fcbeeea349&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/floccus/</d:href><d:propstat><d:prop><d:getlastmodified>Thu, 06 Oct 2022 07:11:35 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>0</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;633e7fa776bf5&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/git-annex/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 05 Apr 2022 12:10:11 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>25176960</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;624c3239f3b89&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/zotero/</d:href><d:propstat><d:prop><d:getlastmodified>Fri, 07 Oct 2022 11:34:47 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>5414690762</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;63400ed77a413&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>

So I guess it takes something more specific to get the error response.
<!-- gh-comment-id:1271650838 --> @khinsen commented on GitHub (Oct 7, 2022): Thanks for your reply, and for improving the error message! Unfortunately, "check the server log" is a solution only for the server administrator. Not my case - I am a "mere" user on an owncloud instance run by my employer. That said, knowing that the operation is PROFIND is potentially useful for debugging, so that should be in the floccus error message. But for me, PROPFIND works just fine when done with `curl`: ``` $ curl -X PROPFIND -u <user>:<pass> <my-url> <?xml version="1.0"?> <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns"><d:response><d:href>/remote.php/webdav/</d:href><d:propstat><d:prop><d:getlastmodified>Fri, 07 Oct 2022 11:34:47 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>8646280100</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;63400ed77a413&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/Sync/</d:href><d:propstat><d:prop><d:getlastmodified>Fri, 07 Oct 2022 06:49:18 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>3206412378</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;633fcbeeea349&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/floccus/</d:href><d:propstat><d:prop><d:getlastmodified>Thu, 06 Oct 2022 07:11:35 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>0</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;633e7fa776bf5&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/git-annex/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 05 Apr 2022 12:10:11 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>25176960</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;624c3239f3b89&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/webdav/zotero/</d:href><d:propstat><d:prop><d:getlastmodified>Fri, 07 Oct 2022 11:34:47 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype><d:quota-used-bytes>5414690762</d:quota-used-bytes><d:quota-available-bytes>98727902300</d:quota-available-bytes><d:getetag>&quot;63400ed77a413&quot;</d:getetag></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus> So I guess it takes something more specific to get the error response. ```
Author
Owner

@marcelklehr commented on GitHub (Oct 14, 2022):

But for me, PROPFIND works just fine when done with curl

Interesting! What is the overall HTTP status code here?

<!-- gh-comment-id:1279171341 --> @marcelklehr commented on GitHub (Oct 14, 2022): > But for me, PROPFIND works just fine when done with curl Interesting! What is the overall HTTP status code here?
Author
Owner

@marcelklehr commented on GitHub (Oct 14, 2022):

This is the code that tests the WebDAV server:

    let res = await fetch(`${rootUrl}`, {
      method: 'PROPFIND',
      credentials: 'omit',
      headers: {
        'User-Agent': 'Floccus bookmarks sync',
        Depth: '0',
        Authorization: 'Basic ' + Base64.encode(
          username + ':' + password
        )
      }
    })
    if (res.status < 200 || res.status > 299) {
      throw new Error('Could not connect to your webdav server at the specified URL. The server responded with HTTP status ' + res.status + ' to a PROPFIND request with Basic Auth on the URL you entered.')
    }
    return true
<!-- gh-comment-id:1279174727 --> @marcelklehr commented on GitHub (Oct 14, 2022): This is the code that tests the WebDAV server: ```js let res = await fetch(`${rootUrl}`, { method: 'PROPFIND', credentials: 'omit', headers: { 'User-Agent': 'Floccus bookmarks sync', Depth: '0', Authorization: 'Basic ' + Base64.encode( username + ':' + password ) } }) if (res.status < 200 || res.status > 299) { throw new Error('Could not connect to your webdav server at the specified URL. The server responded with HTTP status ' + res.status + ' to a PROPFIND request with Basic Auth on the URL you entered.') } return true ```
Author
Owner

@marcelklehr commented on GitHub (Oct 14, 2022):

Aah, you're using owncloud, I believe they have a bug where they cannot process Origin: null, which is what some browsers do for webextensions.

<!-- gh-comment-id:1279176996 --> @marcelklehr commented on GitHub (Oct 14, 2022): Aah, you're using owncloud, I believe they have a bug where they cannot process `Origin: null`, which is what some browsers do for webextensions.
Author
Owner

@marcelklehr commented on GitHub (Oct 14, 2022):

I should put that in the FAQ

<!-- gh-comment-id:1279178977 --> @marcelklehr commented on GitHub (Oct 14, 2022): I should put that in the FAQ
Author
Owner

@khinsen commented on GitHub (Oct 15, 2022):

Status is '200 OK'.

If that's an owncloud issue, there is probably little I can do about this, other than look for another WebDAV server.

But I think it would be useful to have that piece of JS code somewhere in the documentation, to help others debug their WebDAV issues.

<!-- gh-comment-id:1279697571 --> @khinsen commented on GitHub (Oct 15, 2022): Status is '200 OK'. If that's an owncloud issue, there is probably little I can do about this, other than look for another WebDAV server. But I think it would be useful to have that piece of JS code somewhere in the documentation, to help others debug their WebDAV issues.
Author
Owner

@khinsen commented on GitHub (Oct 16, 2022):

Another test: my WebDAV server works fine with floccus on Android. Support for the hypothesis that it's owncloud not getting along well with Web extensions.

<!-- gh-comment-id:1279911949 --> @khinsen commented on GitHub (Oct 16, 2022): Another test: my WebDAV server works fine with floccus on Android. Support for the hypothesis that it's owncloud not getting along well with Web extensions.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2023):

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:1788250778 --> @github-actions[bot] commented on GitHub (Nov 1, 2023): This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/floccus#839
No description provided.