Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rclone fails uploads with some WebDAV servers #6145

Open
Evengard opened this issue May 3, 2022 · 1 comment
Open

Rclone fails uploads with some WebDAV servers #6145

Evengard opened this issue May 3, 2022 · 1 comment

Comments

@Evengard
Copy link

Evengard commented May 3, 2022

The associated forum post URL from https://forum.rclone.org

Not applicable

What is the problem you are having with rclone?

While this issue may seem related to #6032, I'd classify it as a separate issue, as such a case may be happening with any other WebDAV server.

Yandex.Disk does provide a WebDAV endpoint, and I was testing it using rclone. While uploading any file with any significant size (for me it was about 50 MiB or anything more), it seems the transfer is getting stuck after transferring the first 40-50 MiB or around that, then doing multiple internal retries and subsequently failing the transfer alltogether.

My assumption is that (according to https://yandex.ru/dev/disk/doc/dg/reference/put.html) the server is expected to reply with 100 Continue to the PUT request, and sending data before that seems to actually break the transfer (although can't really confirm it, as no answer is actually displayed in --dump headers)

What is your rclone version (output from rclone version)

rclone v1.58.1
- os/version: arch (64 bit)
- os/kernel: 5.17.3-arch1-1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.1
- go/linking: dynamic
- go/tags: none

Which OS you are using and how many bits (e.g. Windows 7, 64 bit)

ArchLinux amd64

Which cloud storage system are you using? (e.g. Google Drive)

WebDAV endpoint of Yandex.Disk, configured as WebDAV.

The command you were trying to run (e.g. rclone copy /tmp remote:tmp)

rclone copy -vv --dump headers /data/NWRESTOREFORUM.7z ywd:/2tb

The NWRESTOREFORUM.7z is a file of about 400 MiB, never finishing this transfer successfully.

A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)

rclone copy -vv --dump headers /data/NWRESTOREFORUM.7z ywd:/2tb
2022/05/03 12:18:52 DEBUG : rclone: Version "v1.58.1" starting with parameters ["rclone" "copy" "-vv" "--dump" "headers" "/data/NWRESTOREFORUM.7z" "ywd:/2tb"]
2022/05/03 12:18:52 DEBUG : Creating backend with remote "/data/NWRESTOREFORUM.7z"
2022/05/03 12:18:52 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2022/05/03 12:18:52 DEBUG : fs cache: adding new entry for parent of "/data/NWRESTOREFORUM.7z", "/data"
2022/05/03 12:18:52 DEBUG : Creating backend with remote "ywd:/2tb"
2022/05/03 12:18:52 DEBUG : found headers:
2022/05/03 12:18:52 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2022/05/03 12:18:52 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/03 12:18:52 DEBUG : HTTP REQUEST (req 0xc0008e8100)
2022/05/03 12:18:52 DEBUG : PROPFIND /2tb HTTP/1.1
Host: webdav.yandex.ru
User-Agent: rclone/v1.58.1
Authorization: XXXX
Depth: 1
Referer: https://webdav.yandex.ru/
Accept-Encoding: gzip

2022/05/03 12:18:52 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/03 12:18:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022/05/03 12:18:53 DEBUG : HTTP RESPONSE (req 0xc0008e8100)
2022/05/03 12:18:53 DEBUG : HTTP/1.1 207 Multi-Status
Transfer-Encoding: chunked
Content-Type: application/xml; charset=UTF-8
Date: Tue, 03 May 2022 12:18:52 GMT
Server: Jetty(9.4.11.v20180605)
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
Yandex-Cloud-Request-Id: dav-5078c88c85f98436495a3a1b7ca0a9cd-edm4mml32wsr3r6e
Yandex-Uid: 889988376

