Could not copy to Cloudflare R2, get serialization failed error

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

Tried to copy to Cloudflare R2 public bucket, get " operation error S3: HeadObject, serialization failed: serialization failed: input member Key must not be empty"

Here is the version info:

rclone v1.68.0

  • os/version: Microsoft Windows 11 Pro 23H2 (64 bit)
  • os/kernel: 10.0.22631.3880 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.23.1
  • go/linking: static
  • go/tags: cmount

R2 Cloudflare

rclone copy README.txt r2:

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[r2]
type = s3
provider = Cloudflare
access_key_id = XXX
secret_access_key = XXX
endpoint = https://202d9a552b11ed6ea48f880acddac281.r2.cloudflarestorage.com
no_check_bucket = true
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

2024/09/11 10:03:13 DEBUG : rclone: Version "v1.68.0" starting with parameters ["rclone" "copy" "README.txt" "r2:" "-vv"]
2024/09/11 10:03:13 DEBUG : Creating backend with remote "README.txt"
2024/09/11 10:03:13 DEBUG : Using config file from "C:\\Users\\supreme\\AppData\\Roaming\\rclone\\rclone.conf"
2024/09/11 10:03:13 DEBUG : fs cache: adding new entry for parent of "README.txt", "//?/E:/D-SRIVE/cloudflare/rclone-v1.68.0-windows-amd64/rclone-v1.68.0-windows-amd64"
2024/09/11 10:03:13 DEBUG : Creating backend with remote "r2:"
2024/09/11 10:03:13 ERROR : Attempt 1/3 failed with 1 errors and: operation error S3: HeadObject, serialization failed: serialization failed: input member Key must not be empty
2024/09/11 10:03:13 ERROR : Attempt 2/3 failed with 1 errors and: operation error S3: HeadObject, serialization failed: serialization failed: input member Key must not be empty
2024/09/11 10:03:13 ERROR : Attempt 3/3 failed with 1 errors and: operation error S3: HeadObject, serialization failed: serialization failed: input member Key must not be empty
2024/09/11 10:03:13 INFO  :
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         0.0s

2024/09/11 10:03:13 DEBUG : 2 go routines active
2024/09/11 10:03:13 NOTICE: Failed to copy: operation error S3: HeadObject, serialization failed: serialization failed: input member Key must not be empty

welcome to the forum,

R2 is a S3 provider. with other S3 providers, cannot copy to the root.
need to create a bucket and copy files into the bucket.

something like this, just change to nameofbucket to something else.

rclone mkdir r2:nameofbucket -vv
rclone copy README.txt r2:nameofbucket -vv

YEAH! That works. My question is: how to put a file under a specific folder on R2? Thanks

welcome

the rclone syntax is remote:bucket/folder

so try something like this
rclone copy README.txt r2:nameofbucket/nameoffolder -vv

thanks. Another question, can i do rcopy folder/*.doc r2:nameofbucket/nameoffolder ?

There is wildcard * in the source path. THANKS

that syntax works with most copy tools, but not rclone.
need to use a filter such as --include

rclone copy folder r2:bucket/folder --include=*.doc -vv --dry-run

and a handy tip.
filters only apply to the source.

so to test a filter, without the danger of copy/overwriting files.
use rclone ls to list the files.

so something like
rclone ls folder --include=*.doc

Great! I will try that. Is there a way to list all the URLs for all files under a specific folder on R2 ? THANKS SO MUCH

rclone ls will list files.

Yes, it lists the file, but I need the files' URLs. Like "https://...." . THANKS

afiak, rclone only list files using rclone ls
to create a url/link, need to use rclone link

maybe search the forum
https://forum.rclone.org/search?q=Cloudflare+url

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