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

Spanner 400 error when updating instance's processing_units #9908

Closed
angelchang opened this issue Aug 25, 2021 · 3 comments · Fixed by GoogleCloudPlatform/magic-modules#5147, hashicorp/terraform-provider-google-beta#3575 or #9933
Assignees
Labels

Comments

@angelchang
Copy link

angelchang commented Aug 25, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.0.5
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v3.81.0

Affected Resource(s)

resource "google_spanner_instance"

Terraform Configuration Files

Eg: on an existing instance with 300 processing units, change processing units

resource "google_spanner_instance" "example" {
  name = "bad-instance"
  config       = "regional-us-central1"
  display_name = "bad instance"
  processing_units    = 100
}

Debug Output

https://gist.github.com/angelchang/09fc19775f9f4a2a1bd70ab2db679470

Expected Behavior

Instance should be updated with processing units = 100

Actual Behavior

400 Error updating Instance "ac-test-sandbox/test-successful-instance": googleapi: Error 400: Invalid UpdateInstance request, Must specify a non-empty field mask

Steps to Reproduce

  1. terraform apply

Investigation

Looks like the provider isn't adding changes to processing_unit to the fieldmask. Made changes here: angelchang@80b1fdc which resolves the issue.

Happy to submit a PR if that looks good.

@angelchang angelchang added the bug label Aug 25, 2021
@megan07 megan07 self-assigned this Aug 25, 2021
@megan07
Copy link
Contributor

megan07 commented Aug 26, 2021

Hi @angelchang ! Thanks for reporting this and suggesting a change! It looks great, however, that file is generated from magic-modules, so you'll want to update it here instead: https://github.com/GoogleCloudPlatform/magic-modules/blob/master/mmv1/templates/terraform/encoders/spanner_instance_update.go.erb

I'll assign this issue to you for now, but let me know if you can't make that change and I can update it there instead. Thanks again!

@angelchang
Copy link
Author

Thanks for the quick review @megan07 !

sserban-us added a commit to cloudspannerecosystem/spanner-terraform-example that referenced this issue Sep 9, 2021
Updating terraform provider version again due to hashicorp/terraform-provider-google#9908. This issue is resolved in the latest version, so it is now possible to scale the instance using terraform with processing units.
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.