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

Internal error encountered when updating an essential contact #10386

Closed
Labels

Comments

@indypinball
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.

Information

We get an error when updating an existing email set on the essential contacts and we have tested both the google and the google-beta provider

The plan looks like this and that seems in order (the actual email is obfuscated)

Terraform will perform the following actions:

google_essential_contacts_contact.owner will be updated in-place

~ resource "google_essential_contacts_contact" "owner" {

~ email = "[email protected]" -> "[email protected]"
id = "projects/the-project-id/contacts/0"
name = "projects/the-project-id/contacts/0"
(3 unchanged attributes hidden)
}

Terraform Version

v 3.89.0

Affected Resource(s)

  • google_essential_contacts_contact

Terraform Configuration Files

variable "notification_email" {
  description = "Email for owner"
  default = "[email protected]"
}

resource "google_essential_contacts_contact" "owner" {
  provider      = google-beta
  parent        = "projects/${google_project.team-project.project_id}"
  email         = var.notification_email
  language_tag  = "en-GB"
  notification_category_subscriptions = ["ALL"]
}

Debug Output

---[ REQUEST ]---------------------------------------
PATCH /v1/projects/the-project-id/contacts/0?alt=json&updateMask=email HTTP/1.1
Host: essentialcontacts.googleapis.com
User-Agent: Terraform/1.0.8 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google-beta/3.89.0
Content-Length: 106
Content-Type: application/json
Accept-Encoding: gzip
{
"email": "[email protected]",
"languageTag": "en-GB",
"notificationCategorySubscriptions": [
"ALL"
]
}
-----------------------------------------------------: timestamp=2021-10-25T11:27:30.333Z
2021-10-25T11:27:30.740Z [INFO] provider.terraform-provider-google-beta_v3.89.0_x5: 2021/10/25 11:27:30 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 500 Internal Server Error
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Mon, 25 Oct 2021 11:27:30 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Debug-Tracking-Id: 12671933596528845615;o=0
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}

Expected Behavior

The email that is set as the contact should have been changed

Actual Behavior

Internal error was encountered, terraform apply fails

Steps to Reproduce

Create a essential contacts contact and deploy it
Update the contact information
Re-deploy to apply the changed user

  • #0000
@c4po
Copy link

c4po commented Nov 9, 2021

same error on terraform-provider-google/4.0.0

@linuxdaemon
Copy link

linuxdaemon commented Nov 10, 2021

The issue seems to be that the patch endpoint does not let you update the email. To change the email the resource must be recreated.

reference: https://cloud.google.com/resource-manager/docs/reference/essentialcontacts/rest/v1/projects.contacts/patch

@c4po c4po mentioned this issue Nov 10, 2021
@slevenick
Copy link
Collaborator

Where do you see that patch does not allow updating the email? A 500 error indicates that the server had an internal error, not that the field is not updatable

@c4po
Copy link

c4po commented Nov 10, 2021

Hi @slevenick
in the API document, it says

Method: projects.contacts.patch
Updates a contact. Note: A contact's email address cannot be changed.

We need ForceNew: ture for the email attribute. Please review this PR #10541

@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 Dec 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants