Skip to content

[BUG] RequestFailedException when the request actually succeeded #48740

Open
@linmeng08

Description

@linmeng08

Library name and version

azsdk-net-ResourceManager.Compute/1.6.0 (.NET Framework 4.8.4775.0; Microsoft Windows 10.0.20348)

Describe the bug

We are seeing a lot of this type of exception when scaling VMSS resource with the new Azure.ResourceManager library. Please see code snippet in the repro steps below, the UpdateAsync failed with following exception, but if we check ARM log with the clientRequestId we saw the HTTP requests for the first GetVirtualMachineScaleSetResource call which succeeded. The UpdateAsync call throws the exception, but the request appears to have been submitted and accepted by ARM/CRP. I do see two PATCH calls in HttpIncomingRequests and not sure if that has caused any problem:

Azure.RequestFailedException: RequestId: 40b77578-ea4b-40a8-a9aa-9c8e5c80b339 StatusCode: 200 Reason:
Message: Service request failed.
Status: 200

Service request succeeded. Response content and headers are not included to avoid logging sensitive data.

ErrorCode: -2146233088
Body: {}
StackTrace:
at Azure.Core.OperationInternal` 1.GetResponseFromState(OperationState` 1 state)
at Azure.Core.OperationInternal` 1.d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Core.OperationInternalBase.d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Azure.Core.OperationPoller.d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Core.OperationInternalBase.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.Core.OperationInternal` 1.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask` 1.get_Result()
at Azure.Core.OperationInternal` 1.d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.ResourceManager.Compute.VirtualMachineScaleSetResource.d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Azure.ResourceManager.Compute.VirtualMachineScaleSetResource.d__2.MoveNext()

ARM Log:

TIMESTAMP correlationId clientRequestId httpMethod httpStatusCode userAgent targetUri
2025-03-09 21:00:17.1807573 e387af5d-1213-440f-a8c1-dc85c7c17402 40b77578-ea4b-40a8-a9aa-9c8e5c80b339 GET -1 azsdk-net-ResourceManager/1.13.0 (.NET Framework 4.8.4775.0; Microsoft Windows 10.0.20348 ) https://management.azure.com:443/subscriptions/[removed]/resourceGroups/[removed]/providers/Microsoft.Compute/virtualMachineScaleSets/vmss?api-version=2024-07-01
2025-03-09 21:00:17.2626624 e387af5d-1213-440f-a8c1-dc85c7c17402 40b77578-ea4b-40a8-a9aa-9c8e5c80b339 GET 200 azsdk-net-ResourceManager/1.13.0 (.NET Framework 4.8.4775.0; Microsoft Windows 10.0.20348 ) https://management.azure.com:443/subscriptions/[removed]/resourceGroups/[removed]/providers/Microsoft.Compute/virtualMachineScaleSets/vmss?api-version=2024-07-01

Expected behavior

The function call should succeeded instead of throwing Azure.RequestFailedException.

Actual behavior

The function call failed with Azure.RequestFailedException.

Reproduction Steps

var vmssResourceId = VirtualMachineScaleSetResource.CreateResourceIdentifier(this.SubscriptionId, resourceGroupName, vmssName);
var vmss = this.armClient.GetVirtualMachineScaleSetResource(virtualMachineScaleSetResourceId);
var sku = new ComputeSku();
sku.Capacity = 100;
var vmssUpdate = new VirtualMachineScaleSetPatch();
vmssUpdate.Sku = sku;
ArmOperation lro = await vmss.UpdateAsync(WaitUntil.Completed, vmssUpdate, cancellationToken);

Environment

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ComputeMgmtThis issue is related to a management-plane library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions