# Cannot copy file to Cloudflare R2

**URL:** <https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702>\
**Category:** Suspected Bug\
**Created:** [December 28, 2023, 2:54pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702 "2023-12-28T14:54:27Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyperknot](https://forum.rclone.org/user_avatar/forum.rclone.org/hyperknot/32/2410_2.png) [@hyperknot](https://forum.rclone.org/u/hyperknot)\
**Post date:** [December 28, 2023, 2:54pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/1 "2023-12-28T14:54:27Z")

</div>

#### What is the problem you are having with rclone?

I cannot copy files to R2. Dirs are OK.

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

```auto
rclone v1.65.0
- os/version: darwin 14.2.1 (64 bit)
- os/kernel: 23.2.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.21.4
- go/linking: dynamic
- go/tags: none

```

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

Cloudflare R2

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

```auto
rclone copy \
  -vvv \
  --dump-bodies \
  --retries 1 \
  index.txt cf:ofm-monaco

```

#### The rclone config contents with secrets removed.

```auto
[cf]
type = s3
provider = Cloudflare
access_key_id = xxx
secret_access_key = xxx
endpoint = https://xxx.r2.cloudflarestorage.com

```

#### A log from the command with the `-vv` flag

```auto
2023/12/28 15:51:55 DEBUG : Setting --config "rclone.conf" from environment variable RCLONE_CONFIG="rclone.conf"
2023/12/28 15:51:55 NOTICE: --dump-bodies is obsolete - please use --dump bodies instead
2023/12/28 15:51:55 DEBUG : rclone: Version "v1.65.0" starting with parameters ["rclone" "copy" "-vvv" "--dump-bodies" "--retries" "1" "index.txt" "cf:ofm-monaco"]
2023/12/28 15:51:55 DEBUG : Creating backend with remote "index.txt"
2023/12/28 15:51:55 DEBUG : Using config file from "scripts/tile_gen/rclone.conf"
2023/12/28 15:51:55 DEBUG : fs cache: adding new entry for parent of "index.txt", "scripts/tile_gen"
2023/12/28 15:51:55 DEBUG : Creating backend with remote "cf:ofm-monaco"
2023/12/28 15:51:55 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2023/12/28 15:51:55 DEBUG : Resolving service "s3" region "us-east-1"
2023/12/28 15:51:55 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2023/12/28 15:51:55 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 15:51:55 DEBUG : HTTP REQUEST (req 0x14000952300)
2023/12/28 15:51:55 DEBUG : HEAD /ofm-monaco/index.txt HTTP/1.1
Host: xxx.r2.cloudflarestorage.com
User-Agent: rclone/v1.65.0
Authorization: XXXX
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20231228T145155Z

2023/12/28 15:51:55 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 15:51:55 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 15:51:55 DEBUG : HTTP RESPONSE (req 0x14000952300)
2023/12/28 15:51:55 DEBUG : HTTP/1.1 404 Not Found
Connection: close
Cf-Ray: 83ca9fc67df4c2e1-VIE
Connection: keep-alive
Content-Type: text/plain;charset=UTF-8
Date: Thu, 28 Dec 2023 14:51:55 GMT
Server: cloudflare

2023/12/28 15:51:55 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 15:51:55 DEBUG : index.txt: Need to transfer - File not found at Destination
2023/12/28 15:51:55 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 15:51:55 DEBUG : HTTP REQUEST (req 0x14000b20500)
2023/12/28 15:51:55 DEBUG : PUT /ofm-monaco HTTP/1.1
Host: xxx.r2.cloudflarestorage.com
User-Agent: rclone/v1.65.0
Content-Length: 0
Authorization: XXXX
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20231228T145155Z
Accept-Encoding: gzip

2023/12/28 15:51:55 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 15:51:55 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 15:51:55 DEBUG : HTTP RESPONSE (req 0x14000b20500)
2023/12/28 15:51:55 DEBUG : HTTP/1.1 403 Forbidden
Transfer-Encoding: chunked
Cf-Ray: 83ca9fc73f2dc2e1-VIE
Connection: keep-alive
Content-Type: application/xml
Date: Thu, 28 Dec 2023 14:51:55 GMT
Server: cloudflare
Vary: Accept-Encoding

6e
<?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access Denied</Message></Error>
0

2023/12/28 15:51:55 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 15:51:55 ERROR : index.txt: Failed to copy: failed to prepare upload: AccessDenied: Access Denied
	status code: 403, request id: , host id: 
2023/12/28 15:51:55 ERROR : Attempt 1/1 failed with 1 errors and: failed to prepare upload: AccessDenied: Access Denied
	status code: 403, request id: , host id: 
2023/12/28 15:51:55 INFO : 
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.2s

2023/12/28 15:51:55 DEBUG : 9 go routines active
2023/12/28 15:51:55 Failed to copy: failed to prepare upload: AccessDenied: Access Denied
	status code: 403, request id: , host id: 

```

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 28, 2023, 3:00pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/2 "2023-12-28T15:00:56Z")

