IBM-Cloud / terraform-provider-ibm

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

Add retry around GET v1/vpn_servers #4330

Open ocofaigh opened 1 year ago

ocofaigh commented 1 year ago

Intermittently we have seen the ibm_is_vpn_server fail with an error such as this:

Error: [ERROR] VPNServer failed Error Getting VPC Server: Get "https://us-south.iaas.cloud.ibm.com/v1/vpn_servers/r006-3ebaa691-4a15-4210-b493-ab8609d3921f?generation=2&version=2022-09-13": context deadline exceeded

It seems this api is called many times, and most of the time passes, however looking at the debug log (attached below), it seems there is no retry attempt for this apicall. Wondering if adding a retry would help reduce the number of times we hit this issue?

Community Note

Terraform CLI and Terraform IBM Provider Version

terraform 1.3.7 ibm provider v1.49.0

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.

resource "ibm_is_vpn_server" "vpn" {
  certificate_crn = var.server_cert_crn
  client_authentication {
    method            = var.client_auth_methods
    identity_provider = var.client_auth_methods == "username" ? "iam" : null
  }
  client_idle_timeout    = var.client_idle_timeout
  client_ip_pool         = var.client_ip_pool
  client_dns_server_ips  = var.client_dns_server_ips
  enable_split_tunneling = var.enable_split_tunneling
  name                   = var.vpn_gateway_name
  subnets                = local.subnet_ids
  resource_group         = var.resource_group_id
}

Debug Output

trace.log stdout.txt

Panic Output

Expected Behavior

Retry the apicall to workaround intermittent timeouts

Actual Behavior

No retry, and module fails

Steps to Reproduce

  1. terraform apply

Important Factoids

References

ujjwal-ibm commented 1 year ago

looking at it

ocofaigh commented 5 months ago

@ujjwal-ibm was there any changes made in this area? I don't recall seeing the error in a while, so wanted to check