-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Error when provision read replica with binary log enabled #12148
Comments
@muhammadaldyan can you post the terraform config and gcloud command you used so I can repro the issue? |
main.txt gcloud command : gcloud sql instances patch --enable-bin-log db-replica-1 |
@muhammadaldyan I am curious why you want to update the config via gcloud command (step 2)? Was the error from creating the replica instance? What is the config for your master? Are you aware of the requirement [here]?(https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance#master_instance_name)
Can you try update the master with below config first to see if your issue can be resolved?
|
I can confirm that this happens on any change of the settings for the We upgraded from provider 4.14 to 4.30, but we also tried lower versions from 4.25 up to 4.30, all them have the same issue. My solution was to add a Plan # google_sql_database_instance.recruitment-1-ro-1 will be updated in-place
~ resource "google_sql_database_instance" "recruitment-1-ro-1" {
id = "recruitment-1-ro-1"
name = "recruitment-1-ro-1"
# (13 unchanged attributes hidden)
~ settings {
# (10 unchanged attributes hidden)
- active_directory_config {}
# (5 unchanged blocks hidden)
}
# (2 unchanged blocks hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
╷ This is what solved for us (workaround) lifecycle {
ignore_changes = [
settings["active_directory_config"]
]
} |
@muhammadaldyan any change in below statement, which one as an example? In your case, there is a change here that might be related to yours
|
@muhammadaldyan is this still an issue? |
Closing assuming this is no longer an issue |
Hello @edwardmedia , that is still happening, I did not replied because you where not asking me about it. I can get a new output if you need.. |
@edwardmedia yes it's still an issue. and this is not working. i used MySQL 5.7 (Cloudsql GCP) |
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. |
I used this module to provision my cloudsql https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance
│ Error: Error, failed to update instance settings for : googleapi: Error 400: Invalid request: Binary log must be disabled when backup is disabled or the instance must be a replica instance with a MySQL 5.7 or above version., invalid
│
│ with module.mysql.google_sql_database_instance.replicas[0],
│ on ../../../../modules/google-cloud-sql/mysql/read_replica.tf line 39, in resource "google_sql_database_instance" "replicas":
│ 39: resource "google_sql_database_instance" "replicas" {
│
╵
this issue related to : #9371
i tried using version 3.75.0 and latest version and error still on there.
also tried to create case support on GCP.
and this is he said :
I have been looking into this matter by attempting to reproduce the behavior you encounter, and I have been able to see the same error message you’re retrieving from executing your Terraform script.
Based on the verbose logs you provided, as well as the findings from the Cloud SQL Product Team, we were able to ascertain that the issue is present on Terraform, as it does not include the “instanceType” parameter which is required in order for the operation to succeed, as this can only be performed for instances of type "READ_REPLICA_INSTANCE", or for instances with binary log disabled.
Given that this issue is caused by the Terraform provider making the API request, I suggest that you open an issue with the Terraform Team in their official GitHub repository 1 so that they may fix this issue in order to include the required “instanceType” parameter.
Alternatively, the Terraform team could switch from using the “PUT” method, which uses the instance.update method 2, to the “PATCH” method, which uses the instances.patch method 3. The latter automatically populates the fields that aren’t included within the request body, and should not cause the error message you’re encountering when the “instanceType” parameter is missing.
The text was updated successfully, but these errors were encountered: