Error thrown when trying to add entity with Boolean or Int32 property
See original GitHub issueWhich 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?
- Form the following entity object in a Node application:
{ partitionKey: "", rowKey: "", prop: { value: "false", type: "Boolean" } }
- 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:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
@edwin-huber I think you linked back to this issue, not the PR…
Changes merged, pending next release.