</div>

hi,  
rclone tries to upload the file and gets `AccessDenied` from R2.  
what do you expect rclone to do?

`rclone ls cf:ofm-monaco -vv`  
does that command work?

---

<div class="post-metadata">

**Author:** ![hyperknot](https://forum.rclone.org/user_avatar/forum.rclone.org/hyperknot/32/2410_2.png) [@hyperknot](https://forum.rclone.org/u/hyperknot)\
**Post date:** [December 28, 2023, 3:23pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/3 "2023-12-28T15:23:55Z")

</div>

The same command can upload directories perfectly.

I suspect this is the bug

```auto
PUT /ofm-monaco HTTP/1.1

```

It's trying to put into the bucket, not into the bucket/file

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 28, 2023, 4:02pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/4 "2023-12-28T16:02:19Z")

</div>

> [@hyperknot](#):
>
> I suspect this is the bug  
> `PUT /ofm-monaco HTTP/1.1`

that should be default rclone behaviour, checking if the bucket exists.  
perhaps, if needed, to create the bucket.

if that `PUT` had worked, then the next `PUT` should be  
`PUT /ofm-monaco/index.txt`

so might try `--s3-no-check-bucket`  
fwiw, the way i locked down buckets using s3 policies, i have to use `--s3-no-check-bucket`.

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 28, 2023, 4:28pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/5 "2023-12-28T16:28:07Z")

</div>

