terraform-provider-vra7 icon indicating copy to clipboard operation
terraform-provider-vra7 copied to clipboard

Provider panics during resource deletion when connection to vRA is lost

Open marratj opened this issue 4 years ago • 1 comments

vRA 7.x version 1.0.1 Terraform version 0.12.24

Describe the bug During resource deletion when the GetRequestStatus call in waitForRequestCompletion to vRA API is not responding for whatever reason (an intermittent connection issue for example) the provider will panic with a runtime error: invalid memory address or nil pointer dereference.

677:	        	reqestStatusView, _ := vraClient.GetRequestStatus(requestID)
688:		status = reqestStatusView.Phase // --> this fails with a nil pointer exception in case vRA doesn't respond to the API call

To Reproduce

  • Trigger resource deletion (might also work during resource creation)
  • break network connectivity to the vRA API for a short time (10 seconds, during the waitForRequestCompletion loop)

Expected behavior There should be a error checking and/or retry mechanism that doesn't lead the provider to panic when network connectivity to the vRA API is lost intermittently

marratj avatar May 18 '20 12:05 marratj