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

maintenance_window of google_sql_database_instance replica is stuck - not changing / updating / refreshing #7422

Closed
syedrakib opened this issue Oct 4, 2020 · 6 comments

Comments

@syedrakib
Copy link

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 v0.12.29
  • provider.google v3.41.0
  • provider.google-beta v3.41.0

Affected Resource(s)

google_sql_database_instance

The issue:

My current TF state file shows the following for my Google CloudSQL Replica instance.

    maintenance_window: []

My new TF configuration for my Google CloudSQL Replica instance is

maintenance_window {
  day          = 1
  hour         = 23
  update_track = "canary"
}

✅ My TF Plan reads fine:

+ maintenance_window {
    + day          = 1
    + hour         = 23
    + update_track = "canary"
  }

Plan: 0 to add, 1 to change, 0 to destroy.

❌ I run terraform apply. I get the following error

Error: Error, failed to update instance settings for : googleapi: Error 400: Invalid request: Cannot update maintenance window for replica instances., invalid

❌ Meaning, the operation failed and nothing should've changed. But when i check my TF state file, i see that it has changed

"maintenance_window": [
  {
    "day": 1,
    "hour": 23,
    "update_track": "canary"
  }
]

The state file shouldn't have changed since the terraform apply had failed.

Now, when i run the terraform plan, it produces the same unaltered plan as before.

+ maintenance_window {
    + day          = 1
    + hour         = 23
    + update_track = "canary"
  }

Plan: 0 to add, 1 to change, 0 to destroy.

❓ I am not able to move beyond this. My CloudSQL ReadReplica is constantly producing this same plan and I am constantly getting a 400 error when trying to terraform apply. Hence, i can't proceed.

I also tried to set the maintenance_window of the instance manually from the GCP console. However, GCP doesn't even provide any interface to modify maintenance_window for ReadReplica instances - which is why the 400 error in the first place.


Looking for help here. Using latest 0.12.x version of Terraform 0.12.29, and latest version of google provider 3.41.0

@ghost ghost added the bug label Oct 4, 2020
@syedrakib syedrakib changed the title Stuck maintenance_window of google_sql_database_instance replica instance - not changing, not updating, not refreshing maintenance_window of google_sql_database_instance replica is stuck - not changing / updating, / refreshing Oct 4, 2020
@syedrakib syedrakib changed the title maintenance_window of google_sql_database_instance replica is stuck - not changing / updating, / refreshing maintenance_window of google_sql_database_instance replica is stuck - not changing / updating / refreshing Oct 4, 2020
@edwardmedia edwardmedia self-assigned this Oct 5, 2020
@edwardmedia edwardmedia added question and removed bug labels Oct 5, 2020
@edwardmedia
Copy link
Contributor

@syedrakib can you post your config and the steps to reach the issue?

@syedrakib
Copy link
Author

I used the v3.2.0 of the terraform-google-sql-db / mysql module for my work. It is these lines that are causing the issue.

Please note that, even though its providers.tf file says it uses terraform = "~> 0.12.6" and google = "~> 3.5", i am actually using the latest terraform 0.12.x version v0.12.29 and passing the latest google-provider version v3.41.0 to this module.


The fact that running terraform apply caused the state file to change even though it failed with a 400 error from google is the concerning part. That should be handled by the provider correctly, right?

@ghost ghost removed waiting-response labels Oct 5, 2020
@edwardmedia
Copy link
Contributor

edwardmedia commented Oct 6, 2020

@syedrakib instead of module, can you run a single instance by removing unrelated field? Please provide the full debug log, if the problem still occurs.

@edwardmedia
Copy link
Contributor

@syedrakib is this still an issue?

@edwardmedia
Copy link
Contributor

@syedrakib closing this as no response received. Please retested by separating the provider code from the module. Feel free to reopen it if the issue can be reproed.

@ghost
Copy link

ghost commented Nov 11, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants