azure-sdk-for-net: [BUG] KustoDatabaseCollection CreateOrUpdateAsync returning ResourceNotFound - false failure
Library name and version
Azure.ResourceManager.Kusto 1.3.0
Describe the bug
when calling the KustoDatabaseCollection.CreateOrUpdateAsync with WaitUntil.Completed we are getting this exception: The resource with identifier ‘/subscriptions/**/resourceGroups/**/providers/Microsoft.Kusto/Clusters/**/Databases/**’ is not found. Status: 404 (Not Found) ErrorCode: ResourceNotFound
at Azure.Core.OperationInternal1.GetResponseFromState(OperationState1 state)
at Azure.Core.OperationInternal1.<UpdateStatusAsync>d__20.MoveNext() at System.Threading.Tasks.ValueTask1.get_Result()
at Azure.Core.OperationInternalBase.<UpdateStatusAsync>d__13.MoveNext()
at System.Threading.Tasks.ValueTask1.get_Result() at Azure.Core.OperationPoller.<WaitForCompletionAsync>d__11.MoveNext() at System.Threading.Tasks.ValueTask1.get_Result()
at Azure.Core.OperationInternalBase.<WaitForCompletionResponseAsync>d__19.MoveNext()
at System.Threading.Tasks.ValueTask1.get_Result() at Azure.Core.OperationInternal1.<WaitForCompletionAsync>d__19.MoveNext()
at System.Threading.Tasks.ValueTask1.get_Result() at Azure.Core.OperationInternal1.<WaitForCompletionAsync>d__15.MoveNext()
at System.Threading.Tasks.ValueTask`1.get_Result()
at Azure.ResourceManager.Kusto.KustoDatabaseCollection.<CreateOrUpdateAsync>d__7.MoveNext()
but after waiting 1 minute, the database was actually successfully created!
Expected behavior
when WaitUntil.Completed is provided, the operation is expected to be awaited until the long-running operation has completed without unexpected errors.
Actual behavior
exception is thrown, but the operation is actually succeeded after waiting up to one additional minute.
Reproduction Steps
initialize ArmClient with token credentials and define the cluster resource identifier then :
var kustoClusterResource = new ArmClient(tokenCredentials).GetKustoClusterResource(clusterResourceIdentifier); await kustoClusterResource.GetKustoDatabases().CreateOrUpdateAsync(WaitUntil.Completed,databaseName,databaseData);
Environment
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (7 by maintainers)
Hi everyone, This was an error on the Kusto backend side (unrelated to c# SDK client) Mostly affecting internal Microsoft consumers.
We are deploying a HF by the end of the week, fixing the issue
The root cause is from service response.
LRO is working like this:
From the log of @adelKhatib, it keeps polling of the operation status until it’s completed. And when it tries to get the created database back, it returns 404 from server side, which is not expected.
And the strange thing is, I did not get 404 after creation as mentioned above. Not sure what is causing different responses from server side.
I am experiencing the exact same issue where an exception of “not found” is always thrown when attempting to create a Kusto database. However, upon retrying (after couple of minutes) the creation process, it eventually succeeds. Therefore, I fully concur with @adelKhatib 's assertion that WaitUntil.Completed does not function as anticipated. @ArthurMa1978 , what is your opinion on this matter? This issue is currently preventing me from proceeding with the release. @jsquire @fengzhou-msft
Thank you for your feedback. Tagging and routing to the team member best able to assist.