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
# Copy-paste your Terraform configurations here - for large Terraform configs,# please use a service like Dropbox and share a link to the ZIP file. For# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp
Debug Output
TestE2E_LongLivedAzure 2022-09-13T17:06:24Z logger.go:66: Error: error waiting for peering connection (azure-e2e-c38853c6-peer) to become 'ACTIVE': unexpected state 'FAILED', wanted target 'ACTIVE'. last error: %!s(<nil>)
TestE2E_LongLivedAzure 2022-09-13T17:06:24Z logger.go:66:
TestE2E_LongLivedAzure 2022-09-13T17:06:24Z logger.go:66: with module.hcp_peering.data.hcp_azure_peering_connection.peering,
TestE2E_LongLivedAzure 2022-09-13T17:06:24Z logger.go:66: on .terraform/modules/hcp_peering/main.tf line 117, in data "hcp_azure_peering_connection" "peering":
TestE2E_LongLivedAzure 2022-09-13T17:06:24Z logger.go:66: 117: data "hcp_azure_peering_connection" "peering" {
TestE2E_LongLivedAzure 2022-09-13T17:06:24Z logger.go:66:
TestE2E_LongLivedAzure 2022-09-13T17:06:24Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1;
Error: error waiting for peering connection (azure-e2e-c38853c6-peer) to become 'ACTIVE': unexpected state 'FAILED', wanted target 'ACTIVE'. last error: %!s(<nil>)
with module.hcp_peering.data.hcp_azure_peering_connection.peering,
on .terraform/modules/hcp_peering/main.tf line 117, in data "hcp_azure_peering_connection" "peering":
117: data "hcp_azure_peering_connection" "peering" {
}
longlived.go:119: Client destroy failed: FatalError{Underlying: error while running command: exit status 1;
Error: error waiting for peering connection (azure-e2e-c38853c6-peer) to become 'ACTIVE': unexpected state 'FAILED', wanted target 'ACTIVE'. last error: %!s(<nil>)
Panic Output
Steps to Reproduce
have a Peering connection fail to Create
run terraform delete
Expected Behavior
The delete proceeds without failure
Actual Behavior
The delete panics because the peering is in an unexpected state: FAILED. This happens here:
I believe the fix to this will be similar to the fix for other resources with FAILED states: #331. We can persist the peering.State to TF state. And then also add the FAILED peering state as an acceptable terminal state wherever we call WaitForPeeringToBeActive:
// WaitForPeeringToBeActive will poll the GET peering endpoint until the state is ACTIVE, ctx is canceled, or an error occurs.
var WaitForPeeringToBeActive = waitForPeeringToBe(peeringState{
Target: PeeringStateActive,
Pending: []string{PeeringStateCreating, PeeringStatePendingAcceptance, PeeringStateAccepted},
})
Terraform Version and Provider Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Steps to Reproduce
terraform delete
Expected Behavior
The delete proceeds without failure
Actual Behavior
The delete panics because the peering is in an unexpected state:
FAILED
. This happens here:terraform-provider-hcp/internal/provider/data_source_azure_peering_connection.go
Line 131 in 5456f06
And also here:
terraform-provider-hcp/internal/provider/data_source_aws_network_peering.go
Line 116 in 5456f06
Important Factoids
I believe the fix to this will be similar to the fix for other resources with FAILED states: #331. We can persist the peering.State to TF state. And then also add the
FAILED
peering state as an acceptable terminal state wherever we callWaitForPeeringToBeActive
:Eg of where we're going to error out every time:
terraform-provider-hcp/internal/provider/data_source_azure_peering_connection.go
Line 132 in 5456f06
References
Community Note
The text was updated successfully, but these errors were encountered: