-
Notifications
You must be signed in to change notification settings - Fork 46
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
base-layer: the PollUntilDone
of CreateOrUpdateThenPoll
stops polling when the API returns resource not found error on first poll
#740
Labels
Comments
Looks like this is also an issue intermittently for Recovery Services: Resource CreationRequest:
Response:
LRORequest:
Response:
Subsequent/Repeated LRO RequestRequest:
Response:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Community Note
Service Used
APIM
API Versions Used
2022-08-01
Description
While investigating GH #23322, it was found that the
PollUntilDone
ofCreateOrUpdateThenPoll
stops polling when the API returns resource not found error although this is only the first polling. Details are as follows:Base-layer: after investigation, it was found that the error was caused by code terminating polling.
Steps to reproduce GH #23322:
azurerm_api_management_api
with the following config.revision
ofazurerm_api_management_api
to "2", then Terraform Apply.I assume that the base layer should handle 404 situations, and for LRO, the API returning 404 when the resource is not completely created is expected behavior.
Note: This error occurs when the API returns a 404 error during the first polling. If the polling API returns 200 for the first time, the problem could not be reproduced.
PUT /subscriptions/xxx/resourceGroups/example/providers/Microsoft.ApiManagement/service/example/apis/example;rev=2?api-version=2022-08-01
{"properties":{"apiType":"http","apiVersion":"v1","apiVersionSetId":"/subscriptions/xxx/resourceGroups/example/providers/Microsoft.ApiManagement/service/example/apiVersionSets/example","format":"swagger-json","path":"api1","type":"http","value":"{\n \"swagger\": \"2.0\",\n \"info\": {\n \"description\": \"This is a simple API\",\n \"version\": \"1.0.2\",\n \"title\": \"tftest2\",\n \"contact\": {\n \"email\": \"[email protected]\"\n },\n \"license\": {\n \"name\": \"Apache 2.0\",\n \"url\": \"http://www.apache.org/licenses/LICENSE-2.0.html\"\n }\n },\n \"tags\": [\n {\n \"name\": \"admins\",\n \"description\": \"Secured Admin-only calls\"\n },\n {\n \"name\": \"developers\",\n \"description\": \"Operations available to regular developers\"\n }\n ],\n \"paths\": {\n \"/inventory\": {\n \"get\": {\n \"tags\": [\n \"developers\"\n ],\n \"summary\": \"searches inventory\",\n \"operationId\": \"searchInventory\",\n \"description\": \"By passing in the appropriate options, you can search for\\navailable inventory in the system\\n\",\n \"produces\": [\n \"application/json\"\n ],\n \"parameters\": [\n {\n \"in\": \"query\",\n \"name\": \"searchString\",\n \"description\": \"pass an optional search string for looking up inventory\",\n \"required\": false,\n \"type\": \"string\"\n },\n {\n \"in\": \"query\",\n \"name\": \"skip\",\n \"description\": \"number of records to skip for pagination\",\n \"type\": \"integer\",\n \"format\": \"int32\",\n \"minimum\": 0\n },\n {\n \"in\": \"query\",\n \"name\": \"limit\",\n \"description\": \"maximum number of records to return\",\n \"type\": \"integer\",\n \"format\": \"int32\",\n \"minimum\": 0,\n \"maximum\": 50\n }\n ],\n \"responses\": {\n \"200\": {\n \"description\": \"search results matching criteria\",\n \"schema\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/definitions/InventoryItem\"\n }\n }\n },\n \"400\": {\n \"description\": \"bad input parameter\"\n }\n }\n },\n \"post\": {\n \"tags\": [\n \"admins\"\n ],\n \"summary\": \"adds an inventory item\",\n \"operationId\": \"addInventory\",\n \"description\": \"Adds an item to the system\",\n \"consumes\": [\n \"application/json\"\n ],\n \"produces\": [\n \"application/json\"\n ],\n \"parameters\": [\n {\n \"in\": \"body\",\n \"name\": \"inventoryItem\",\n \"description\": \"Inventory item to add\",\n \"schema\": {\n \"$ref\": \"#/definitions/InventoryItem\"\n }\n }\n ],\n \"responses\": {\n \"201\": {\n \"description\": \"item created\"\n },\n \"400\": {\n \"description\": \"invalid input, object invalid\"\n },\n \"409\": {\n \"description\": \"an existing item already exists\"\n }\n }\n }\n }\n },\n \"definitions\": {\n \"InventoryItem\": {\n \"type\": \"object\",\n \"required\": [\n \"id\",\n \"name\",\n \"manufacturer\",\n \"releaseDate\"\n ],\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"example\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\"\n },\n \"name\": {\n \"type\": \"string\",\n \"example\": \"Widget Adapter\"\n },\n \"releaseDate\": {\n \"type\": \"string\",\n \"format\": \"int32\",\n \"example\": \"2016-08-29T09:12:33.001Z\"\n },\n \"manufacturer\": {\n \"$ref\": \"#/definitions/Manufacturer\"\n }\n }\n },\n \"Manufacturer\": {\n \"required\": [\n \"name\"\n ],\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"example\": \"ACME Corporation\"\n },\n \"homePage\": {\n \"type\": \"string\",\n \"format\": \"url\",\n \"example\": \"https://www.acme-corp.com\"\n },\n \"phone\": {\n \"type\": \"string\",\n \"example\": \"408-867-5309\"\n }\n }\n }\n },\n \"schemes\": [\n \"https\"\n ]\n}\n"}}
Response:
GET /subscriptions/xxx/resourceGroups/example/providers/Microsoft.ApiManagement/service/example/apis/example;rev=2?api-version=2022-08-01
Response:
{"error":{"code":"ResourceNotFound","message":"Api not found.","details":null}}
References
No response
The text was updated successfully, but these errors were encountered: