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.

Error thrown when trying to add entity with Boolean or Int32 property

See original GitHub issue

Which service (blob, file, queue, table) does this issue concern?

Table

Which version of the Azurite was used?

3.14.3

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

npm

What’s the Node.js version?

16.13.1

What problem was encountered?

Azurite returns an error when attempting to add an entity with a Boolean or Int32 property.

Steps to reproduce the issue?

  1. Form the following entity object in a Node application:
    {
       partitionKey: "",
       rowKey: "",
       prop: { value: "false", type: "Boolean" }
    }
    
  2. Use @azure/data-tables to connect to the emulator and insert the entity.

Here are the relevant lines from the debug log:

2022-01-04T00:49:30.226Z 2a92d550-f0d2-48aa-b819-f2c8a8d99a47 verbose: DeserializerMiddleware: Start deserializing...
2022-01-04T00:49:30.227Z 2a92d550-f0d2-48aa-b819-f2c8a8d99a47 debug: deserialize(): Raw request body string is (removed all empty characters) {"PartitionKey":"1","RowKey":"2","bin":"false","bin@odata.type":"Edm.Boolean"}
2022-01-04T00:49:30.227Z 2a92d550-f0d2-48aa-b819-f2c8a8d99a47 info: HandlerMiddleware: DeserializedParameters={"options":{"queryOptions":{},"requestId":"73776de8-b219-4a28-870a-151d5a8a1072","dataServiceVersion":"3.0","responsePreference":"return-no-content","tableEntityProperties":{"PartitionKey":"1","RowKey":"2","prop":"false","bin@odata.type":"Edm.Boolean"}},"version":"2019-02-02","body":"ReadableStream"}
2022-01-04T00:49:30.227Z 2a92d550-f0d2-48aa-b819-f2c8a8d99a47 error: TableHandler:insertEntity() TypeError "TypeError: Not a valid EdmBoolean string.\n    at Function.validate (C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\entity\\EdmBoolean.js:11:19)\n    at new EdmBoolean (C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\entity\\EdmBoolean.js:7:38)\n    at Object.parseEntityProperty (C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\entity\\EntityProperty.js:92:56)\n    at new NormalizedEntity (C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\entity\\NormalizedEntity.js:41:55)\n    at TableHandler.insertEntity (C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\handlers\\TableHandler.js:116:32)\n    at C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\generated\\middleware\\HandlerMiddlewareFactory.js:58:18\n    at C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\generated\\ExpressMiddlewareFactory.js:77:63\n    at Layer.handle [as handle_request] (C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\layer.js:95:5)\n    at trim_prefix (C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:317:13)\n    at C:\\Users\\cralvord\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:284:7"

Have you found a mitigation/solution?

No. It should be noted that the same step taken against Azure are successful.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
craxalcommented, Feb 3, 2022

@edwin-huber I think you linked back to this issue, not the PR…

0reactions
edwin-hubercommented, Feb 17, 2022

Changes merged, pending next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected InvalidOperationException when trying to ...
EF tries to add B entities to change tracking. From source code of EFCore you can see that this leads us to the...
Read more >
Creating and Throwing Exceptions
Learn about creating and throwing exceptions. Exceptions are used to indicate that an error has occurred while running a program.
Read more >
Bad Data, Try/Catch, and Slow Performance - Nick Chamberlain
public static Boolean TryParse(String s, out Int32 result);. Int32.TryParse will not throw a FormatException if String s cannot be parsed (MSDN).
Read more >
Object Reference Not Set to an Instance of an Object
The good news is that a lot of null reference errors can be avoided by adding additional logic and code to ensure objects...
Read more >
JavaScript data types and data structures - MDN Web Docs
When a property is accessed on a primitive value, ... The Boolean type represents a logical entity and is inhabited by two values:...
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