2022/05/03 12:18:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022/05/03 12:18:53 DEBUG : fs cache: renaming cache item "ywd:/2tb" to be canonical "ywd:2tb"
2022/05/03 12:18:53 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/03 12:18:53 DEBUG : HTTP REQUEST (req 0xc000118700)
2022/05/03 12:18:53 DEBUG : PROPFIND /2tb/NWRESTOREFORUM.7z HTTP/1.1
Host: webdav.yandex.ru
User-Agent: rclone/v1.58.1
Authorization: XXXX
Depth: 1
Referer: https://webdav.yandex.ru/
Accept-Encoding: gzip

2022/05/03 12:18:53 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/03 12:18:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022/05/03 12:18:53 DEBUG : HTTP RESPONSE (req 0xc000118700)
2022/05/03 12:18:53 DEBUG : HTTP/1.1 404 Not Found
Date: Tue, 03 May 2022 12:18:53 GMT
Server: Jetty(9.4.11.v20180605)
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
Yandex-Cloud-Request-Id: dav-cdb0ef8bdd86406d82a3ffbf71aef23c-xgf7i25fwa5sheqc
Yandex-Uid: 889988376
Content-Length: 0

2022/05/03 12:18:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022/05/03 12:18:53 DEBUG : NWRESTOREFORUM.7z: Need to transfer - File not found at Destination
2022/05/03 12:18:53 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/03 12:18:53 DEBUG : HTTP REQUEST (req 0xc000118e00)
2022/05/03 12:18:53 DEBUG : MKCOL /2tb/ HTTP/1.1
Host: webdav.yandex.ru
User-Agent: rclone/v1.58.1
Authorization: XXXX
Referer: https://webdav.yandex.ru/
Accept-Encoding: gzip

2022/05/03 12:18:53 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/03 12:18:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022/05/03 12:18:53 DEBUG : HTTP RESPONSE (req 0xc000118e00)
2022/05/03 12:18:53 DEBUG : HTTP/1.1 405 Method Not Allowed
Date: Tue, 03 May 2022 12:18:53 GMT
Server: Jetty(9.4.11.v20180605)
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 1; mode=block
Yandex-Cloud-Request-Id: dav-f09e48837f4f836ca49fdaedb4d23d81-xgf7i25fwa5sheqc
Yandex-Uid: 889988376
Content-Length: 0

2022/05/03 12:18:53 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022/05/03 12:18:56 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/03 12:18:56 DEBUG : HTTP REQUEST (req 0xc000118700)
2022/05/03 12:18:56 DEBUG : PUT /2tb/NWRESTOREFORUM.7z HTTP/1.1
Host: webdav.yandex.ru
User-Agent: rclone/v1.58.1
Content-Length: 438598157
Authorization: XXXX
Content-Type: application/octet-stream
Referer: https://webdav.yandex.ru/
Accept-Encoding: gzip

2022/05/03 12:18:56 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/03 12:19:53 INFO  :
Transferred:       38.434 MiB / 418.280 MiB, 9%, 334.450 KiB/s, ETA 19m22s
Transferred:            0 / 1, 0%
Elapsed time:       1m0.6s
Transferring:
 *                             NWRESTOREFORUM.7z:  9% /418.280Mi, 334.483Ki/s, 19m22s

2022/05/03 12:20:53 INFO  :
Transferred:       38.434 MiB / 418.280 MiB, 9%, 6.960 KiB/s, ETA 15h31m25s
Transferred:            0 / 1, 0%
Elapsed time:       2m0.6s
Transferring:
 *                             NWRESTOREFORUM.7z:  9% /418.280Mi, 6.960Ki/s, 15h31m19s

2022/05/03 12:21:53 INFO  :
Transferred:       38.434 MiB / 418.280 MiB, 9%, 148 B/s, ETA 4w3d1h58m5s
Transferred:            0 / 1, 0%
Elapsed time:       3m0.6s
Transferring:
 *                             NWRESTOREFORUM.7z:  9% /418.280Mi, 148/s, 745h53m38s

