Repository: rclone/rclone (language: go)

Issue:
uloz.to: Failed to copy: json: cannot unmarshal number 3162270108 into Go struct field SendFilePayloadResponse.size of type int
<!--

We understand you are having a problem with rclone; we want to help you with that!

**STOP and READ**
**YOUR POST WILL BE REMOVED IF IT IS LOW QUALITY**:
Please show the effort you've put into solving the problem and please be specific.
People are volunteering their time to help! Low effort posts are not likely to get good answers!

If you think you might have found a bug, try to replicate it with the latest beta (or stable).
The update instructions are available at https://rclone.org/commands/rclone_selfupdate/

If you can still replicate it or just got a question then please use the rclone forum:

    https://forum.rclone.org/

for a quick response instead of filing an issue on this repo.

If nothing else helps, then please fill in the info below which helps us help you.

**DO NOT REDACT** any information except passwords/keys/personal info.

You should use 3 backticks to begin and end your paste to make it readable.

Make sure to include a log obtained with '-vv'.

You can also use '-vv --log-file bug.log' and a service such as https://pastebin.com or https://gist.github.com/

Thank you

The Rclone Developers

-->

#### The associated forum post URL from `https://forum.rclone.org`
I'm sorry, I can't post on the forums because I never received the activation e-mail.


#### What is the problem you are having with rclone?
I'm trying to upload a file to uloz.to but I'm getting this error message:
```
2024/07/19 10:23:46 ERROR : borgbackup.tar.gz: Failed to copy: json: cannot unmarshal number 3162270108 into Go struct field SendFilePayloadResponse.size of type int
2024/07/19 10:23:46 ERROR : Attempt 1/3 failed with 1 errors and: json: cannot unmarshal number 3162270108 into Go struct field SendFilePayloadResponse.size of type int
2024/07/19 10:59:16 ERROR : borgbackup.tar.gz: Failed to copy: json: cannot unmarshal number 3162270108 into Go struct field SendFilePayloadResponse.size of type int
2024/07/19 10:59:16 ERROR : Attempt 2/3 failed with 1 errors and: json: cannot unmarshal number 3162270108 into Go struct field SendFilePayloadResponse.size of type int
2024/07/19 10:59:17 ERROR : Attempt 3/3 failed with 1 errors and: couldn't list files: Error 0 (403)
2024/07/19 10:59:17 Failed to copyto: couldn't list files: Error 0 (403)
```


#### What is your rclone version (output from `rclone version`)
```
rclone v1.67.0
- os/version: raspbian 12.1
- os/kernel: 6.1.21+ (armv6l)
- os/type: linux
- os/arch: arm (ARMv6 compatible)
- go/version: go1.22.4
- go/linking: static
- go/tags: none
```

#### Which OS you are using and how many bits (e.g. Windows 7, 64 bit)

raspbian 12.1, ARMv6, 32 bit.

#### Which cloud storage system are you using? (e.g. Google Drive)
uloz.to


#### The command you were trying to run (e.g. `rclone copy /tmp remote:tmp`)
```
 rclone copyto ./borgbackup.tar.gz ulozto:borgbackup/borgbackup_$(date +"%y_%m_%d").tar.gz
```

