Cannot Copy to Cloudflare R2 using Copy: Failed to copy: Forbidden status code: 403, request id: , host id:

I am attempting a simple copy from my local linux file system to my R2 bucket. The file I am sending is:
/home/raf/test0.txt. The bucket is called cross.

Here is my rclone install:

Latest

rclone v1.64.0

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.90.1-microsoft-standard-WSL2 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.1
  • go/linking: static
  • go/tags: none
rclone copy /home/raf/test0.txt R2:cross
[R2]
type = s3
provider = Cloudflare
access_key_id = XXX
secret_access_key = XXX
region = auto
endpoint = https://c33fd1ba4dba65fad2f270c15a91f9bb.r2.cloudflarestorage.com/
2023/09/20 03:18:11 DEBUG : rclone: Version "v1.64.0" starting with parameters ["rclone" "copy" "/home/raf/test0.txt" "R2:cross" "-vv"]
2023/09/20 03:18:11 DEBUG : Creating backend with remote "/home/raf/test0.txt"
2023/09/20 03:18:11 DEBUG : Using config file from "/home/raf/.config/rclone/rclone.conf"
2023/09/20 03:18:11 DEBUG : fs cache: adding new entry for parent of "/home/raf/test0.txt", "/home/raf"
2023/09/20 03:18:11 DEBUG : Creating backend with remote "R2:cross"
2023/09/20 03:18:12 DEBUG : Resolving service "s3" region "auto"
2023/09/20 03:18:12 NOTICE: Time may be set wrong - time from "c33fd1ba4dba65fad2f270c15a91f9bb.r2.cloudflarestorage.com" is -36h4m1.90088961s different from this computer
2023/09/20 03:18:12 ERROR : Attempt 1/3 failed with 1 errors and: Forbidden: Forbidden
        status code: 403, request id: , host id:
2023/09/20 03:18:12 ERROR : Attempt 2/3 failed with 1 errors and: Forbidden: Forbidden
        status code: 403, request id: , host id:
2023/09/20 03:18:12 ERROR : Attempt 3/3 failed with 1 errors and: Forbidden: Forbidden
        status code: 403, request id: , host id:
2023/09/20 03:18:12 INFO  :
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         0.1s

2023/09/20 03:18:12 DEBUG : 6 go routines active
2023/09/20 03:18:12 Failed to copy: Forbidden: Forbidden
        status code: 403, request id: , host id:

Any help would be appreciated!

welcome to the forum,

need to check your system.

Can you run rclone lsf R2:cross to list the top contents of the bucket?

If not check your credentials are correct.

I don't think the clock being set wrong will cause a problem here (but it certainly does with oauth based backends). It might do though!

still getting the same:
2023/09/20 03:36:24 NOTICE: Time may be set wrong - time from "c33fd1ba4dba65fad2f270c15a91f9bb.r2.cloudflarestorage.com" is -36h14m18.692217027s different from this computer
2023/09/20 03:36:24 ERROR : : error listing: RequestTimeTooSkewed: The difference between the request time and the server's time is too large.
status code: 403, request id: , host id:
2023/09/20 03:36:24 Failed to lsf with 2 errors: last error was: error in ListJSON: RequestTimeTooSkewed: The difference between the request time and the server's time is too large.
status code: 403, request id: , host id:

in the interactive config I set both times London

rclone doesn't care what region the time is, only that it is correct for that region.

So you need to set the time correct for your computer.

should i set the time with?
sudo hwclock -s
or
sudo ntpdate pool.ntp.org?

i can see the following:
timedatectl status
Local time: Wed 2023-09-20 03:38:29 BST
Universal time: Wed 2023-09-20 02:38:29 UTC
RTC time: Thu 2023-09-21 14:52:38
Time zone: Europe/London (BST, +0100)
System clock synchronized: no

Right now in London it is 3:57pm, so the linux system on my machine seems off

I think sudo hwclock -s is the correct thing.

its working!
thanks!

1 Like

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