2022/05/03 12:22:53 INFO  :
Transferred:       38.434 MiB / 418.280 MiB, 9%, 3 B/s, ETA 4y4w5d14h14m46s
Transferred:            0 / 1, 0%
Elapsed time:       4m0.6s
Transferring:
 *                             NWRESTOREFORUM.7z:  9% /418.280Mi, 3/s, 35842h41m26s

2022/05/03 12:23:53 INFO  :
Transferred:       38.434 MiB / 418.280 MiB, 9%, 0 B/s, ETA 196y33w1d3h12m19s
Transferred:            0 / 1, 0%
Elapsed time:       5m0.6s
Transferring:
 *                             NWRESTOREFORUM.7z:  9% /418.280Mi, 0/s, 1722360h21m2s

2022/05/03 12:24:53 INFO  :
Transferred:       42.871 MiB / 418.280 MiB, 10%, 25.037 KiB/s, ETA 4h15m53s
Transferred:            0 / 1, 0%
Elapsed time:       6m0.6s
Transferring:
 *                             NWRESTOREFORUM.7z: 10% /418.280Mi, 25.038Ki/s, 4h15m53s
 ^C

Please note the latest INFO entry on the log: it is the moment where the whole transfer is actually restarted instead of uploading another chunk. It just was lucky to upload a bit more. On other tries it may had uploaded even less. I think it may be connected to the actual internet speed - "how much data the uplink is able to send before receiving this response 100 Continue".

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
@Evengard Evengard changed the title Rclone fails transfers with some WebDAV servers Rclone fails uploads with some WebDAV servers May 3, 2022
@devnoname120
Copy link
Contributor

Edit: WebDAV is the old API. I don't think that we want to support it. If @ncw agrees then this issue should be closed as “won't do” in favor of #6032.

Just in case we want to revisit this in the future, I left my Yandex WebDAV exploration notes below:


Relevant code:

https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk-example/src/com/yandex/disk/sdk/example/UploadFileFragment.java#L146-L148

https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk/src/com/yandex/disk/client/TransportClient.java#L122-L125

where UPLOAD_NETWORK_TIMEOUT == 300*1000 (source: https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk/src/com/yandex/disk/client/TransportClient.java#L110-L111)

        res.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
        res.getParams().setParameter(CoreProtocolPNames.WAIT_FOR_CONTINUE, timeout);

source: https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk/src/com/yandex/disk/client/TransportClient.java#L185-L186

Activates 'Expect: 100-Continue' handshake for the entity enclosing methods. The purpose of the 'Expect: 100-Continue' handshake to allow a client that is sending a request message with a request body to determine if the origin server is willing to accept the request (based on the request headers) before the client sends the request body.

source: https://hc.apache.org/httpclient-legacy/apidocs/org/apache/commons/httpclient/params/HttpMethodParams.html#USE_EXPECT_CONTINUE

Defines the maximum period of time in milliseconds the client should spend waiting for a 100-continue response.

In our case: timeout == UPLOAD_NETWORK_TIMEOUT == 300*1000 so 300s.

source: https://javadoc.io/static/org.apache.httpcomponents/httpcore/4.4.15/org/apache/http/params/CoreProtocolPNames.html#WAIT_FOR_CONTINUE

then upload file:
https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk/src/com/yandex/disk/client/TransportClient.java#L541-L546

(null is passed to the sha256 function param).

It does a HEAD request before actually doing the PUT:

https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk/src/com/yandex/disk/client/TransportClient.java#L569

see implem of headFile() function here: https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk/src/com/yandex/disk/client/TransportClient.java#L498-L530

If HEAD return a non-0 value of the size that was already uploaded, then it adds a Content-Range header to the headers of the PUT request that it is building: https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk/src/com/yandex/disk/client/TransportClient.java#L584-L589

Unrelated but interesting, here is how the different HTTP error codes are handled: https://github.com/yandex-disk/yandex-disk-sdk-java/blob/bc2e0e50ef7a2ffa11af2439599d0b136474581b/yandex-disk-sdk/src/com/yandex/disk/client/TransportClient.java#L322-L355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants