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

Project Name not set on Google Cloud SQL Database #233

Closed
arhea opened this issue Jul 24, 2017 · 7 comments
Closed

Project Name not set on Google Cloud SQL Database #233

arhea opened this issue Jul 24, 2017 · 7 comments
Assignees
Labels

Comments

@arhea
Copy link

arhea commented Jul 24, 2017

Terraform Version

0.10.0-rc1

Affected Resource(s)

Please list the resources as a list, for example:

  • google_sql_database

Terraform Configuration Files

resource "google_sql_database" "mydb" {
  depends_on = [
    "null_resource.is_ready",
    "google_sql_database_instance.mydb",
    "google_sql_user.mydb",
  ]

  name      = "mydb"
  instance  = "${google_sql_database_instance.mydb.name}"
  charset   = "UTF8"
  collation = "en_US.UTF8"
}

Debug Output

module.bitbucket.google_sql_database.mydb: Creating...
  charset:   "" => "UTF8"
  collation: "" => "en_US.UTF8"
  instance:  "" => "mydb-db-2f20fd5d11b44799"
  name:      "" => "mydb"
  self_link: "" => "<computed>"

Steps to Reproduce

  1. terraform apply

Important Factoids

The error returned from the Google API is sql#operation INTERNAL_ERROR. After debugging by creating a database through the UI, which worked we determined that the missing field on the request was the project field. Without this field explicitly set the API fails. The work around is to set the project manually as such.

It is also worth mentioning that the collation defaults to a MySQL value which may lead to weird errors with PostgreSQL databases.

resource "google_sql_database" "mydb" {
  depends_on = [
    "null_resource.is_ready",
    "google_sql_database_instance.mydb",
    "google_sql_user.mydb",
  ]

  name       = "mydb"
  instance  = "${google_sql_database_instance.mydb.name}"
  project    = "my-project"
  charset    = "UTF8"
  collation   = "en_US.UTF8"
}
@ubschmidt2
Copy link
Contributor

This might be the same as #167.

Regarding the default for charset and collation: This is a very good point, PostgreSQL wasn't on my radar. I'm proposing #229.

@grubernaut grubernaut added the bug label Jul 25, 2017
@arhea
Copy link
Author

arhea commented Jul 25, 2017

@ubschmidt2 - I believe #167 might be related as well. Google API likes to have the project explicitly set it looks like.

#229 is definitely a step in the right direction. Support / Documentation for PostgreSQL is needed.

@ubschmidt2
Copy link
Contributor

ubschmidt2 commented Jul 27, 2017

@arhea - PostgreSQL is already supported and documented (25c6a00, hashicorp/terraform#12617).

Oh, I guess you are referring to charset/collation for PostgreSQL. Looking into it.

@ubschmidt2
Copy link
Contributor

@arhea - I've added minimal documentation to #229.

I've created a separate issue for improvements to the charset/collation support for PostgreSQL, #260 as this issue is primarily about the missing project id.

@danawillow
Copy link
Contributor

Just like in #167, I can't seem to reproduce this :-/

Can you share your full config instead of just the affected resource? (I really just need the provider block but anything else you can share would be great) Also full debug logs could help- set the environment variable TF_LOG=DEBUG

@danawillow danawillow self-assigned this Aug 17, 2017
@danawillow
Copy link
Contributor

I think this was fixed in #469. Let me know if it's still happening and I'll reopen!

luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
@ghost
Copy link

ghost commented Mar 30, 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 👉 [email protected]. Thanks!

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

No branches or pull requests

4 participants