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

cloudflare_r2_bucket produced an unexpected new value #3131

Open
2 tasks done
Ramblurr opened this issue Feb 20, 2024 · 5 comments
Open
2 tasks done

cloudflare_r2_bucket produced an unexpected new value #3131

Ramblurr opened this issue Feb 20, 2024 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.

Comments

@Ramblurr
Copy link

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.7.1-dev
on linux_amd64

  • provider registry.terraform.io/1password/onepassword v1.4.1
  • provider registry.terraform.io/aminueza/minio v2.0.1
  • provider registry.terraform.io/carlpett/sops v1.0.0
  • provider registry.terraform.io/cloudflare/cloudflare v4.24.0
  • provider registry.terraform.io/hashicorp/random v3.6.0

Affected resource(s)

cloudflare_r2_bucket

Terraform configuration files

resource "cloudflare_r2_bucket" "main" {
  account_id = var.cloudflare_account_id
  name       = var.bucket_name
  location   = "weur"
}

Link to debug output

https://gist.github.com/Ramblurr/cc599be39f51eb532e88fd72627f886b

Panic output

No response

Expected output

It should not fail with This is a bug in the provider, which should be reported in the provider's own issue tracker.

Actual output

The first time I ran this I got:

│ Error: failed to create R2 bucket
│ 
│   with module.volsync_bucket["volsync-calibre"].module.r2_bucket[0].cloudflare_r2_bucket.main,
│   on modules/r2-bucket/main.tf line 1, in resource "cloudflare_r2_bucket" "main":
│    1: resource "cloudflare_r2_bucket" "main" {
│ 
│ Please enable R2 through the Cloudflare Dashboard. (10042)

Then I enabled R2 in the account via the Dashboard.

Then I ran the terraform again:

module.volsync_bucket["volsync-calibre"].module.r2_bucket[0].cloudflare_r2_bucket.main: Creating...
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to module.volsync_bucket["volsync-calibre-web"].module.r2_bucket[0].cloudflare_r2_bucket.main, provider "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" produced an unexpected new value:
│ .location: was cty.StringVal("weur"), but now cty.StringVal("WEUR").
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Steps to reproduce

  1. try to create a bucket (with a location hint set) without R2 enabled on the account
  2. after failure, enable R2 on the account
  3. try to create the bucket again

Additional factoids

No response

References

No response

@Ramblurr Ramblurr added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 20, 2024
Copy link
Contributor

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Feb 20, 2024
@savelichalex
Copy link

The issue either connected to location property or it being weur, since when I commented it out the issue was gone

@sbaildon
Copy link

sbaildon commented Mar 1, 2024

Looks like a case sensitivity issue; setting location to WEUR — not weur —  solves the inconsistency

@Ramblurr
Copy link
Author

Ramblurr commented Mar 2, 2024

In the error you can see it show the value in lower and uppercase.

But to be clear I never wrote it upper case. And I didn't change the terraform between steps 1 and 3.

@sbaildon
Copy link

sbaildon commented Mar 2, 2024

In the error you can see it show the value in lower and uppercase.

But to be clear I never wrote it upper case. And I didn't change the terraform between steps 1 and 3.

Yeah — documentation says to use weur in your manifests, but the the provider uses WEUR internally, with case-sensitive matching. Using WEUR in your manifest will sidestep the issue for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Projects
None yet
Development

No branches or pull requests

3 participants