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.

*PANIC* when looking for non-existent row

See original GitHub issue

There seems to be an inconsistency in how this emulator handles non-existent rows compared to how “real” Azure Table Storage handles them. I discovered this while using Streamstone, which builds event streaming capabilities on top of Azure Table Storage, and while I haven’t been able to discern exactly what operations they’re doing on the table storage, I have been able to build a minimal example that reproduces the problem.

To reproduce, make sure you have the dotnet CLI installed, and run

mkdir repro && cd repro
dotnet new console
dotnet add package Streamstone

Then replace the contents of Program.cs with this:

using System;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Streamstone;

namespace AzuritePanicOnStreamstoneTryOpenStream
{
    class Program
    {
        public static async Task Main(string[] args)
        {
            // Replace with CloudStorageAccount.Parse("your connection string"); for using a real Azure Storage Account
            var account = CloudStorageAccount.DevelopmentStorageAccount;

            var table = account
                .CreateCloudTableClient()
                .GetTableReference("Events");
            await table.CreateIfNotExistsAsync();

            var partition = new Partition(table, "foo");

            await Stream.TryOpenAsync(partition);
        }
    }
}

Finally, run dotnet run to see the program fail with

Unhandled Exception: Microsoft.WindowsAzure.Storage.StorageException: Unexpected response code, Expected:OK or NotFound, Received:InternalServerError
   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteAsyncInternal[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token) in C:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\WindowsRuntime\Core\Executor\Executor.cs:line 315
   at Streamstone.Stream.OpenStreamOperation.ExecuteAsync()
   at AzuritePanicOnStreamstoneTryOpenStream.Program.Main(String[] args) in C:\Work\OSS\Throwaway repros\AzuritePanicOnStreamstoneTryOpenStream\Program.cs:line 17
   at AzuritePanicOnStreamstoneTryOpenStream.Program.<Main>(String[] args)

If I look at the logs for my docker container running Azurite, I see

GET /devstoreaccount1/Events(PartitionKey='foo',RowKey='SS-HEAD') 500 0.388 ms - 27
**PANIC** Something unexpected happened! Table Storage Emulator may be in an inconsistent state!
ReferenceError: partitionKey is not defined
    at TableStorageManager.queryEntities (/opt/azurite/lib/core/table/TableStorageManager.js:104:40)
    at QueryEntities.process (/opt/azurite/lib/actions/table/QueryEntities.js:12:29)
    at Object.actions.(anonymous function) [as QueryEntity] (/opt/azurite/lib/middleware/table/actions.js:52:19)
    at BbPromise.try (/opt/azurite/lib/middleware/table/actions.js:18:38)
    at tryCatcher (/opt/azurite/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/opt/azurite/node_modules/bluebird/js/release/method.js:39:29)
    at module.exports (/opt/azurite/lib/middleware/table/actions.js:17:18)
    at Layer.handle [as handle_request] (/opt/azurite/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/opt/azurite/node_modules/express/lib/router/index.js:317:13)
    at /opt/azurite/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/opt/azurite/node_modules/express/lib/router/index.js:335:12)
    at next (/opt/azurite/node_modules/express/lib/router/index.js:275:10)
    at BbPromise.try (/opt/azurite/lib/middleware/table/validation.js:32:9)
    at tryCatcher (/opt/azurite/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/opt/azurite/node_modules/bluebird/js/release/method.js:39:29)
    at module.exports (/opt/azurite/lib/middleware/table/validation.js:18:18)

However, if I connect to a real Azure Storage Account instead of the emulator, the program runs without error.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:21

github_iconTop GitHub Comments

2reactions
jchannoncommented, Dec 5, 2018

Just hit this too in docker

2reactions
edwin-hubercommented, May 11, 2018

The changes have been merged into our Dev branch to address this. We’ll merge into Master and release a new update soon. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Anxiety Chronicles: 'It feels like I'm sprinting towards ... - The Lily
I can't stop thinking and my mind won't stop racing; it feels like I'm sprinting towards a nonexistent finish line. Usually, there's so...
Read more >
Agoraphobia - an overview | ScienceDirect Topics
Presents either with a panic attack or with fear and anxiety related to anticipation of a future panic attack or its implications.
Read more >
How Anxiety Leads to Irrational Fears and 5 Ways to Cope
Panic disorder occurs when intense and possibly irrational fears bring on a panic attack. You may develop an irrational fear of panic attacks...
Read more >
What is Catastrophizing? 6 Ways To Stop it - Healthline
The bottom line ... How seeking control consumed me ... I had my first panic attack on a train and that added an...
Read more >
Where Should a Phobic Person Sit? | Psychology Today
Phobic persons, most of whom suffer from panic disorder, ... but also waiting on line, sitting in church or in a restaurant, or...
Read more >

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