maybe this is the issue?  
[If you are using a token with Object-level permissions, you will need to add no\_check\_bucket = true to the configuration to avoid errors.](https://developers.cloudflare.com/r2/examples/rclone/)

---

<div class="post-metadata">

**Author:** ![hyperknot](https://forum.rclone.org/user_avatar/forum.rclone.org/hyperknot/32/2410_2.png) [@hyperknot](https://forum.rclone.org/u/hyperknot)\
**Post date:** [December 28, 2023, 5:10pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/6 "2023-12-28T17:10:32Z")

</div>

Yes, that one was it. Had to add

```auto
no_check_bucket = true

```

to my config.

But then why does it work with directories? I guess there is definitely a way to improve this behavior, if I'm uploading a file to a bucket like:

```auto
rclone copy myfile cf:ofm-monaco/abc/def

```

Then I definitely don't want to create a bucket, but copy a file into a folder.

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 28, 2023, 5:24pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/7 "2023-12-28T17:24:30Z")

</div>

> [@hyperknot](#):
>
> But then why does it work with directories?

i did a few tests using clouldflare r2, was able to upload a file without using `no_check_bucket`  
so i am not able to replicate your issue.

---

<div class="post-metadata">

**Author:** ![hyperknot](https://forum.rclone.org/user_avatar/forum.rclone.org/hyperknot/32/2410_2.png) [@hyperknot](https://forum.rclone.org/u/hyperknot)\
**Post date:** [December 28, 2023, 5:43pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/8 "2023-12-28T17:43:43Z")

</div>

Do you have a Admin or Object token? This one is with an Object token.

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 28, 2023, 5:46pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/9 "2023-12-28T17:46:58Z")

</div>

"Object Read & Write: Allows the ability to read, write, and list objects in specific buckets."

---

<div class="post-metadata">

**Author:** ![hyperknot](https://forum.rclone.org/user_avatar/forum.rclone.org/hyperknot/32/2410_2.png) [@hyperknot](https://forum.rclone.org/u/hyperknot)\
**Post date:** [December 28, 2023, 5:56pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/10 "2023-12-28T17:56:19Z")

</div>

Yes, I have the same permissions. Still, it doesn't work without `no_check_bucket = true`

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 28, 2023, 5:59pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/11 "2023-12-28T17:59:59Z")

</div>

> [@hyperknot](#):
>
> it doesn't work without `no_check_bucket = true`

as i mentioned, most of the s3 remotes i use from multiple providers, i must use that flag.

that is a commone issue in the forum, should not be a problem, for example,  
[in that case, idrive is using a policy that has been locked down.](https://forum.rclone.org/t/idrive-s3-upload-fails-with-keys-without-deletion-access-permission/42908/2)

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [December 28, 2023, 6:05pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/12 "2023-12-28T18:05:06Z")

</div>

> [@hyperknot](#):
>
> ```auto
> rclone copy myfile cf:ofm-monaco/abc/def
> 
> ```
> 
> Then I definitely don't want to create a bucket, but copy a file into a folder.

This is not the most clever `rclone` behaviour. Not sure what is the history of such approach - without `--s3-no-check-bucket` rclone always tries to create bucket regardless if it exist or not. And if permissions do not allow buckets' creation, `rclone` command fails even when bucket exist.

`aws cli` (sort of golden standard of S3 access tools) works in such situations without any issues - more logical I think. Such AccessDenied errors could be ignored by rclone maybe... as @ncw suggested in the thread mentioned by @asdffdsa

---

<div class="post-metadata">

**Author:** ![hyperknot](https://forum.rclone.org/user_avatar/forum.rclone.org/hyperknot/32/2410_2.png) [@hyperknot](https://forum.rclone.org/u/hyperknot)\
**Post date:** [December 28, 2023, 6:07pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/13 "2023-12-28T18:07:32Z")

</div>

The strange thing is that it works perfectly for directory sync or copy. So even after many years of using rclone, this really puzzled me, as why would it work perfectly on directories but not on files?

The strange thing is that at this point: `HEAD /ofm-monaco/index.txt` it perfectly knows that I want to copy a file inside a bucket. Then later on, it tries to create the bucket... 🙃

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [December 28, 2023, 6:17pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/14 "2023-12-28T18:17:20Z")

</div>

I am sure there is old legacy story behind it. And legacy things usually last forever:) Should not be very difficult to change it if somebody feels like doing it.

> [@hyperknot](#):
>
> ```auto
> 2023/12/28 15:51:55 ERROR : index.txt: Failed to copy: failed to prepare upload: AccessDenied: Access Denied
> status code: 403, request id: , host id: 
> 
> ```

Does not help that this error message is completely misleading in this case. Maybe it would be enough to replace it with something more clear.

Or maybe `no_check_bucket` should be true by default? It would be very easy to change.

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 28, 2023, 6:23pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/15 "2023-12-28T18:23:30Z")

</div>

> [@hyperknot](#):
>
> The strange thing is that at this point: `HEAD /ofm-monaco/index.txt` it perfectly knows that I want to copy a file inside a bucket

well, not sure that is correct.  
at that point, rclone has no idea if the object named `/ofm-monaco/index.txt` exists or not.  
and then cloudlare returns `404 Not Found`, so still, rclone does not know about `/ofm-monaco/index.txt`

> [@hyperknot](#):
>
> The strange thing is that it works perfectly for directory sync or copy. So even after many years of using rclone, this really puzzled me, as why would it work perfectly on directories but not on files?

in your case, the source is a file, but what about the dest, is the dest a file or a dir?

* * *

try `rclone copyto`, as in that case, rclone knows the dest is a file, not a dir.

and maybe, this can be seen in the [(https://github.com/rclone/rclone/blob/8503282a5adffc992e1834eed2cd8aeca57c01dd/cmd/copy/copy.go#L94](https://github.com/rclone/rclone/blob/8503282a5adffc992e1834eed2cd8aeca57c01dd/cmd/copy/copy.go#L94)

```auto
		if srcFileName == "" {
				return sync.CopyDir(context.Background(), fdst, fsrc, createEmptySrcDirs)
			}
			return operations.CopyFile(context.Background(), fdst, fsrc, srcFileName, srcFileName)

```

[https://github.com/rclone/rclone/blob/8503282a5adffc992e1834eed2cd8aeca57c01dd/cmd/copyto/copyto.go#L57](https://github.com/rclone/rclone/blob/8503282a5adffc992e1834eed2cd8aeca57c01dd/cmd/copyto/copyto.go#L57)

```auto
			if srcFileName == "" {
				return sync.CopyDir(context.Background(), fdst, fsrc, false)
			}
			return operations.CopyFile(context.Background(), fdst, fsrc, dstFileName, srcFileName)

```

---

<div class="post-metadata">

**Author:** ![hyperknot](https://forum.rclone.org/user_avatar/forum.rclone.org/hyperknot/32/2410_2.png) [@hyperknot](https://forum.rclone.org/u/hyperknot)\
**Post date:** [December 28, 2023, 6:31pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/16 "2023-12-28T18:31:35Z")

</div>

Here is the full log when I run the dir copy, without specifying `no_check_bucket`:

```auto
rclone copy -vvv --dump-bodies --retries 1 test_dir cf:ofm-monaco

```

It makes absolutely no sense that this works perfectly, yet the file returns 6 Access Denied errors across the screen.

```auto
2023/12/28 19:29:13 DEBUG : Setting --config "rclone.conf" from environment variable RCLONE_CONFIG="rclone.conf"
2023/12/28 19:29:13 NOTICE: --dump-bodies is obsolete - please use --dump bodies instead
2023/12/28 19:29:13 DEBUG : rclone: Version "v1.65.0" starting with parameters ["rclone" "copy" "-vvv" "--dump-bodies" "--retries" "1" "test_dir" "cf:ofm-monaco"]
2023/12/28 19:29:13 DEBUG : Creating backend with remote "test_dir"
2023/12/28 19:29:13 DEBUG : Using config file from "config/rclone.conf"
2023/12/28 19:29:13 DEBUG : fs cache: renaming cache item "test_dir" to be canonical "config/test_dir"
2023/12/28 19:29:13 DEBUG : Creating backend with remote "cf:ofm-monaco"
2023/12/28 19:29:13 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2023/12/28 19:29:13 DEBUG : Resolving service "s3" region "us-east-1"
2023/12/28 19:29:13 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2023/12/28 19:29:13 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 19:29:13 DEBUG : HTTP REQUEST (req 0x140008bc600)
2023/12/28 19:29:13 DEBUG : GET /ofm-monaco?delimiter=%2F&encoding-type=url&list-type=2&max-keys=1000&prefix= HTTP/1.1
Host: xxx.r2.cloudflarestorage.com
User-Agent: rclone/v1.65.0
Authorization: XXXX
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20231228T182913Z
Accept-Encoding: gzip

2023/12/28 19:29:13 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 19:29:13 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 19:29:13 DEBUG : HTTP RESPONSE (req 0x140008bc600)
2023/12/28 19:29:13 DEBUG : HTTP/1.1 200 OK
Transfer-Encoding: chunked
Cf-Ray: 83cbde190fb7c240-VIE
Connection: keep-alive
Content-Type: application/xml
Date: Thu, 28 Dec 2023 18:29:13 GMT
Server: cloudflare
Vary: Accept-Encoding

34e
<?xml version="1.0" encoding="UTF-8"?><ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>ofm-monaco</Name><Contents><Key>dirs.txt</Key><Size>38</Size><LastModified>2023-12-28T16:50:22.109Z</LastModified><ETag>&quot;2e7c6e31109c75e6af4586f6447d3df6&quot;</ETag><StorageClass>STANDARD</StorageClass></Contents><Contents><Key>index.txt</Key><Size>326</Size><LastModified>2023-12-28T16:50:22.136Z</LastModified><ETag>&quot;e2f8fbdcf90d204bc059f4c34e9b63cf&quot;</ETag><StorageClass>STANDARD</StorageClass></Contents><IsTruncated>false</IsTruncated><CommonPrefixes><Prefix>20231228_161128_pt%2F</Prefix></CommonPrefixes><CommonPrefixes><Prefix>20231228_174729_pt%2F</Prefix></CommonPrefixes><Prefix></Prefix><Delimiter>%2F</Delimiter><MaxKeys>1000</MaxKeys><KeyCount>4</KeyCount><EncodingType>url</EncodingType></ListBucketResult>
0

2023/12/28 19:29:13 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 19:29:13 DEBUG : test_file: Need to transfer - File not found at Destination
2023/12/28 19:29:13 DEBUG : S3 bucket ofm-monaco: Waiting for checks to finish
2023/12/28 19:29:13 DEBUG : S3 bucket ofm-monaco: Waiting for transfers to finish
2023/12/28 19:29:13 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 19:29:13 DEBUG : HTTP REQUEST (req 0x14000b14300)
2023/12/28 19:29:13 DEBUG : PUT /ofm-monaco/test_file HTTP/1.1
Host: xxx.r2.cloudflarestorage.com
User-Agent: rclone/v1.65.0
Content-Length: 0
Authorization: XXXX
Content-Md5: 1B2M2Y8AsgTpgAmY7PhCfg==
Content-Type: application/octet-stream
X-Amz-Content-Sha256: UNSIGNED-PAYLOAD
X-Amz-Date: 20231228T182913Z
X-Amz-Meta-Mtime: 1703788098.597589757
Accept-Encoding: gzip

2023/12/28 19:29:13 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 19:29:14 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 19:29:14 DEBUG : HTTP RESPONSE (req 0x14000b14300)
2023/12/28 19:29:14 DEBUG : HTTP/1.1 200 OK
Content-Length: 0
Cf-Ray: 83cbde1a193dc240-VIE
Connection: keep-alive
Content-Type: text/plain;charset=UTF-8
Date: Thu, 28 Dec 2023 18:29:14 GMT
Etag: "d41d8cd98f00b204e9800998ecf8427e"
Server: cloudflare
Vary: Accept-Encoding
X-Amz-Version-Id: 7e734e4ff359554a0aaff4dc9006ead0

2023/12/28 19:29:14 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 19:29:14 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 19:29:14 DEBUG : HTTP REQUEST (req 0x14000b82300)
2023/12/28 19:29:14 DEBUG : HEAD /ofm-monaco/test_file HTTP/1.1
Host: xxx.r2.cloudflarestorage.com
User-Agent: rclone/v1.65.0
Authorization: XXXX
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20231228T182914Z

2023/12/28 19:29:14 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2023/12/28 19:29:14 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 19:29:14 DEBUG : HTTP RESPONSE (req 0x14000b82300)
2023/12/28 19:29:14 DEBUG : HTTP/1.1 200 OK
Accept-Ranges: bytes
Cf-Ray: 83cbde1b7befc240-VIE
Connection: keep-alive
Content-Type: application/octet-stream
Date: Thu, 28 Dec 2023 18:29:14 GMT
Etag: "d41d8cd98f00b204e9800998ecf8427e"
Last-Modified: Thu, 28 Dec 2023 18:29:14 GMT
Server: cloudflare
X-Amz-Meta-Mtime: 1703788098.597589757
Content-Length: 0

2023/12/28 19:29:14 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2023/12/28 19:29:14 DEBUG : test_file: md5 = d41d8cd98f00b204e9800998ecf8427e OK
2023/12/28 19:29:14 INFO : test_file: Copied (new)
2023/12/28 19:29:14 INFO : 
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Transferred: 1 / 1, 100%
Elapsed time: 0.5s

2023/12/28 19:29:14 DEBUG : 8 go routines active

```

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [December 28, 2023, 6:39pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/17 "2023-12-28T18:39:37Z")

</div>

> [@hyperknot](#):
>
> It makes absolutely no sense that this works perfectly

as i understand it, in that case, the source is a bucket/dir, so the dest must be a bucket/dir.  
so rclone tries to get a list of files in the dest.

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [January 27, 2024, 6:39pm UTC](https://forum.rclone.org/t/cannot-copy-file-to-cloudflare-r2/43702/18 "2024-01-27T18:39:38Z")

</div>

Closed on January 27, 2024, 6:39pm UTC

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