# Not encrypting or compressing before upload

**URL:** <https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261>\
**Category:** Help and Support\
**Created:** [August 5, 2022, 12:20am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261 "2022-08-05T00:20:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![234u5h3l4kj5h4k5b](https://forum.rclone.org/letter_avatar_proxy/v4/letter/2/b487fb/32.png) [@234u5h3l4kj5h4k5b](https://forum.rclone.org/u/234u5h3l4kj5h4k5b)\
**Post date:** [August 5, 2022, 12:20am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/1 "2022-08-05T00:20:31Z")

</div>

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

I created remote `Cloudflare:bucket`. Then I created a `crypt` remote for `Cloudflare:bucket`. I also created a `compress` remote for `Cloudflare:bucket`. I am able to `copy` to `Cloudflare:bucket` just fine, but the files are not being compressed or encrypted. I even tried deleting the `compress` remote and leaving just the `crypt` remote. No avail.

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

```auto
rclone v1.59.0
- os/version: Microsoft Windows 10 Pro 21H2 (64 bit)
- os/kernel: 10.0.19044.1865 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.18.3
- go/linking: static
- go/tags: cmount

```

#### 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 --config=/path/to/rclone.conf copy --verbose /path/to/local/folder/1.PNG Cloudflare:bucket

```

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

```auto
[Cloudflare]
type = s3
provider = Cloudflare
access_key_id = *redacted*
secret_access_key = *redacted*
region = auto
endpoint = *redacted*

[EncryptCloudflare]
type = crypt
remote = Cloudflare:bucket
password = *redacted*
password2 = *redacted*

[CompressCloudflare]
type = compress
remote = Cloudflare:bucket

```

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

```auto
2022/08/04 20:13:32 DEBUG : rclone: Version "v1.59.0" starting with parameters ["path\\to\\rclone.exe" "--config=path\\to\\rclone.conf" "copy" "-vv" "path\\to\\1.PNG" "Cloudflare:bucket"]
2022/08/04 20:13:32 DEBUG : Creating backend with remote "path\\to\\1.PNG"
2022/08/04 20:13:32 DEBUG : Using config file from "path\\to\\rclone.conf"
2022/08/04 20:13:32 DEBUG : fs cache: adding new entry for parent of "path\\to\\1.PNG", "//?/path/to/folder"
2022/08/04 20:13:32 DEBUG : Creating backend with remote "Cloudflare:bucket"
2022/08/04 20:13:32 DEBUG : 1.PNG: Need to transfer - File not found at Destination
2022/08/04 20:13:34 DEBUG : 1.PNG: md5 = *redacted* OK
2022/08/04 20:13:34 INFO : 1.PNG: Copied (new)
2022/08/04 20:13:34 INFO :
Transferred: 147.395 KiB / 147.395 KiB, 100%, 145.918 KiB/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 1.9s

2022/08/04 20:13:34 DEBUG : 5 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:** [August 5, 2022, 12:32am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/2 "2022-08-05T00:32:58Z")

</div>

hi,

if you want the files to be crypted, need to copy to `EncryptCloudflare:`  
`rclone copy /path/to/local/folder/1.PNG EncryptCloudflare:`

if you want the files to be compressed, need to copy to `CompressCloudflare:`  
`rclone copy /path/to/local/folder/1.PNG CompressCloudflare:`

note: about `remote = Cloudflare:bucket`  
you are using that in two remotes, not sure that is good idea.

---

<div class="post-metadata">

**Author:** ![234u5h3l4kj5h4k5b](https://forum.rclone.org/letter_avatar_proxy/v4/letter/2/b487fb/32.png) [@234u5h3l4kj5h4k5b](https://forum.rclone.org/u/234u5h3l4kj5h4k5b)\
**Post date:** [August 5, 2022, 12:43am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/3 "2022-08-05T00:43:19Z")

</div>

Oh. My bad.

So it is not possible to compress and encrypt both? Could I point `CompressCloudflare` to `EncryptCloudflare` to `Cloudflare: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:** [August 5, 2022, 12:45am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/4 "2022-08-05T00:45:31Z")

</div>

yes, you can do that with rclone.

not sure which is better  
`CompressCloudflare -> EncryptCloudflare -> Cloudflare:bucket`  
or  
`EncryptCloudflare -> CompressCloudflare -> Cloudflare:bucket`

---

<div class="post-metadata">

**Author:** ![234u5h3l4kj5h4k5b](https://forum.rclone.org/letter_avatar_proxy/v4/letter/2/b487fb/32.png) [@234u5h3l4kj5h4k5b](https://forum.rclone.org/u/234u5h3l4kj5h4k5b)\
**Post date:** [August 5, 2022, 1:19am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/5 "2022-08-05T01:19:51Z")

</div>

Thanks.

I just tested it and `Cloudflare:bucket` -\> `EncryptCloudflare` -\> `CompressCloudflare` does not work. `Cloudflare:bucket` -\> `CompressCloudflare` -\> `EncryptCloudflare` works.

---

<div class="post-metadata">

**Author:** ![234u5h3l4kj5h4k5b](https://forum.rclone.org/letter_avatar_proxy/v4/letter/2/b487fb/32.png) [@234u5h3l4kj5h4k5b](https://forum.rclone.org/u/234u5h3l4kj5h4k5b)\
**Post date:** [August 5, 2022, 1:25am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/6 "2022-08-05T01:25:43Z")

</div>

I take that back. Neither works. `Cloudflare:bucket` -\> `EncryptCloudflare` -\> `CompressCloudflare` throws an MD5 error and does not upload anything. `Cloudflare:bucket` -\> `CompressCloudflare` -\> `EncryptCloudflare` uploads the file just fine, but it looks like the file is encrypted but not compressed.

Oh well.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [August 5, 2022, 8:56am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/7 "2022-08-05T08:56:14Z")

</div>

> [@234u5h3l4kj5h4k5b](#):
>
> I take that back. Neither works. `Cloudflare:bucket` -\> `EncryptCloudflare` -\> `CompressCloudflare` throws an MD5 error and does not upload anything.

I would say this is the correct order.

What is the error?

---

<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:** [August 5, 2022, 12:31pm UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/8 "2022-08-05T12:31:27Z")

</div>

can you run a command that copies a single file, that will generate the exact error?  
add -`vv` to the command for debug output and post the full debug log

---

<div class="post-metadata">

**Author:** ![234u5h3l4kj5h4k5b](https://forum.rclone.org/letter_avatar_proxy/v4/letter/2/b487fb/32.png) [@234u5h3l4kj5h4k5b](https://forum.rclone.org/u/234u5h3l4kj5h4k5b)\
**Post date:** [August 5, 2022, 2:20pm UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/9 "2022-08-05T14:20:59Z")

</div>

> [@ncw](#):
>
> > [@234u5h3l4kj5h4k5b](#):
> >
> > I take that back. Neither works. `Cloudflare:bucket` -\> `EncryptCloudflare` -\> `CompressCloudflare` throws an MD5 error and does not upload anything.
> 
> I would say this is the correct order.
> 
> What is the error?

I will have to set it up again to get the exact error/log, but the error was basically saying that the MD5 hash of the upload did not match the source file. It tried the upload three times and then failed.

---

<div class="post-metadata">

**Author:** ![Animosity022](https://forum.rclone.org/user_avatar/forum.rclone.org/animosity022/32/451_2.png) [@Animosity022](https://forum.rclone.org/u/Animosity022)\
**Post date:** [August 5, 2022, 2:35pm UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/10 "2022-08-05T14:35:14Z")

</div>

You'd want to share your rclone.conf that you adjusted and the full command with a debug log.

---

<div class="post-metadata">

**Author:** ![234u5h3l4kj5h4k5b](https://forum.rclone.org/letter_avatar_proxy/v4/letter/2/b487fb/32.png) [@234u5h3l4kj5h4k5b](https://forum.rclone.org/u/234u5h3l4kj5h4k5b)\
**Post date:** [August 6, 2022, 3:26am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/11 "2022-08-06T03:26:56Z")

</div>

Here is the error log:

```auto
C:\Users\[name]>"rclone.exe" --config="rclone.conf" copy -vv "1.PNG" CompressCloudflare:
2022/08/05 23:21:39 DEBUG : rclone: Version "v1.59.0" starting with parameters ["rclone.exe" "--config=rclone.conf" "copy" "-vv" "1.PNG" "CompressCloudflare:"]
2022/08/05 23:21:39 DEBUG : Creating backend with remote "1.PNG"
2022/08/05 23:21:39 DEBUG : Using config file from "rclone.conf"
2022/08/05 23:21:39 DEBUG : fs cache: adding new entry for parent of "1.PNG", "//?/C:/Users/..."
2022/08/05 23:21:39 DEBUG : Creating backend with remote "CompressCloudflare:"
2022/08/05 23:21:39 DEBUG : Creating backend with remote "Cloudflare:bucket/string"
2022/08/05 23:21:39 DEBUG : Creating backend with remote "Cloudflare:bucket"
2022/08/05 23:21:40 DEBUG : 1.PNG: Need to transfer - File not found at Destination
2022/08/05 23:21:41 DEBUG : 1.PNG.lE0CAAAAAAA.gz: md5 = e5f97b00b2ec77694d2c1b3a55c58658 OK
2022/08/05 23:21:41 DEBUG : 1.PNG: Computing md5 hash of encrypted source
2022/08/05 23:21:42 ERROR : 1.PNG: Failed to copy: BadDigest: The Content-MD5 you specified did not match what we received.
        status code: 400, request id: , host id:
2022/08/05 23:21:42 ERROR : Attempt 1/3 failed with 1 errors and: BadDigest: The Content-MD5 you specified did not match what we received.
        status code: 400, request id: , host id:
2022/08/05 23:21:42 DEBUG : 1.PNG: Need to transfer - File not found at Destination
2022/08/05 23:21:42 DEBUG : 1.PNG.lE0CAAAAAAA.gz: md5 = 292ebc8c1e5ca00fd1e79e0812070ca3 OK
2022/08/05 23:21:42 DEBUG : 1.PNG: Computing md5 hash of encrypted source
2022/08/05 23:21:43 ERROR : 1.PNG: Failed to copy: BadDigest: The Content-MD5 you specified did not match what we received.
        status code: 400, request id: , host id:
2022/08/05 23:21:43 ERROR : Attempt 2/3 failed with 1 errors and: BadDigest: The Content-MD5 you specified did not match what we received.
        status code: 400, request id: , host id:
2022/08/05 23:21:43 DEBUG : 1.PNG: Need to transfer - File not found at Destination
2022/08/05 23:21:43 DEBUG : 1.PNG.lE0CAAAAAAA.gz: md5 = 0ef7e272fd0c429abffe28dad89244ea OK
2022/08/05 23:21:43 DEBUG : 1.PNG: Computing md5 hash of encrypted source
2022/08/05 23:21:44 ERROR : 1.PNG: Failed to copy: BadDigest: The Content-MD5 you specified did not match what we received.
        status code: 400, request id: , host id:
2022/08/05 23:21:44 ERROR : Attempt 3/3 failed with 1 errors and: BadDigest: The Content-MD5 you specified did not match what we received.
        status code: 400, request id: , host id:
2022/08/05 23:21:44 INFO :
Transferred: 393.721 KiB / 393.721 KiB, 100%, 86.905 KiB/s, ETA 0s
Errors: 1 (retrying may help)
Elapsed time: 4.9s

2022/08/05 23:21:44 DEBUG : 7 go routines active
2022/08/05 23:21:44 Failed to copy: BadDigest: The Content-MD5 you specified did not match what we received.
        status code: 400, request id: , host id:

```

Here is my rclone.conf

```auto
[Cloudflare]
type = s3
provider = Cloudflare
access_key_id = *redacted*
secret_access_key = *redacted*
region = auto
endpoint = *redacted*

[EncryptCloudflare]
type = crypt
remote = Cloudflare:bucket
password = *redacted*
password2 = *redacted*

[CompressCloudflare]
type = compress
remote = EncryptCloudflare:

```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [August 6, 2022, 3:38pm UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/13 "2022-08-06T15:38:47Z")

</div>

> [@234u5h3l4kj5h4k5b](#):
>
> ```auto
> 2022/08/05 23:21:42 ERROR : 1.PNG: Failed to copy: BadDigest: The Content-MD5 you specified did not match what we received.
> 
> ```

That turned out to be a bug which I've had a go at fixing here if you want to give it a test.

[v1.60.0-beta.6409.699b49456.fix-crypt-unwrap](https://beta.rclone.org/branch/fix-crypt-unwrap/v1.60.0-beta.6409.699b49456.fix-crypt-unwrap/) on branch [fix-crypt-unwrap](https://github.com/rclone/rclone/tree/fix-crypt-unwrap) (uploaded in 15-30 mins)

---

<div class="post-metadata">

**Author:** ![234u5h3l4kj5h4k5b](https://forum.rclone.org/letter_avatar_proxy/v4/letter/2/b487fb/32.png) [@234u5h3l4kj5h4k5b](https://forum.rclone.org/u/234u5h3l4kj5h4k5b)\
**Post date:** [August 7, 2022, 3:35am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/14 "2022-08-07T03:35:06Z")

</div>

Unfortunately I am not in a position to test a beta version. However, I will for sure give this a go when v1.60 is released! Thank you for tackling this so quickly. Amazing.

---

<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:** [August 10, 2022, 3:35am UTC](https://forum.rclone.org/t/not-encrypting-or-compressing-before-upload/32261/15 "2022-08-10T03:35:21Z")

</div>

Closed on August 10, 2022, 3:35am UTC

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