Azure / Azure/azure-rest-api-specs

VirtualWan P2S VPN Gateway Failed to Delete: Internal Server Error

Open
#10,149 2 comments 0 reactions 0 assignees View on GitHub
Network - VPN Gateway question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

Create a P2S virtualwan VPN gateway and then delete it will cause "internal server error". Then a GET on the VPN gateway resource will return the resource in response, with `provisioningState: Failed`.

This is always reproducible.

## Sequence

**Create the resource:**

PUT https://management.azure.com/subscriptions/0-0-0-0/resourceGroups/acctestRG-200715142625083561/providers/Microsoft.Network/p2svpnGateways/acctestp2sVPNG-200715142625083561?api-version=2020-05-01

REQUEST

{

"location": "eastus2",
"properties": {
"p2SConnectionConfigurations": [
{
"name": "first",
"properties": {
"vpnClientAddressPool": {
"addressPrefixes": [
"172.100.0.0/14"
]
}
}
}
],
"virtualHub": {
"id": "/subscriptions/0-0-0-0/resourceGroups/acctestRG-200715142625083561/providers/Microsoft.Network/virtualHubs/acctestvhub-200715142625083561"
},
"vpnGatewayScaleUnit": 1,
"vpnServerConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/acctestRG-200715142625083561/providers/Microsoft.Network/vpnServerConfigurations/acctestvpnsc-200715142625083561"
}
},
"tags": {}
}

RESPONSE

{

"etag": "W/\"ef19f912-3305-4511-9ac7-4500c0a0b6e9\"",
"id": "/subscriptions/0-0-0-0/resourceGroups/acctestRG-200715142625083561/providers/Microsoft.Network/p2sVpnGateways/acctestp2sVPNG-200715142625083561",
"location": "eastus2",
"name": "acctestp2sVPNG-200715142625083561",
"properties": {
"customDnsServers": [],
"p2SConnectionConfigurations": [
{
"etag": "W/\"ef19f912-3305-4511-9ac7-4500c0a0b6e9\"",
"id": "/subscriptions/0-0-0-0/resourceGroups/acctestRG-200715142625083561/providers/Microsoft.Network/p2sVpnGateways/acctestp2sVPNG-200715142625083561/p2sConnectionConfigurations/first",
"name": "first",
"properties": {
"enableInternetSecurity": false,
"provisioningState": "Updating",
"routingConfiguration": {
"propagatedRouteTables": {
"ids": [],
"labels": []
},
"vnetRoutes": {
"staticRoutes": []
}
},
"vpnClientAddressPool": {
"addressPrefixes": [
"172.100.0.0/14"
]
}
},
"type": "Microsoft.Network/p2sVpnGateways/p2sConnectionConfigurations"
}
],
"provisioningState": "Updating",
"virtualHub": {
"id": "/subscriptions/0-0-0-0/resourceGroups/acctestRG-200715142625083561/providers/Microsoft.Network/virtualHubs/acctestvhub-200715142625083561"
},
"vpnGatewayScaleUnit": 1,
"vpnServerConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/acctestRG-200715142625083561/providers/Microsoft.Network/vpnServerConfigurations/acctestvpnsc-200715142625083561"
},
"vpnServerConfigurationLocation": "eastus2"
},
"tags": {},
"type": "Microsoft.Network/p2sVpnGateways"
}

**Wait until the resource provision finished**:

GET https://management.azure.com/subscriptions/0-0-0-0/providers/Microsoft.Network/locations/eastus2/operations/9acaae55-d80a-4944-a998-a0971e734f61?api-version=2020-05-01

{

"status": "Succeeded"
}

**Delete the resource:**

DELETE https://management.azure.com/subscriptions/0-0-0-0/resourceGroups/acctestRG-200715142625083561/providers/Microsoft.Network/p2svpnGateways/acctestp2sVPNG-200715142625083561?api-version=2020-05-01

**Poll the async operation URL and eventually hit the error:**

GET https://management.azure.com/subscriptions/0-0-0-0/providers/Microsoft.Network/locations/eastus2/operations/8e46c24c-dfa8-426a-85e0-3ded40b9e067?api-version=2020-05-01


RESPONSE

{
"error": {
"code": "InternalServerError",
"details": [],
"message": "An error occurred."
},
"status": "Failed"
}

**NOTE**: the status code of the error response is 200. However, in some SDK (e.g. Azure Go SDK) will not only check for status code, also will check for non-nil `error` in response to indicate a failed HTTP request.

Contributor guide

Open the contributing guide

Research direction

Start with the DELETE request and the asynchronous operation polling URL documented in the issue, then compare the resulting status and GET response for the P2S VPN gateway. Done means deletion completes without InternalServerError and the gateway no longer remains with provisioningState: Failed.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.