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

Deployment failed with subnet state not ready to accept private endpoint (possible dependency mismatch?) #3433

Closed
SvenAelterman opened this issue Apr 13, 2023 · 3 comments · Fixed by #3581
Assignees
Labels
bug Something isn't working

Comments

@SvenAelterman
Copy link
Collaborator

Describe the bug

Doing a deployment with make all, I received the following error message:

Error: waiting for creation of Private Endpoint "pe-blob-actredemo01" (Resource Group "rg-actredemo01"): Code="RetryableError" Message="A retryable error occurred." Details=[{"code":"ReferencedResourceNotProvisioned","message":"Cannot proceed with operation because resource /subscriptions/<snip>/resourceGroups/rg-actredemo01/providers/Microsoft.Network/virtualNetworks/vnet-actredemo01/subnets/SharedSubnet used by resource /subscriptions/<snip>/resourceGroups/rg-actredemo01/providers/Microsoft.Network/networkInterfaces/pe-blob-actredemo01.nic.4b12ee8f-5b4a-4d42-adfc-d891f82c99f7 is not in Succeeded state. Resource is in Updating state and the last operation that updated/is updating the resource is PutSubnetOperation."}]
│ 
│   with azurerm_private_endpoint.blobpe,
│   on storage.tf line 18, in resource "azurerm_private_endpoint" "blobpe":
│   18: resource "azurerm_private_endpoint" "blobpe" {
│

It would seem to indicate that the deployment of a private endpoint is attempted before the network/subnet has finished creating.

When I redeployed, I got an error that the private endpoint resource already existed and should be imported. Instead, I chose to delete the resource and re-ran the deployment again. It then finished successfully.

Steps to reproduce

  1. Following the deployment steps of the Quickstart guide, for a greenfield deployment.
@SvenAelterman SvenAelterman added the bug Something isn't working label Apr 13, 2023
@marrobi
Copy link
Member

marrobi commented Apr 17, 2023

I've just had similar this morning:

╷
│ Error: waiting for creation of Private Endpoint "pe-file-mrtredemo27" (Resource Group "rg-mrtredemo27"): Code="RetryableError" Message="A retryable error occurred." Details=[{"code":"ReferencedResourceNotProvisioned","message":"Cannot proceed with operation because resource /subscriptions/xxx/resourceGroups/rg-mrtredemo27/providers/Microsoft.Network/virtualNetworks/vnet-mrtredemo27/subnets/SharedSubnet used by resource /subscriptions/xxx/resourceGroups/rg-mrtredemo27/providers/Microsoft.Network/networkInterfaces/pe-file-mrtredemo27.nic.252711c3-56f3-462e-adbe-a4e10e229764 is not in Succeeded state. Resource is in Updating state and the last operation that updated/is updating the resource is PutSubnetOperation."}]
│ 
│   with azurerm_private_endpoint.filepe,
│   on storage.tf line 39, in resource "azurerm_private_endpoint" "filepe":
│   39: resource "azurerm_private_endpoint" "filepe" {
│ 
╵
╷
│ Error: A resource with the ID "/subscriptions/xxx/resourceGroups/rg-mrtredemo27/providers/Microsoft.Network/privateEndpoints/pe-file-mrtredemo27" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_private_endpoint" for more information.
│ 
│   with azurerm_private_endpoint.filepe,
│   on storage.tf line 39, in resource "azurerm_private_endpoint" "filepe":
│   39: resource "azurerm_private_endpoint" "filepe" {
│ 
╵

@marrobi
Copy link
Member

marrobi commented Jun 8, 2023

Similar to what is discussed here:

hashicorp/terraform-provider-azurerm#16182

Are a few other references, I think we should maybe make all the private endpoint operations happen sequentially?

Would be useful to have the full log from core/terraform/*-tre-core.log if anybody can provide one.

@marrobi
Copy link
Member

marrobi commented Jun 13, 2023

Also seen:

Cannot proceed with operation because resource /subscriptions//resourceGroups/rg-mrtredemo27-ws-9f98/providers/Microsoft.Network/virtualNetworks/vnet-mrtredemo27-ws-9f98 used by resource /subscriptions//resourceGroups/rg-mrtredemo27-ws-9f98/providers/Microsoft.Network/virtualNetworks/vnet-mrtredemo27-ws-9f98/virtualNetworkPeerings/ws-core-peer-mrtredemo27-ws-9f98 is not in Succeeded state. Resource is in Updating state and the last operation that updated/is updating the resource is PutSubnetOperation.

When deploying a workspace occasionally get the above error. Peering and private endpoint operations need to wait until the subnets are deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants