[BUG] Unexpected type for header
See original GitHub issueLibrary name and version
Azure.Core 1.29.0
Describe the bug
After upgrading to Azure.Core 1.29.0 (required by Microsoft.Extensions.Azure 1.6.2) we repeatedly receive this error:
System.InvalidOperationException: Unexpected type for header :
at Azure.Core.Pipeline.HttpClientTransport.PipelineRequest.GetHttpHeaderValue(String headerName, Object value)
at Azure.Core.Pipeline.HttpClientTransport.PipelineRequest.EnumerateHeaders()+MoveNext()
at Azure.Core.Diagnostics.AzureCoreEventSource.FormatHeaders(IEnumerable`1 headers, HttpMessageSanitizer sanitizer)
at Azure.Core.Diagnostics.AzureCoreEventSource.Request(Request request, String assemblyName, HttpMessageSanitizer sanitizer)\n at Azure.Core.Pipeline.LoggingPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
at Azure.Core.Pipeline.RedirectPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)\n at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
at Azure.Core.Pipeline.RetryPolicy.ProcessAsync(HttpMessage message, ReadOnlyMemory`1 pipeline, Boolean async)
at Azure.Core.Pipeline.HttpPipeline.SendRequestAsync(Request request, CancellationToken cancellationToken)
at Azure.Messaging.ServiceBus.Administration.HttpRequestAndResponse.SendHttpRequestAsync(Request request, CancellationToken cancellationToken)\n at Azure.Messaging.ServiceBus.Administration.HttpRequestAndResponse.GetEntityAsync(String entityPath, String query, Boolean enrich, CancellationToken cancellationToken)
at Azure.Messaging.ServiceBus.Administration.ServiceBusAdministrationClient.GetQueueAsync(String name, CancellationToken cancellationToken)
This does not happen locally. It only occurs when running in a container in AKS using managed identity credentials. Downgrading to Azure.Core 1.28.0 and Microsoft.Extensions.Azure 1.6.0 solves the issue. If it helps we’re using Azure.Messaging.ServiceBus 7.12.0.
Expected behavior
No errors.
Actual behavior
See bug description.
Reproduction Steps
See bug description.
Environment
No response
Issue Analytics
- State:
- Created 6 months ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Unexpected type for header x-ms-meta-ownerType
While trying to set metadata for file upload in Azure Blob Storage,Getting this error { "isSuccess": false, "statusCode": 500, ...
Read more >Why Does Azure Domain Verification Not Follow the HTTP ...
EDIT: Also, to be sure, this is the error message I get: "The server returned an unexpected content type header value. [nc186]".
Read more >Problem with 'error: unknown type name' : r/C_Programming
Hello, I have the following problem. I have typedef alias: typedef cx_ecfp_private_key_t privatekey_t; // In header file 'crypto.h'.
Read more >syntax error, unexpected 'header' (T_STRING) : r/PHPhelp
I start learning php and i have a problem. Please, help me detected to my mistake! VScode and Apache write about an error...
Read more >error C2226: syntax error : unexpected type 'std::string' ...
The error has shifted to pointing to the constructor implementation header: error C2226: syntax error : unexpected type 'std::string'
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We’re still getting an “Unexpected type for header” exception and I think it’s when
valueis null, which is not handled in this switch expression https://github.com/Azure/azure-sdk-for-net/blob/c03b37ccd7aa206b8a6c9f303b18d23ee093532b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs#L506-L511 Which for us is a breaking change in a minor package update…I can confirm it has been fixed in
Azure.Core1.30.0.