IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 670 forks source link

ibm_container_cluster_config data lookup is not outputting incident ID in failure response #3205

Open ocofaigh opened 3 years ago

ocofaigh commented 3 years ago

During an IBM Cloud CIE, the ibm_container_cluster_config data lookup was failing with:

Error downloading the cluster config [c5jbqoew0u0m7rlre430]: Request failed with status code: 500, ServerErrorResponse: Error: Invalid status code (400): 400 Bad Request

According to the IKS team, the response from the containers API should also include an incident ID. From slack:

Our API response body contains the error message. It contains recovery info and an incidentID field

Community Note

Terraform CLI and Terraform IBM Provider Version

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

data "ibm_container_cluster_config" "cluster_config" {
  cluster_name_id = var.cluster_id
  config_dir      = local.tmp_kubeconfig_dir
}

Debug Output

--->

Panic Output

Expected Behavior

Incide ID included in response

Actual Behavior

No incident Id included

Steps to Reproduce

  1. terraform apply

Important Factoids

References

ocofaigh commented 3 years ago

@kavya498 @hkantare Was anyone able to confirm if this response should actually be returning an incident ID? Is it the same issue as https://github.com/IBM-Cloud/terraform-provider-ibm/issues/3187#issuecomment-950808261 perhaps? Although the response does seem a little different to that issue, so maybe not. Over the past 2 weeks, we have hit this quite a lot, and it always correlates to an IKS CIE, however we cannot prove this without an incident ID which should be printed as part of the response.

kavya498 commented 2 years ago

With the recent terraform releases, enabling debug mode should be giving you API responses.. @ocofaigh, are we good to close this issue? Thanks..

JohnStarich commented 2 years ago

Hi @kavya498 đź‘‹ Thanks for working on this.

I tried looking through the recent commits but I didn’t find the change. Is the X-Request-Id header (incident ID in error response) printed when a failure occurs? If you have an example, that’d be awesome.

By the way, if you’re making API calls directly (not through CLI), it’d also be helpful to pass in the client’s own new UUID per retry for the X-Request-Id header so we can help trace more requests. It becomes more relevant when requests time out and no response is received, but the client’s request ID can still be linked to our records.