Rclone with R2 copy from local to bucket return 403 Access Denied

Hi,

I have a newbie question.I am following the instructions from the Configure rclone for R2 example in the R2 document.

It works for everything except copy from local to the bucket.

rclone -vv copy test.py r2demo:web
<7>DEBUG : rclone: Version “v1.59.0” starting with parameters [“rclone” “-vv” “copy” “test.py” “r2demo:web”]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Creating backend with remote “test.py”
<7>DEBUG : Using config file from “/home/wksung/.config/rclone/rclone.conf”
<7>DEBUG : fs cache: adding new entry for parent of “test.py”, “/home/wksung/test/cf/test”
<7>DEBUG : Creating backend with remote “r2demo:web”
<7>DEBUG : test.py: Need to transfer - File not found at Destination
<3>ERROR : test.py: Failed to copy: AccessDenied: Access Denied
status code: 403, request id: , host id:

Transferred: 3.287 KiB / 3.287 KiB, 100%, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 1.5s

<7>DEBUG : 6 go routines active
Failed to copy: AccessDenied: Access Denied
status code: 403, request id: , host id:

If I upload the same test.py from the R2 dashboard, it works using rclone to copy from the bucket to local. I was wondering I miss any configuration. My rclone.conf is almost exactly liked the one in the example.

Thanks so much for your help!

Regards,

waikong

I found my problem for the rclone for copying from local to a R2 bucket It was the API key only with Read permission:

Read: Allow only the retrieval of all objects and List operations of all buckets

After I created a new API token with the Edit permission:

Edit: Allow edit access of all objects and List, Write, and Delete operations of all buckets

Now I am able to use rclone to copy from local to R2 bucket.

2 Likes