terraform-provider-azurerm: The requested resource of type 'Microsoft.DBforMariaDB/servers/privateEndpointConnectionProxies' with name '' was not found.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave “+1” or “me too” comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

terraform -v Terraform v0.12.23

  • provider.azurerm v2.2.0
  • provider.null v2.1.2

Affected Resource(s)

  • azurerm_private_endpoint

Terraform Configuration Files

resource "azurerm_private_endpoint" "main" {

  name                = var.name
  location            = var.location
  resource_group_name = var.resource_group_name
  subnet_id           = data.azurerm_subnet.main.id

  private_service_connection {

    name                           = azurerm_mariadb_server.main.name
    is_manual_connection           = "false"
    private_connection_resource_id = azurerm_mariadb_server.main.id
    subresource_names              = ["mariadbServer"]
  }
  depends_on = [azurerm_mariadb_server.main]

}

Debug Output

2020/03/20 10:26:45 [DEBUG] module.db.azurerm_private_endpoint.main[“server1”]: apply errored, but we’re indicating that via the Error pointer rather than returning it: Error waiting for creation of Private Endpoint “my_resource_group” (Resource Group “my_resource_group”): Code=“ResourceNotFound” Message=“The requested resource of type ‘Microsoft.DBforMariaDB/servers/privateEndpointConnectionProxies’ with name ‘my_nic.*******’ was not found.” Details=[]

2020/03/20 10:26:45 [ERROR] module.db: eval: terraform.EvalApplyPost, err: Error waiting for creation of Private Endpoint “my_resource_group” (Resource Group “my_resource_group”): Code=“ResourceNotFound” Message="The requested resource of type ‘Microsoft.DBforMariaDB/servers/privateEndpointConnectionProxies’ with name 'my_nic.*****’ was not found." Details=[]

2020/03/20 10:26:45 [ERROR] module.db: eval: terraform.EvalSequence, err: Error waiting for creation of Private Endpoint “my_resource_group” (Resource Group “my_resource_group”): Code=“ResourceNotFound” Message="The requested resource of type ‘Microsoft.DBforMariaDB/servers/privateEndpointConnectionProxies’ with name 'my_nic.******’ was not found." Details=[]

Error: Error waiting for creation of Private Endpoint “my_resource_group” (Resource Group “my_resource_group”): Code=“ResourceNotFound” Message=“The requested resource of type ‘Microsoft.DBforMariaDB/servers/privateEndpointConnectionProxies’ with name ‘my_nic.*******’ was not found.” Details=[]

Panic Output

Expected Behavior

Create the private endpoint for MariaDB

Actual Behavior

It appears the NIC is not getting created in time

Important Factoids

References

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 19

Most upvoted comments

FWIW I’ve been in touch with Microsoft support on this issue and it’s on their side. There’s no ETA for the permanent fix, and in the meantime you have to reach out to support and they can fix it manually, for each individual private endpoint you need.

You will hit the same error if you do the same thing via the Azure Portal, or the Azure CLI tool, or Powershell, and of course Terraform.

This affects their Postgres, MariaDB and MySQL managed DB products.

FWIW I’ve been in touch with Microsoft support on this issue and it’s on their side. There’s no ETA for the permanent fix, and in the meantime you have to reach out to support and they can fix it manually, for each individual private endpoint you need.

You will hit the same error if you do the same thing via the Azure Portal, or the Azure CLI tool, or Powershell, and of course Terraform.

This affects their Postgres, MariaDB and MySQL managed DB products.

Can confirm as well - the same error via the Azure Portal.

Additional can say, that first creating of DB and Private Endpoint with new original name will succeed, but if drop and recreate them with the same names this issue is appeared.

As a workaround, I’ve added a random_id as a suffix to the names of the resources which are having this problem. Now it’s working very well each time I run the script.

Please try with a name that is never used before. Generally, if you have tried to configure Private Endpoint for PostgreSQL/MySQL/MariaDB instance many times but somehow the first time failed, the issue will be hit during retry because it tried to getprivateendpointconnection proxies of the previously deleted server, which is empty.

The reason that caused the first failure,

  • it could be that you dropped and created a server with the same name couple times. And therefore it hit the bug at the 1st time when configuring private endpoint. -For other reasons that caused the first provision failed (e.g. timeout), as long as you retried, it would hit this issue also.

So far, the fix is deploying and the completed regions are (by the time I posted this comment): westcentralus, brazilsouth, westeurope, westus2, uksouth1&2, uaecentral, switzerlandnorth, southafricanorth,norwayeast, northcentralus, koreasouth, japaneast, indiawest, indiacentral, germanynorth, francecesouth, eastus1&2, eastasia, chinanorth1&2, australiaeast, australiacentral,