You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
# terraform -version
Terraform v0.13.5
Your version of Terraform is out of date! The latest version
is 0.14.9. You can update by downloading from https://www.terraform.io/downloads.html
provider (google):
* hashicorp/google: version = "~> 3.60.0"
Affected Resource(s)
google_cloudfunctions_function
Terraform Configuration Files
main.tf
resource "google_cloudfunctions_function" "function" {
project = var.project
name = "redacted"
runtime = "nodejs12"
region = var.region
source_archive_bucket = local.app_bucket
source_archive_object = "src.zip"
event_trigger {
event_type = "google.pubsub.topic.publish"
resource = google_pubsub_topic.redacted.id
}
# Name of the method to be called in the source code
entry_point = "entrypoint"
environment_variables = {
SUB_DEQUEUE = local.pubsub_dequeue
TOPIC_ERROR = local.topic_error
}
service_account_email = google_service_account.redacted.email
vpc_connector = "projects/${var.project}/locations/${var.region}/connectors/redacted"
}
Debug Output
See section Actual Behavior below
Panic Output
N/A
Expected Behavior
terraform apply should fail, but the error message it shows should convey-up every meaningful detail, like this:
{
"error": {
"code": 400,
"message": "The request has errors",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "vpc_connector",
"description": "A Cloud Function and a Serverless VPC Access connector must be located in the same region."
}
]
}
]
}
}
The above detailed error response was obtained by manually submitting the request terraform was attempting to make (i.e. PATCH a cloud function), directly through the Cloud Functions API (here).
The payload used to make this manual request was copied from terraform debug logs (see below).
With this more detailed error message, I was able find the error in my terraform config: I was passing the vpc_connector's full id (i.e. projects/<project>/locations/<location>/connectors/<connector>), instead of just its name.
Actual Behavior
terraform apply fails, and the error message it shows does not convey meaningful information:
TF_LOGS: default
google_cloudfunctions_function.function: Modifying... [id=projects/redacted/locations/europe-west1/functions/redacted]
Error: Error while updating cloudfunction configuration: %!s(<nil>)
on main.tf line 77, in resource "google_cloudfunctions_function" "function":
77: resource "google_cloudfunctions_function" "function" {
the HTTP response terraform shows is the following:
{
"error": {
"code": 400,
"message": "The request has errors",
"errors": [
{
"message": "The request has errors",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
As you can see, it doesn't convey any meaningful detail.
Steps to Reproduce
Define a cloud function resource
Pass a full self-id for the vpc_connector field (projects/<project>/locations/<location>/connectors/<connector>, which is incorrect), instead of just passing the <connector-name>
try to terraform apply
Important Factoids
N/A
References
b/274818664
The text was updated successfully, but these errors were encountered:
@elouanKeryell-Even I can repro and see the difference of the responses between these two calls.
By removing User-Agent: google-api-go-client/0.5 Terraform/0.13.5 (+https://www.terraform.io) Terraform-Plugin-SDK/2.4.4 terraform-provider-google/dev from the PATCH request headers, the description will be included in the API response. That Header User-Agent makes difference
To resolve this, we need API's help. Added label upstream
* Fix import of bigquery transfer config location
* Fix import of bigquery transfer config when name does not contain location
* Fix indentation in bigquery_data_transfer_self_link_as_name_set_location.go.erb
Signed-off-by: Modular Magician <[email protected]>
* Fix import of bigquery transfer config location
* Fix import of bigquery transfer config when name does not contain location
* Fix indentation in bigquery_data_transfer_self_link_as_name_set_location.go.erb
Signed-off-by: Modular Magician <[email protected]>
Community Note
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 tohashibot
, a community member has claimed the issue already.Terraform Version
google
):Affected Resource(s)
Terraform Configuration Files
main.tf
Debug Output
See section Actual Behavior below
Panic Output
N/A
Expected Behavior
terraform apply
should fail, but the error message it shows should convey-up every meaningful detail, like this:The above detailed error response was obtained by manually submitting the request terraform was attempting to make (i.e. PATCH a cloud function), directly through the Cloud Functions API (here).
The payload used to make this manual request was copied from terraform debug logs (see below).
With this more detailed error message, I was able find the error in my terraform config: I was passing the
vpc_connector
's full id (i.e.projects/<project>/locations/<location>/connectors/<connector>
), instead of just its name.Actual Behavior
terraform apply
fails, and the error message it shows does not convey meaningful information:TF_LOGS
: defaultTF_LOGS
:DEBUG
--> https://gist.github.com/elouanKeryell-Even/1b1dfa72fd763a03a1bff84325291605the HTTP response terraform shows is the following:
As you can see, it doesn't convey any meaningful detail.
Steps to Reproduce
vpc_connector
field (projects/<project>/locations/<location>/connectors/<connector>
, which is incorrect), instead of just passing the<connector-name>
terraform apply
Important Factoids
N/A
References
b/274818664
The text was updated successfully, but these errors were encountered: