How to fix Azure Table Store htrowing null reference in AddEntityAsync

T K 1 Reputation point
2023-05-09T11:44:03.02+00:00

We are using Azure.Data.Tables nuget package to write to azure table store. This has been working fine for months.

We haven't changes any code but, as of this morning we're getting a null referenece exception when trying to call AddEntityAsync - it seems to be some low level stream read issue in the Azure code:

at Azure.Core.Pipeline.ResponseBodyPolicy.CopyToAsync(Stream source, Stream destination, CancellationTokenSource cancellationTokenSource)

On the azure side we're getting loads of Client errors recorded.

It seems like the actual azure storage is failing - but Azure says it's fine.

How can I diagnose this issue and/or get help from azure team to find out what's happening?

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
162 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ShaktiSingh-MSFT 14,191 Reputation points Microsoft Employee
    2023-05-09T12:05:44.4666667+00:00

    Hi T K •,

    Welcome to Microsoft Q&A forum and thanks for using Azure Services.

    We are sorry for the inconvenience you are experiencing.

    As I understand, you are getting null reference exception when trying to call AddEntityAsync.

    Null reference exception signifies there is no meaningful value available.

    To troubleshoot, we may follow below steps:

    1). Analyze the code and service status of Azure Table Storage if running and no outages or issues.

    2). Refer to the solutions mentioned in this GitHub Thread https://github.com/NuGet/Home/issues/9882 which could be helpful in your case.

    Other useful links: https://stackoverflow.com/questions/68209507/system-nullreferenceexception-shows-up-after-updating-nuget-packages

    Let us know if the solutions mentioned above helped. If this answers your query, do click Accept Answer and Mark Helpful for the same. And, if you have any further query do let us know.

    Thanks

    0 comments No comments

  2. navba-MSFT 18,900 Reputation points Microsoft Employee
    2023-05-10T10:19:06.7866667+00:00

    @T K Regarding the ClientOtherErrors observed, please note that it is not fatal. Operations with status codes of 2XX count as successful, whereas operations with status codes in 3XX, 4XX and 5XX ranges are counted as unsuccessful. In the server-side storage log files, these operations are recorded with a transaction status of ClientOtherErrors. It is important to note that these operations have completed successfully and therefore do not affect other metrics such as availability. See here.

    If there is any issue on Azure Storage side, it would be having status code of 5XX (500 or 503) in the Azure portal metrics. See here. You could use the Azure Storage Transaction metrics by applying the Splitting dimension as shown below:

    User's image

    Regarding the Null Reference Exception in AddEntityAsync( ). I understand that it was working fine for months and there are no changes done.

    Here are some of the suggestions you could try to isolate this issue:

    1. Ensure that you are using most recent version of Azure.Data.Tables library.
    2. I tried to call the AddEntityAsync() method in my sample application and that worked fine. So could you please run the sample code available here.
    3. If my sample works fine and if the exception occurs only in your application code, you could attach a debugger to your application and step through the code to identify the exact point of failure. This can help pinpoint the cause of the null reference exception.
    4. Enable the Azure .NET SDK logging within your application, this logging allows you to monitor I/O requests and responses that client libraries are making to Azure services.
    5. If you have isolated that the issue is with the__Azure.Data.Tables__package itself, you may need to consider reporting the issue to on the Azure SDK for Net GitHub repository. There you need to provide the detailed information about your environment, sample code snippet, detailed exception callstack and any error messages received.

    Let us know if the suggestions mentioned above helped. If this answers your query, do click Accept Answer and Mark Helpful for the same. And, if you have any further query do let us know.

    0 comments No comments