question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]TableClient CreateIfNotExistsAsync returns "Content-Type header value missing" intermittently

See original GitHub issue

Library name and version

Azure.Data.Tables 12.8.0

Describe the bug

When calling CreateIfNotExistsAsync, it returns “Content-Type header value missing”. See details below:

—> Azure.RequestFailedException: Content-Type header value missing. RequestId:a65cad2b-9002-0034-7714-616cfd000000 Time:2023-03-28T01:29:34.6706116Z Status: 400 (Bad Request) ErrorCode: InvalidInput

Content: {“odata.error”:{“code”:“InvalidInput”,“message”:{“lang”:“en-US”,“value”:“Content-Type header value missing.\nRequestId:a65cad2b-9002-0034-7714-616cfd000000\nTime:2023-03-28T01:29:34.6706116Z”}}}

Headers: Transfer-Encoding: chunked Server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-id: a65cad2b-9002-0034-7714-616cfd000000 x-ms-version: REDACTED X-Content-Type-Options: REDACTED Date: Tue, 28 Mar 2023 01:29:34 GMT Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8

at Azure.Data.Tables.TableClient.CreateIfNotExistsAsync(CancellationToken cancellationToken) …

We are authing with managed identity. And it seems that we only see the exception after upgraded to version 12.8.0. Not seeing any issue in previous 12.5.0.

Expected behavior

Not throwing exception.

Actual behavior

Create new table if not exists, not throwing exceptions.

Reproduction Steps

install package <PackageReference Include="Azure.Data.Tables" Version="12.8.0" />

code snippets:

var storageName = "yourStorage";
var tableName = "yourTable";
var clientOptions = new TableClientOptions();
var credential = new DefaultAzureCredential();
string tableUrl = $"https://{storageName}.table.core.windows.net/{tableName}";

var tableClient = new TableClient(new Uri(tableUrl), tableName , credential, clientOptions);
await tableClient.CreateIfNotExistsAsync(default);

try run multiple times.

Environment

Windows Server 2019-Datacenter on Azure, running with .NET 6.

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
juniwangcommented, Apr 20, 2023

Azure.Core >=1.30 fixed the issue, not seeing those strange exceptions any more. thanks.

0reactions
github-actions[bot]commented, Apr 19, 2023

Hi @juniwang. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found