400 bad request error while copying to webdav

What is the problem you are having with rclone?

rclone shows 400 bad request errors while copying a ~40GB file to a webdav instance. Retrials show a different file size from the actual one.

What is your rclone version (output from rclone version)

rclone v1.54.1
- os/arch: linux/amd64
- go version: go1.15.8

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

$ uname -a
Linux lo-login-01 3.10.0-1160.24.1.el7.x86_64 #1 SMP Thu Apr 8 19:51:47 UTC 2021 x86_64 GNU/Linux

Which cloud storage system are you using? (eg Google Drive)

WebDAV-based.

The command you were trying to run (eg rclone copy /tmp remote:tmp)

$ rclone sync models_rf.tar.gz polybox:xaibench_data/ -vv --retries 1

The rclone config contents with secrets removed.

[polybox]
type = webdav
url = xxx
vendor = other
user = xxx
pass = xxx

A log from the command with the -vv flag

$ rclone sync models_rf.tar.gz polybox:xaibench_data/ -vv --retries 1 --progress
2021/05/31 17:18:45 DEBUG : rclone: Version "v1.54.1" starting with parameters ["rclone" "sync" "models_rf.tar.gz" "polybox:xaibench_data/" "-vv" "--retries" "1" "--progress"]
2021/05/31 17:18:45 DEBUG : Creating backend with remote "models_rf.tar.gz"
2021/05/31 17:18:45 DEBUG : Using config file from "/cluster/home/joluna/.config/rclone/rclone.conf"
2021/05/31 17:18:45 DEBUG : fs cache: adding new entry for parent of "models_rf.tar.gz", "/cluster/work/schneider/rethink/jose/xaibench_tf"
2021/05/31 17:18:45 DEBUG : Creating backend with remote "polybox:xaibench_data/"
2021/05/31 17:18:45 DEBUG : fs cache: renaming cache item "polybox:xaibench_data/" to be canonical "polybox:xaibench_data"
2021-05-31 17:18:45 DEBUG : models_rf.tar.gz: Need to transfer - File not found at Destination
Transferred:      119.809M / 44.037 GBytes, 0%, 26.016 MBytes/s, ETA 28m48s
2021-05-31 17:21:57 ERROR : models_rf.tar.gz: Failed to copy: expected filesize 47284029076 got 21421768704: Sabre\DAV\Exception\BadRequest: 400 Bad Request
2021-05-31 17:21:57 ERROR : Attempt 1/1 failed with 1 errors and: expected filesize 47284029076 got 21421768704: Sabre\DAV\Exception\BadRequest: 400 Bad Request
Transferred:       19.972G / 19.972 GBytes, 100%, 106.530 MBytes/s, ETA 0s
Errors:                 1 (retrying may help)
Elapsed time:      3m12.3s
2021/05/31 17:21:57 INFO  : 
Transferred:   	   19.972G / 19.972 GBytes, 100%, 106.530 MBytes/s, ETA 0s
Errors:                 1 (retrying may help)
Elapsed time:      3m12.3s

2021/05/31 17:21:57 DEBUG : 4 go routines active
2021/05/31 17:21:57 Failed to sync: expected filesize 47284029076 got 21421768704: Sabre\DAV\Exception\BadRequest: 400 Bad Request```


Note also that the original file is about ~40GB and not the 19GB that rclone manages to transfer

$ du -h models_rf.tar.gz 
45G	models_rf.tar.gz

hello and welcome to the forum,

best to update rclone and test again.

Dear @asdffdsa

The issue is still reproduced with the latest stable version of rclone on amd64.

$ ./rclone version
rclone v1.55.1
- os/type: linux
- os/arch: amd64
- go/version: go1.16.3
- go/linking: static
- go/tags: none

is this the first time using rclone with webdav?

which webdav server are you using?