I use rclone remote control API (https://rclone.org/rc/), sometimes meet error

What is the problem you are having with rclone?

I use rclone remote control API to sync files and folders, using nginx proxy to expose the service,
sometimes will meet context canceled error.

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

rclone v1.62.2

  • os/version: ubuntu 18.04 (64 bit)
  • os/kernel: 5.4.0-1093-gcp (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.20.2
  • go/linking: static
  • go/tags: none

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

aliyun to backblaze and google storage and cloudflare r2

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

I use rest api, list below
https://rclone.org/rc/#sync-copy
https://rclone.org/rc/#operations-copyfile
with "_async": False

The rclone config contents with secrets removed.

Current remotes:

Name                 Type
====                 ====
alabs                b2
aliyun-remote        s3
blackblaze-remote    b2
blackblaze-remote-2  b2
cloudflare-remote-baby009 s3
cloudflare-remote-bsg010 s3
cloudflare-remote-crosspromo s3
cloudflare-remote-loho001 s3
cloudflare-remote-salon009 s3
cloudflare-remote-toca004 s3
cloudflare-remote-toca008 s3
cloudflare-remote-vpink008 s3
color                drive
google-remote        google cloud storage
hangzhou-aliyun-remote s3
new-aliyun-remote    s3
new_color            drive
remote               google cloud storage
s3                   s3

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config

A log from the command with the -vv flag

2023/06/28 16:18:52 ERROR : ui: error reading source directory: RequestCanceled: request context canceled
caused by: context canceled
2023/06/28 16:18:52 ERROR : rc: "sync/copy": error: RequestCanceled: request context canceled
caused by: context canceled
2023/06/28 16:28:31 ERROR : model/hairgirl/2/6.png: Failed to copy: Post "https://pod-000-1127-19.backblaze.com/b2api/v1/b2_upload_file/f50689e68f47b574891e0510/c002_v0001127_t0001": context canceled
2023/06/28 16:28:31 ERROR : model/hairgirl/2/1.png: Failed to copy: Post "https://pod-000-1114-14.backblaze.com/b2api/v1/b2_upload_file/f50689e68f47b574891e0510/c002_v0001114_t0034": context canceled
2023/06/28 16:28:31 ERROR : model/biaoqing/4/0.png: Failed to copy: Post "https://pod-000-1162-02.backblaze.com/b2api/v1/b2_upload_file/f50689e68f47b574891e0510/c002_v0001162_t0052": context canceled
2023/06/28 16:28:31 ERROR : model/hairboy/2/6.png: Failed to copy: Post "https://pod-000-1118-02.backblaze.com/b2api/v1/b2_upload_file/f50689e68f47b574891e0510/c002_v0001118_t0057": context canceled
2023/06/28 16:28:31 ERROR : rc: "sync/copy": error: Post "https://pod-000-1118-02.backblaze.com/b2api/v1/b2_upload_file/f50689e68f47b574891e0510/c002_v0001118_t0057": context canceled

Try running the same with "_async": True

Because as per documentation:

It is recommended that potentially long running jobs, e.g. sync/sync, sync/copy, sync/move, operations/purge are run with the _async flag to avoid any potential problems with the HTTP request and response timing out.

as your error RequestCanceled: request context canceled indicate exactly this issue.

but how to get the status of the async job.
job/status command, if delays, will miss the result, get response as "job not found".
I frequently send job/status command, sometimes still meet above error.

By default you can read status for 60s after job finishes. If it is not enough you can use --rc-job-expire-duration flag and set it to whatever is convenient for you e.g.:

--rc-job-expire-duration 5m

1 Like

hi, thanks a lot.

1 Like

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