Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.57k stars 4.82k forks source link

QueueServiceClient SetPropertiesAsync or SetProperties throwing XML specified is not syntactically valid #14075

Closed joebeernink closed 4 years ago

joebeernink commented 4 years ago

Describe the bug When calling QueueServiceClient SetPropertiesAsync or SetProperties with a value that was previously retrieved from GetProperties, the API throws an exception.

Have tried async and sync version, not setting the retention policy and setting the retention policy, and LoggingVersion = 1.0 and 2.0

Code: var queueClient = GetQueueClient(storageAccountOptions.Name, storageAccountOptions.QueueAzureEndpointSuffix, sasToken);

        var queueService = await queueClient.GetPropertiesAsync(cancellationToken).ConfigureAwait(false);
        var queueServiceProperties = queueService.Value;
        queueServiceProperties.Logging.RetentionPolicy = new QueueRetentionPolicy { Days = storageAccountOptions.LogRetentionDays, Enabled = true };
        queueServiceProperties.Logging.Read = true;
        queueServiceProperties.Logging.Write = true;
        queueServiceProperties.Logging.Delete = true;
        _ = queueClient.SetProperties(queueServiceProperties);

Expected behavior Should return successfully

Actual behavior (include Exception or Stack Trace)

Azure.RequestFailedException HResult=0x80131500 Message=XML specified is not syntactically valid. RequestId:ba943464-0003-00a8-2d2b-6f93ef000000 Time:2020-08-10T15:30:49.9376904Z Status: 400 (XML specified is not syntactically valid.) ErrorCode: InvalidXmlDocument

Additional Information: LineNumber: 1 LinePosition: 510 Reason: Error parsing Xml content: 'Element' is an invalid XmlNodeType. Line 1, position 510.

Headers: Server: Windows-Azure-Queue/1.0,Microsoft-HTTPAPI/2.0 x-ms-request-id: ba943464-0003-00a8-2d2b-6f93ef000000 x-ms-version: 2018-11-09 x-ms-error-code: InvalidXmlDocument Date: Mon, 10 Aug 2020 15:30:49 GMT Content-Length: 388 Content-Type: application/xml

Source=Azure.Storage.Queues StackTrace: at Azure.Storage.Queues.QueueRestClient.Service.SetPropertiesAsync_CreateResponse(ClientDiagnostics clientDiagnostics, Response response) at Azure.Storage.Queues.QueueRestClient.Service.d__0.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.ValueTask1.get_Result() at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1.ConfiguredValueTaskAwaiter.GetResult() at Azure.Storage.Queues.QueueServiceClient.d31.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Azure.Storage.Queues.QueueServiceClient.d30.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.DigitalTwins.SharedInfrastructure.SetupStorageLogging.Operations.SetupStorageLoggingOperation.d5.MoveNext() in D:\repos\dt1\products\SharedInfrastructure\public\SetupStorageLogging\src\Operations\SetupStorageLoggingOperation.cs:line 61 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.DigitalTwins.SharedInfrastructure.SetupStorageLogging.Operations.SetupStorageLoggingOperation.d4.MoveNext() in D:\repos\dt1\products\SharedInfrastructure\public\SetupStorageLogging\src\Operations\SetupStorageLoggingOperation.cs:line 38 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at Microsoft.Azure.DigitalTwins.SharedInfrastructure.SetupStorageLogging.Program.

d__0.MoveNext() in D:\repos\dt1\products\SharedInfrastructure\public\SetupStorageLogging\src\Program.cs:line 40

This exception was originally thrown at this call stack: [External Code] Microsoft.Azure.DigitalTwins.SharedInfrastructure.SetupStorageLogging.Operations.SetupStorageLoggingOperation.SetLogging(Microsoft.Azure.DigitalTwins.SharedInfrastructure.SetupStorageLogging.StorageAccountOptions, System.Threading.CancellationToken) in SetupStorageLoggingOperation.cs [External Code] Microsoft.Azure.DigitalTwins.SharedInfrastructure.SetupStorageLogging.Operations.SetupStorageLoggingOperation.Run(System.Threading.CancellationToken) in SetupStorageLoggingOperation.cs [External Code] Microsoft.Azure.DigitalTwins.SharedInfrastructure.SetupStorageLogging.Program.Main(string[]) in Program.cs To Reproduce Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

Using

Environment:

  • Name and version of the Library package used: "Azure.Storage.Queues" Version="12.3.2"
  • Hosting platform or OS and .NET runtime version .NET Core SDK (reflecting any global.json): Version: 3.1.201 Commit: b1768b4ae7

Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.201\

Host (useful for support): Version: 3.1.6 Commit: 3acd9b0cd1

.NET Core SDKs installed: 2.1.805 [C:\Program Files\dotnet\sdk] 2.2.207 [C:\Program Files\dotnet\sdk] 3.0.103 [C:\Program Files\dotnet\sdk] 3.1.201 [C:\Program Files\dotnet\sdk] 3.1.301 [C:\Program Files\dotnet\sdk] 3.1.302 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

  • IDE and version : [e.g. Visual Studio 16.3] Microsoft Visual Studio Enterprise 2019 Version 16.6.4
jsquire commented 4 years ago

Thank you for your feedback. Tagging and routing to the team best able to assist.

ghost commented 4 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

amnguye commented 4 years ago

Hi,

I was able to reproduce your issue and looks like a bug. We will look to fixing this soon. Thanks for bringing this issue to our attention.

joebeernink commented 4 years ago

@jsquire Do we have an eta for this fix? Thanks

jsquire commented 4 years ago

Hi Joe. In this case, I'm only serving as first line triage for routing the issue and don't have visibility. I'll need to defer to @amnguye for status and details around release plans.