How to set retry times when upload local cache to remote

What is the problem you are having with rclone?

how to set retry times when uploading local cache to remote fails due to network or bucket does not exist in remote,I have tried to set --retries but it seems it is not working

Run the command 'rclone version' and share the full output of the command.

rclone v1.62.2

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

Google cloud

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

rclone mount --config rclone.conf myconfig:ablator_example_bucket_0 X: --gcs-bucket-policy-only --network-mode --vfs-cache-mode writes --dir-cache-time 10s --poll-interval 10s --retries 1 -o FileSecurity="D:P(A;;FA;;;WD)

The rclone config contents with secrets removed.

[myconfig]
type = google cloud storage
project_number = 0
service_account_file = 
object_acl = private
bucket_acl = private
location = us
storage_class = STANDARD

A log from the command with the -vv flag

2023/07/07 19:18:13 DEBUG : fff.txt: vfs cache: starting upload
2023/07/07 19:18:14 ERROR : fff.txt: Failed to copy: googleapi: Error 400: Unknown project id: 0, invalid
2023/07/07 19:18:14 ERROR : fff.txt: vfs cache: failed to upload try #2, will retry in 20s: vfs cache: failed to transfer file from cache to remote: googleapi: Error 400: Unknown project id: 0, invalid

It is not configurable at the moment.

rclone starts with 10s retry delay and then on error doubles time of subsequent tries until 5 min is reached. Then will continue retrying every 5 min forever.

failed to upload try #1, will retry in 10s
failed to upload try #2, will retry in 20s
failed to upload try #3, will retry in 40s
failed to upload try #4, will retry in 1m20s
failed to upload try #5, will retry in 2m40s
failed to upload try #6, will retry in 5m0s
failed to upload try #7, will retry in 5m0s
failed to upload try #8, will retry in 5m0s
...
failed to upload try #100, will retry in 5m0s

What is the reason you want to change it?

ty for reply!
I use rclone in my open source project and sometimes users may mistakenly write a wrong bucket name or there are network issues at that time I want to terminate my program and switch to local mode.

So what exactly you would see as ideal solution? what parameter should be configurable?

I dont have a good idea either since I think it might be a reason you dont want to add a configuration for this type of error? Now in my code I am detecting the error output myself so I am just curious if there is an official config for this.

This is the code you should look into:

you can suggest some parametrization of retry and submit PR - I think as long as defaults stay the same you have a big chance for this to be accepted.

thank you, I'll try to look on this

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.