#### A log from the command with the `-vv` flag (e.g. output from `rclone -vv copy /tmp remote:tmp`)
```
$ rclone -vv copyto ./borgbackup.tar.gz ulozto:borgbackup/borgbackup_$(date +"%y_%m_%d").tar.gz
2024/07/19 11:03:45 DEBUG : rclone: Version "v1.67.0" starting with parameters ["rclone" "-vv" "copyto" "./borgbackup.tar.gz" "ulozto:borgbackup/borgbackup_24_07_19.tar.gz"]
2024/07/19 11:03:45 DEBUG : Creating backend with remote "./borgbackup.tar.gz"
2024/07/19 11:03:45 DEBUG : Using config file from "/home/pi/.config/rclone/rclone.conf"
2024/07/19 11:03:45 DEBUG : fs cache: adding new entry for parent of "./borgbackup.tar.gz", "/home/pi"
2024/07/19 11:03:45 DEBUG : Creating backend with remote "ulozto:borgbackup/"
2024/07/19 11:03:48 DEBUG : fs cache: renaming cache item "ulozto:borgbackup/" to be canonical "ulozto:borgbackup"
2024/07/19 11:03:49 DEBUG : borgbackup.tar.gz: Need to transfer - File not found at Destination
2024/07/19 11:04:48 INFO  : 
Transferred:   	   82.434 MiB / 2.945 GiB, 3%, 1.406 MiB/s, ETA 34m45s
Transferred:            0 / 1, 0%
Elapsed time:       1m3.4s
Transferring:
 *                             borgbackup.tar.gz:  2% /2.945Gi, 1.407Mi/s, 34m44s

2024/07/19 11:05:48 INFO  : 
Transferred:   	  168.496 MiB / 2.945 GiB, 6%, 1.446 MiB/s, ETA 32m49s
Transferred:            0 / 1, 0%
Elapsed time:       2m3.4s
Transferring:
 *                             borgbackup.tar.gz:  5% /2.945Gi, 1.445Mi/s, 32m50s

2024/07/19 11:06:48 INFO  : 
Transferred:   	  254.871 MiB / 2.945 GiB, 8%, 1.439 MiB/s, ETA 31m59s
Transferred:            0 / 1, 0%
Elapsed time:       3m3.4s
Transferring:
 *                             borgbackup.tar.gz:  8% /2.945Gi, 1.440Mi/s, 31m57s

2024/07/19 11:07:48 INFO  : 
Transferred:   	  341.684 MiB / 2.945 GiB, 11%, 1.469 MiB/s, ETA 30m20s
Transferred:            0 / 1, 0%
Elapsed time:       4m3.4s
Transferring:
 *                             borgbackup.tar.gz: 11% /2.945Gi, 1.468Mi/s, 30m21s

2024/07/19 11:08:48 INFO  : 
Transferred:   	  427.840 MiB / 2.945 GiB, 14%, 1.438 MiB/s, ETA 29m59s
Transferred:            0 / 1, 0%
Elapsed time:       5m3.4s
Transferring:
 *                             borgbackup.tar.gz: 14% /2.945Gi, 1.439Mi/s, 29m58s

2024/07/19 11:09:48 INFO  : 
Transferred:   	  512.902 MiB / 2.945 GiB, 17%, 1.428 MiB/s, ETA 29m12s
Transferred:            0 / 1, 0%
Elapsed time:       6m3.4s
Transferring:
 *                             borgbackup.tar.gz: 17% /2.945Gi, 1.427Mi/s, 29m14s

2024/07/19 11:10:48 INFO  : 
Transferred:   	  599.059 MiB / 2.945 GiB, 20%, 1.435 MiB/s, ETA 28m4s
Transferred:            0 / 1, 0%
Elapsed time:       7m3.4s
Transferring:
 *                             borgbackup.tar.gz: 19% /2.945Gi, 1.434Mi/s, 28m5s

2024/07/19 11:11:48 INFO  : 
Transferred:   	  685.215 MiB / 2.945 GiB, 23%, 1.455 MiB/s, ETA 26m41s
Transferred:            0 / 1, 0%
Elapsed time:       8m3.4s
Transferring:
 *                             borgbackup.tar.gz: 22% /2.945Gi, 1.456Mi/s, 26m40s

2024/07/19 11:12:48 INFO  : 
Transferred:   	  771.934 MiB / 2.945 GiB, 26%, 1.444 MiB/s, ETA 25m53s
Transferred:            0 / 1, 0%
Elapsed time:       9m3.4s
Transferring:
 *                             borgbackup.tar.gz: 25% /2.945Gi, 1.447Mi/s, 25m50s

2024/07/19 11:13:48 INFO  : 
Transferred:   	  858.277 MiB / 2.945 GiB, 28%, 1.453 MiB/s, ETA 24m44s
Transferred:            0 / 1, 0%
Elapsed time:      10m3.4s
Transferring:
 *                             borgbackup.tar.gz: 28% /2.945Gi, 1.452Mi/s, 24m45s

2024/07/19 11:14:48 INFO  : 
Transferred:   	  942.965 MiB / 2.945 GiB, 31%, 1.409 MiB/s, ETA 24m31s
Transferred:            0 / 1, 0%
Elapsed time:      11m3.4s
Transferring:
 *                             borgbackup.tar.gz: 31% /2.945Gi, 1.408Mi/s, 24m32s

2024/07/19 11:15:48 INFO  : 
Transferred:   	    1.004 GiB / 2.945 GiB, 34%, 1.441 MiB/s, ETA 22m59s
Transferred:            0 / 1, 0%
Elapsed time:      12m3.4s
Transferring:
 *                             borgbackup.tar.gz: 34% /2.945Gi, 1.441Mi/s, 22m59s

2024/07/19 11:16:48 INFO  : 
Transferred:   	    1.088 GiB / 2.945 GiB, 37%, 1.438 MiB/s, ETA 22m2s
Transferred:            0 / 1, 0%
Elapsed time:      13m3.4s
Transferring:
 *                             borgbackup.tar.gz: 36% /2.945Gi, 1.439Mi/s, 22m1s

2024/07/19 11:17:48 INFO  : 
Transferred:   	    1.173 GiB / 2.945 GiB, 40%, 1.468 MiB/s, ETA 20m36s
Transferred:            0 / 1, 0%
Elapsed time:      14m3.4s
Transferring:
 *                             borgbackup.tar.gz: 39% /2.945Gi, 1.468Mi/s, 20m35s

2024/07/19 11:18:48 INFO  : 
Transferred:   	    1.256 GiB / 2.945 GiB, 43%, 1.426 MiB/s, ETA 20m12s
Transferred:            0 / 1, 0%
Elapsed time:      15m3.4s
Transferring:
 *                             borgbackup.tar.gz: 42% /2.945Gi, 1.427Mi/s, 20m11s

2024/07/19 11:19:48 INFO  : 
Transferred:   	    1.341 GiB / 2.945 GiB, 46%, 1.455 MiB/s, ETA 18m48s
Transferred:            0 / 1, 0%
Elapsed time:      16m3.4s
Transferring:
 *                             borgbackup.tar.gz: 45% /2.945Gi, 1.454Mi/s, 18m49s

2024/07/19 11:20:48 INFO  : 
Transferred:   	    1.422 GiB / 2.945 GiB, 48%, 1.423 MiB/s, ETA 18m16s
Transferred:            0 / 1, 0%
Elapsed time:      17m3.4s
Transferring:
 *                             borgbackup.tar.gz: 48% /2.945Gi, 1.423Mi/s, 18m15s

2024/07/19 11:21:48 INFO  : 
Transferred:   	    1.506 GiB / 2.945 GiB, 51%, 1.450 MiB/s, ETA 16m56s
Transferred:            0 / 1, 0%
Elapsed time:      18m3.4s
Transferring:
 *                             borgbackup.tar.gz: 51% /2.945Gi, 1.448Mi/s, 16m57s

2024/07/19 11:22:48 INFO  : 
Transferred:   	    1.591 GiB / 2.945 GiB, 54%, 1.440 MiB/s, ETA 16m3s
Transferred:            0 / 1, 0%
Elapsed time:      19m3.4s
Transferring:
 *                             borgbackup.tar.gz: 54% /2.945Gi, 1.441Mi/s, 16m2s

2024/07/19 11:23:48 INFO  : 
Transferred:   	    1.676 GiB / 2.945 GiB, 57%, 1.470 MiB/s, ETA 14m44s
Transferred:            0 / 1, 0%
Elapsed time:      20m3.4s
Transferring:
 *                             borgbackup.tar.gz: 56% /2.945Gi, 1.471Mi/s, 14m43s

2024/07/19 11:24:48 INFO  : 
Transferred:   	    1.759 GiB / 2.945 GiB, 60%, 1.427 MiB/s, ETA 14m10s
Transferred:            0 / 1, 0%
Elapsed time:      21m3.4s
Transferring:
 *                             borgbackup.tar.gz: 59% /2.945Gi, 1.426Mi/s, 14m11s

2024/07/19 11:25:48 INFO  : 
Transferred:   	    1.844 GiB / 2.945 GiB, 63%, 1.462 MiB/s, ETA 12m51s
Transferred:            0 / 1, 0%
Elapsed time:      22m3.4s
Transferring:
 *                             borgbackup.tar.gz: 62% /2.945Gi, 1.463Mi/s, 12m50s

2024/07/19 11:26:48 INFO  : 
Transferred:   	    1.928 GiB / 2.945 GiB, 65%, 1.438 MiB/s, ETA 12m4s
Transferred:            0 / 1, 0%
Elapsed time:      23m3.4s
Transferring:
 *                             borgbackup.tar.gz: 65% /2.945Gi, 1.437Mi/s, 12m4s

2024/07/19 11:27:48 INFO  : 
Transferred:   	    2.013 GiB / 2.945 GiB, 68%, 1.476 MiB/s, ETA 10m46s
Transferred:            0 / 1, 0%
Elapsed time:      24m3.4s
Transferring:
 *                             borgbackup.tar.gz: 68% /2.945Gi, 1.477Mi/s, 10m46s

2024/07/19 11:28:48 INFO  : 
Transferred:   	    2.097 GiB / 2.945 GiB, 71%, 1.445 MiB/s, ETA 10m
Transferred:            0 / 1, 0%
Elapsed time:      25m3.4s
Transferring:
 *                             borgbackup.tar.gz: 71% /2.945Gi, 1.444Mi/s, 10m1s

2024/07/19 11:29:48 INFO  : 
Transferred:   	    2.182 GiB / 2.945 GiB, 74%, 1.465 MiB/s, ETA 8m53s
Transferred:            0 / 1, 0%
Elapsed time:      26m3.4s
Transferring:
 *                             borgbackup.tar.gz: 74% /2.945Gi, 1.466Mi/s, 8m53s

2024/07/19 11:30:48 INFO  : 
Transferred:   	    2.245 GiB / 2.945 GiB, 76%, 1.186 MiB/s, ETA 10m4s
Transferred:            0 / 1, 0%
Elapsed time:      27m3.4s
Transferring:
 *                             borgbackup.tar.gz: 76% /2.945Gi, 1.184Mi/s, 10m5s

2024/07/19 11:31:48 INFO  : 
Transferred:   	    2.329 GiB / 2.945 GiB, 79%, 1.453 MiB/s, ETA 7m13s
Transferred:            0 / 1, 0%
Elapsed time:      28m3.4s
Transferring:
 *                             borgbackup.tar.gz: 79% /2.945Gi, 1.454Mi/s, 7m13s

2024/07/19 11:32:48 INFO  : 
Transferred:   	    2.413 GiB / 2.945 GiB, 82%, 1.419 MiB/s, ETA 6m23s
Transferred:            0 / 1, 0%
Elapsed time:      29m3.4s
Transferring:
 *                             borgbackup.tar.gz: 81% /2.945Gi, 1.420Mi/s, 6m23s

2024/07/19 11:33:48 INFO  : 
Transferred:   	    2.498 GiB / 2.945 GiB, 85%, 1.459 MiB/s, ETA 5m13s
Transferred:            0 / 1, 0%
Elapsed time:      30m3.4s
Transferring:
 *                             borgbackup.tar.gz: 84% /2.945Gi, 1.460Mi/s, 5m13s

2024/07/19 11:34:48 INFO  : 
Transferred:   	    2.581 GiB / 2.945 GiB, 88%, 1.416 MiB/s, ETA 4m23s
Transferred:            0 / 1, 0%
Elapsed time:      31m3.4s
Transferring:
 *                             borgbackup.tar.gz: 87% /2.945Gi, 1.417Mi/s, 4m22s

2024/07/19 11:35:48 INFO  : 
Transferred:   	    2.666 GiB / 2.945 GiB, 91%, 1.470 MiB/s, ETA 3m14s
Transferred:            0 / 1, 0%
Elapsed time:      32m3.4s
Transferring:
 *                             borgbackup.tar.gz: 90% /2.945Gi, 1.471Mi/s, 3m13s

2024/07/19 11:36:48 INFO  : 
Transferred:   	    2.751 GiB / 2.945 GiB, 93%, 1.446 MiB/s, ETA 2m17s
Transferred:            0 / 1, 0%
Elapsed time:      33m3.4s
Transferring:
 *                             borgbackup.tar.gz: 93% /2.945Gi, 1.447Mi/s, 2m17s

2024/07/19 11:37:48 INFO  : 
Transferred:   	    2.835 GiB / 2.945 GiB, 96%, 1.452 MiB/s, ETA 1m17s
Transferred:            0 / 1, 0%
Elapsed time:      34m3.4s
Transferring:
 *                             borgbackup.tar.gz: 96% /2.945Gi, 1.451Mi/s, 1m17s

2024/07/19 11:38:48 INFO  : 
Transferred:   	    2.920 GiB / 2.945 GiB, 99%, 1.434 MiB/s, ETA 18s
Transferred:            0 / 1, 0%
Elapsed time:      35m3.4s
Transferring:
 *                             borgbackup.tar.gz: 99% /2.945Gi, 1.435Mi/s, 18s

2024/07/19 11:39:10 ERROR : borgbackup.tar.gz: Failed to copy: json: cannot unmarshal number 3162270108 into Go struct field SendFilePayloadResponse.size of type int
```


<!--- Please keep the note below for others who read your bug report. -->

#### How to use GitHub

* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) 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.



Discussion / hints:
Looks like that value should be an int64 not an int if you want to have a go at a fix (I'm travelling right now)

Fix patch:
diff --git a/backend/ulozto/api/types.go b/backend/ulozto/api/types.go
index 8266fbc2d834f..e45abcf822fa1 100644
--- a/backend/ulozto/api/types.go
+++ b/backend/ulozto/api/types.go
@@ -163,7 +163,7 @@ type BatchUpdateFilePropertiesRequest struct {
 // SendFilePayloadResponse represents the JSON API object that's received
 // in response to uploading a file's body to the CDN URL.
 type SendFilePayloadResponse struct {
-	Size        int    `json:"size"`
+	Size        int64  `json:"size"`
 	ContentType string `json:"contentType"`
 	Md5         string `json:"md5"`
 	Message     string `json:"message"`


Test patch: