# B2 + Cloudflare - error "directory not found"

**URL:** <https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026>\
**Category:** Help and Support\
**Created:** [March 23, 2021, 9:45pm UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026 "2021-03-23T21:45:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TowerBR](https://forum.rclone.org/user_avatar/forum.rclone.org/towerbr/32/1133_2.png) [@TowerBR](https://forum.rclone.org/u/TowerBR)\
**Post date:** [March 23, 2021, 9:45pm UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/1 "2021-03-23T21:45:13Z")

</div>

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

I'm getting an error when I try to access B2 through Cloudflare. However, when I try to view the same URL / file with curl, it works perfectly:

```auto
curl https://<Cloudlare_DNS_CNAME_URL/file/<bucket>/test.txt

```

#### What is your rclone version (output from `rclone version`)

rclone v1.54.1

#### Which OS you are using and how many bits (eg Windows 7, 64 bit)

Debian 4.19.0-14

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

Backblaze B2

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

```auto
rclone cat --http-url https://<Cloudlare_DNS_CNAME_URL>/file/<bucket>/test.txt :http:

```

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

Calling URL directly in the command, it is not using config file.

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

```auto
ERROR : : error listing: error listing "": directory not found
Failed to cat with 2 errors: last error was: error listing "": directory not found

```

---

<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:** [March 24, 2021, 10:12am UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/2 "2021-03-24T10:12:32Z")

</div>

Hello @TowerBR - nice to see you again 🙂

The http backend requires directory listings to work which don't with the b2 bucket exported via cloudflare.

If you want to use rclone to download a single file you know the name of then use

```
rclone copyurl https://<Cloudlare_DNS_CNAME_URL>/file/<bucket>/test.txt

```

If you want more "syncing" abilities then investigate the [--download-url](https://rclone.org/b2/#b2-download-url) parameter

Hope that helps!

---

<div class="post-metadata">

**Author:** ![TowerBR](https://forum.rclone.org/user_avatar/forum.rclone.org/towerbr/32/1133_2.png) [@TowerBR](https://forum.rclone.org/u/TowerBR)\
**Post date:** [March 24, 2021, 11:28am UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/3 "2021-03-24T11:28:38Z")

</div>

Hello @ncw, Rclone is my daily tool, my real "Swiss army knife of cloud", and sometimes I try to do something "different" and I encounter problems. 🙃

I actually want to copy / move hundreds of GB out of B2, and I would like to avoid download charges.

I've already done some tests with the `--b2-download-url` parameter, but I was afraid if the download was really coming from the custom endpoint.

For example, when testing the command

```auto
rclone lsd <b2_remote_in_config_file>: --b2-download-url=https://<Cloudlare_DNS_CNAME_URL>/file/<bucket>/

```

it returned all buckets (according to the first parameter, where I did not specify buckets, but all storage), and not just the `<bucket>` objects.

How can I check if the downloads really come from the custom endpoint?

---

<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:** [March 24, 2021, 5:11pm UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/4 "2021-03-24T17:11:09Z")

</div>

> [@TowerBR](#):
>
> Hello @ncw, Rclone is my daily tool, my real "Swiss army knife of cloud", and sometimes I try to do something "different" and I encounter problems. 🙃

🙂

> [@TowerBR](#):
>
> I've already done some tests with the `--b2-download-url` parameter, but I was afraid if the download was really coming from the custom endpoint.
> 
> For example, when testing the command
> 
> ```auto
> rclone lsd <b2_remote_in_config_file>: --b2-download-url=https://<Cloudlare_DNS_CNAME_URL>/file/<bucket>/
> 
> ```
> 
> it returned all buckets (according to the first parameter, where I did not specify buckets, but all storage), and not just the `<bucket>` objects.

When you use `--b2-download-url` it uses normal B2 endpoints for all the API stuff but used the cloudflare URL **only** for downloading files.

So what you found above is what I'd expect.

If you want to double check where the downloads come from use `-vv --dump headers` which will show the HTTP headers in use - you can check the downloads from there.

So you want to set up your cloudflare domain [cdn.example.com](http://cdn.example.com) which has a CNAME pointing to [f000.backblazeb2.com](http://f000.backblazeb2.com) (or whaterver the right name is for you)

Then you pass `--b2-download-url https://cdn.example.com`

Interestingly I found a very small bug which made it so you couldn't download HTML files via cloudflare as it strips the Content-Length form the header whch rclone was relying on.

I just merged a fix for that to [the latest beta](https://beta.rclone.org).

---

<div class="post-metadata">

**Author:** ![TowerBR](https://forum.rclone.org/user_avatar/forum.rclone.org/towerbr/32/1133_2.png) [@TowerBR](https://forum.rclone.org/u/TowerBR)\
**Post date:** [March 24, 2021, 8:45pm UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/5 "2021-03-24T20:45:31Z")

</div>

> [@ncw](#):
>
> When you use `--b2-download-url` it uses normal B2 endpoints for all the API stuff but used the cloudflare URL **only** for downloading files.

> [@ncw](#):
>
> If you want to double check where the downloads come from use `-vv --dump headers` which will show the HTTP headers in use - you can check the downloads from there.

Thanks a lot!  
..

---

<div class="post-metadata">

**Author:** ![TowerBR](https://forum.rclone.org/user_avatar/forum.rclone.org/towerbr/32/1133_2.png) [@TowerBR](https://forum.rclone.org/u/TowerBR)\
**Post date:** [March 25, 2021, 12:09am UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/6 "2021-03-25T00:09:28Z")

</div>

Rclone is **the best**! 🤘 🕶

```auto
Transferred: 36.402G / 48.048 GBytes, 76%, 264.796 MBits/s
                                                 ^^^^^^^^^^^^^^^

```

---

<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:** [March 25, 2021, 4:10pm UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/7 "2021-03-25T16:10:23Z")

</div>

Very nice transfer rate! 🙂

---

<div class="post-metadata">

**Author:** ![TowerBR](https://forum.rclone.org/user_avatar/forum.rclone.org/towerbr/32/1133_2.png) [@TowerBR](https://forum.rclone.org/u/TowerBR)\
**Post date:** [March 26, 2021, 12:24pm UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/8 "2021-03-26T12:24:44Z")

</div>

A Google Cloud VM, transferring from B2 to Wasabi. ![speed](https://forum.rclone.org/uploads/default/original/2X/d/d392374bfa4002b7299848c27a44d51da71d444a.png)

---

<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:** [March 29, 2021, 12:24pm UTC](https://forum.rclone.org/t/b2-cloudflare-error-directory-not-found/23026/9 "2021-03-29T12:24:57Z")

</div>

Closed on March 29, 2021, 12:24pm UTC

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