azure-sdk-for-net: [BUG] The value for one of the HTTP headers is not in the correct format
Describe the bug An error occurs when attempting an operation while connected to local storage
Expected behavior The requested operation should succeed
Actual behavior Error message:
The value for one of the HTTP headers is not in the correct format
MyApp.Tests.SyncManagerTests.GetDownloads
Source: SyncManagerTests.vb line 63
Duration: 1 ms
Message:
System.AggregateException : One or more errors occurred.
---- Azure.RequestFailedException : The value for one of the HTTP headers is not in the correct format.
RequestId:f97f3379-f5db-40ca-b089-9365321e9a25
Time:2020-08-15T23:44:45.932Z
Status: 400 (The value for one of the HTTP headers is not in the correct format.)
ErrorCode: InvalidHeaderValue
Headers:
x-ms-error-code: InvalidHeaderValue
x-ms-request-id: f97f3379-f5db-40ca-b089-9365321e9a25
Connection: keep-alive
Transfer-Encoding: chunked
Date: Sat, 15 Aug 2020 23:44:45 GMT
Server: Azurite-Blob/3.7.0
Content-Type: application/xml
Stack Trace:
Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
Task`1.GetResultCore(Boolean waitCompletionNotification)
Task`1.get_Result()
SyncManagerTests.ctor(ITestOutputHelper Output) line 22
----- Inner Stack Trace -----
Container.ListBlobsFlatSegmentAsync_CreateResponse(ClientDiagnostics clientDiagnostics, Response response)
<ListBlobsFlatSegmentAsync>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
TaskAwaiter.ThrowForNonSuccess(Task task)
TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
<GetBlobsInternal>d__74.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
TaskAwaiter.ThrowForNonSuccess(Task task)
TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
<GetNextPageAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
TaskAwaiter.ThrowForNonSuccess(Task task)
TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
ValueTask`1.get_Result()
ConfiguredValueTaskAwaiter.GetResult()
<GetAsyncEnumerator>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
ManualResetValueTaskSourceCore`1.GetResult(Int16 token)
Boolean>.GetResult(Int16 token)
ValueTaskAwaiter`1.GetResult()
VB$StateMachine_9_GetSyncManagerAsync.MoveNext() line 110
To Reproduce
- Using v12.4.4, connect to local storage
- Perform an operation (e.g.
oClient.GetBlobsAsync.GetAsyncEnumerator.MoveNextAsync) - Note that the operation succeeds
- Repeat steps 1 & 2 using v12.5.0
- Note that the operation fails, resulting in the error above
- Insufficient information is provided for determining which header is in error, and why
Environment
- Azure.Storage.Blobs 12.5.0
- Windows 10 .NET Framework 4.72
- Visual Studio 16.6.5
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (6 by maintainers)
@seanmcc-msft
I was mistaken in my original report. I claimed that the error was occurring with both local and cloud storage. In fact, it was only occurring with local storage (Azurite, in this case). I’ve updated the report accordingly.
The problem is solved. I turned out I hadn’t updated the server along with the client SDK. Once I did that, killed the Node process and restarted Azurite, everything worked as expected:
Note: this assumes that Azurite was installed with the
-gswitch.The headers from Fiddler were the tipoff:
Request
Response
Note the
HeaderNameandHeaderValueelements in the captured XML response stream. This was the problem. So thank you for asking for that—it helped me arrive at the solution.However, this header information could be included in the exception thrown by the SDK. It would make things a lot easier. I’d like to submit this as a feature request.
Me too with version 12.5.0. version 12.4.4 works fine.
I am seeing the exact same issue here. Works fine in version 12.4.4 - I have reverted the package for now.