Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to Cloudflare R2 owing to lack of ability to change region #16377

Closed
seanvelasco opened this issue Sep 24, 2024 · 4 comments · Fixed by #16473
Closed

Unable to connect to Cloudflare R2 owing to lack of ability to change region #16377

seanvelasco opened this issue Sep 24, 2024 · 4 comments · Fixed by #16473
Assignees
Labels
s3 AWS S3 Protocol Implementation
Milestone

Comments

@seanvelasco
Copy link

Describe the bug
I'm trying to connect to an R2 bucket with Cyberduck using the Cloudflare R2 profile. However, I'm greeted with the following error:

The region name 'ap-southeast-1' is not valid. Must be one of: wnam, enam, weur, eeur, apac, auto. Please contact your web hosting service provider for assistance.

When I open the Cyberduck's settings (Settings > S3 > Default Bucket Location), I can change the region, and I can confirm the change is reflected, however the options enam, weur, eeur, apac, auto are not available.

To Reproduce
Steps to reproduce the behavior:

  1. Install Cloudflare R2 profile
  2. Use Cloudflare R2 bucket credentials and add bucket name as path
  3. Attempt to establish connection
  4. The above error is shown

Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • OS: MacOS 15.0 (24A335)
  • Version 9.0.2 (42108)

Additional context
When connecting using boto3, the same error is shown when using "auto", "ap-southeast", or any other regions other than enam, weur, eeur, apac, auto. In my case, when I used apac instead of ap-southeast, the error disappeared. So I believe the ability to change the region in the client will fix the issue.

@dkocher dkocher self-assigned this Sep 24, 2024
@dkocher
Copy link
Contributor

dkocher commented Sep 24, 2024

I cannot reproduce. What region is the bucket in you are testing with?

@seanvelasco
Copy link
Author

hi, the region i set when i created the bucket was Asia-Pacific (APAC) or apac. in the Cyberduck client, the region in the S3 settings is set to Asia Pacific (Singapore) or ap-southeast-1.

i think the error is thrown when the region is not one of these enam, weur, eeur, apac, auto.

alternatively, can i change the region in my Cyberduck? when inspecting the .cyberduckprofile XML file, i found these options

<key>Regions</key>
        <array>
            <string>wnam</string>
            <string>enam</string>
            <string>weur</string>
            <string>eeur</string>
            <string>apac</string>
        </array>

but i couldn't find these options in the Cyberduck client at all. i just found these:
image

@mojopollo
Copy link

mojopollo commented Oct 29, 2024

@dkocher I am also getting this exact issue when creating a new connection profile using the "Cloudflare R2 Storage (S3)" profile with mac version 9.0.4, 9.0.2, 9.0.1
image

Cloudflare R2 uses the following regions
https://docs.cyberduck.io/protocols/s3/cloudflare/

APAC (Asia Pacific)
EEUR (Eastern Europe)
ENAM (Eastern North America)
WEUR (Western Europe)
WNAM (Western North America)

But Cyberduck is defaulting to the AWS S3 region specified here instead:
image

If I change the default bucket location from "US West Oregon" to "US West (Northern California)" , the error appears with "us-west-1" not being a valid region.

I cannot set the default bucket location to WNAM which is where my bucket is.

Also worth nothing, I had previous Cloudflare connection setup some months ago using the "Cloudflare R2 Storage (S3)" profile, that old connection setting can connect just fine to cloudflare R2 and I can even duplicate that connection and use that as a template for any new buckets I want to connect to and it works.

@dkocher dkocher added the s3 AWS S3 Protocol Implementation label Oct 30, 2024
@dkocher dkocher added this to the 9.1 milestone Oct 31, 2024
@dkocher
Copy link
Contributor

dkocher commented Oct 31, 2024

I can confirm this issue. When you have previously successfully connected to a single bucket with the default region in Preferences → S3 set to us-east-1, the location returned from the ?location query for the bucket will be persisted in the bookmark.

The issue here occurs because the Cloudflare R2 profile is missing a Region override 1.

For S3, this value is used for AWS4 signatures when no location can be deferred from the URI for third-party S3 providers.

Footnotes

  1. https://docs.cyberduck.io/protocols/profiles/#technical-file-format-specification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s3 AWS S3 Protocol Implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants