I experimented further, and as far as I can see the modtimes of the files don't matter its the contents that matter, and in particular we must be overwriting file_v1.bin with file_v2.bin. You can upload file_v1.bin and file_v2.bin on their own just fine, and also overwrite file_v2.bin with file_v1.bin just not the other way round.
Eg
$ rclone delete onedrive:test/1
$ rclone copyto file_v1.bin onedrive:test/1 --retries 1
$ rclone copyto file_v2.bin onedrive:test/1 --retries 1
2023/10/01 12:10:38 ERROR : file_v2.bin: Failed to copy: invalidRequest: Bad Argument
2023/10/01 12:10:38 ERROR : Attempt 1/1 failed with 1 errors and: invalidRequest: Bad Argument
2023/10/01 12:10:38 Failed to copyto: invalidRequest: Bad Argument
$ rclone delete onedrive:test/1
$ rclone copyto file_v2.bin onedrive:test/1 --retries 1
$ rclone copyto file_v1.bin onedrive:test/1 --retries 1
$ rclone copyto file_v2.bin onedrive:test/1 --retries 1
2023/10/01 12:10:59 ERROR : file_v2.bin: Failed to copy: invalidRequest: Bad Argument
2023/10/01 12:10:59 ERROR : Attempt 1/1 failed with 1 errors and: invalidRequest: Bad Argument
2023/10/01 12:10:59 Failed to copyto: invalidRequest: Bad Argument
I thought maybe the files might have the same quickxor hash but they don't. They only differ by one bit, so I guess it makes sense that the quickxor hash only differs by one bit.
I tried to replicate this with onedrive business and it did not replicate. It worked just fine there!
So I can't think this is an rclone bug.
I couldn't find a relevant issue in the onedrive github. I've had good success reporting issues there in the past and getting them fixed. Can we narrow down the exact kind of file that causes this problem?
I couldn't reproduce it when modtime was the same. Caused me a lot of trouble to reproduce on another machine initially because I just cp'ed files and that changed modtime to be about the same. Haha.
Interesting.
Do you mean to try with smaller files with similar structure? I think reporting those example files as-is is fine too.
It's from Time Machine sparsebundle backup image btw. There're a lot of files like that there which are mostly empty (0xFF bytes), then change by few bytes and that cause problem with updating them on OneDrive.