Azurite icon indicating copy to clipboard operation
Azurite copied to clipboard

Delete table entity with empty rowkey fails

Open WimDoze opened this issue 5 years ago • 2 comments

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?

v14.17.1

What problem was encountered?

Cannot delete a table entity with an empty string as rowkey. Happened when cleaning up unused durable entities

Steps to reproduce the issue?

Debug log: 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: TableStorageContextMiddleware: RequestMethod=DELETE RequestURL=http://127.0.0.1/devstoreaccount1/testtable(PartitionKey='partitionkey',RowKey='') RequestHeaders:{"host":"127.0.0.1:10002","accept-charset":"UTF-8","maxdataserviceversion":"3.0;NetFx","accept":"application/json; odata=minimalmetadata","dataserviceversion":"3.0;","if-match":"","x-ms-client-request-id":"a55c26ee-7b6c-4d82-b0dc-e6ecad83524a","user-agent":"Azure-Cosmos-Table/1.0.8 (.NET CLR 6.0.0; Win32NT 10.0.19044.0)","x-ms-version":"2017-07-29","x-ms-date":"Mon, 22 Nov 2021 16:34:47 GMT","authorization":"SharedKey devstoreaccount1:t97WGWwWISS+SnZAsu0H/9j/gGbwyRmmMJR8Xk8r+No="} ClientIP=127.0.0.1 Protocol=http HTTPVersion=1.1 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c debug: tableStorageContextMiddleware: Dispatch pattern string: /testtable(PartitionKey='PLACEHOLDER',RowKey='PLACEHOLDER') 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: tableStorageContextMiddleware: Account=devstoreaccount1 tableName=testtable 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c verbose: DispatchMiddleware: Dispatching request... 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: DispatchMiddleware: Operation=Table_DeleteEntity 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c verbose: AuthenticationMiddlewareFactory:createAuthenticationMiddleware() Validating authentications. 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: TableSharedKeyLiteAuthenticator:validate() Start validation against account shared key authentication. 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: TableSharedKeyLiteAuthenticator:validate() Request doesn't include valid authentication header. Skip SharedKeyLite authentication. 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: TableSharedKeyAuthenticator:validate() Start validation against account shared key authentication. 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: TableSharedKeyAuthenticator:validate() [STRING TO SIGN]:"DELETE\n\n\nMon, 22 Nov 2021 16:34:47 GMT\n/devstoreaccount1/devstoreaccount1/testtable(PartitionKey='partitionkey',RowKey='')" 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: TableSharedKeyAuthenticator:validate() Calculated authentication header based on key1: SharedKey devstoreaccount1:t97WGWwWISS+SnZAsu0H/9j/gGbwyRmmMJR8Xk8r+No= 2021-11-22T16:34:47.753Z 89eea698-50df-4578-9aa7-5c6fd629396c info: TableSharedKeyAuthenticator:validate() Signature 1 matched. 2021-11-22T16:34:47.754Z 89eea698-50df-4578-9aa7-5c6fd629396c verbose: DeserializerMiddleware: Start deserializing... 2021-11-22T16:34:47.754Z 89eea698-50df-4578-9aa7-5c6fd629396c info: HandlerMiddleware: DeserializedParameters={"options":{"queryOptions":{},"requestId":"a55c26ee-7b6c-4d82-b0dc-e6ecad83524a","dataServiceVersion":"3.0;"},"version":"2017-07-29","ifMatch":""} 2021-11-22T16:34:47.754Z 89eea698-50df-4578-9aa7-5c6fd629396c error: ErrorMiddleware: Received a MiddlewareError, fill error information to HTTP response 2021-11-22T16:34:47.755Z 89eea698-50df-4578-9aa7-5c6fd629396c error: ErrorMiddleware: ErrorName=StorageError ErrorMessage="The values are not specified for all properties in the entity." ErrorHTTPStatusCode=400 ErrorHTTPStatusMessage=undefined ErrorHTTPHeaders={"x-ms-error-code":"PropertiesNeedValue","x-ms-request-id":"89eea698-50df-4578-9aa7-5c6fd629396c","x-ms-version":"2020-10-02"} ErrorHTTPBody="{"odata.error":{"code":"PropertiesNeedValue","message":{"lang":"en-US","value":"The values are not specified for all properties in the entity.\nRequestId:89eea698-50df-4578-9aa7-5c6fd629396c\nTime:2021-11-22T16:34:47.754Z"}}}" ErrorStack=""StorageError: The values are not specified for all properties in the entity.\n at Function.getPropertiesNeedValue (C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\errors\\StorageErrorFactory.js:58:16)\n at TableHandler.deleteEntity (C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\handlers\\TableHandler.js:268:49)\n at C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\generated\\middleware\\HandlerMiddlewareFactory.js:58:18\n at C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\table\\generated\\ExpressMiddlewareFactory.js:77:63\n at Layer.handle [as handle_request] (C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\layer.js:95:5)\n at trim_prefix (C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:317:13)\n at C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:284:7\n at Function.process_params (C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:335:12)\n at next (C:\\Users\\wim.doze\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:275:10)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)"" 2021-11-22T16:34:47.755Z 89eea698-50df-4578-9aa7-5c6fd629396c error: ErrorMiddleware: Set HTTP code: 400 2021-11-22T16:34:47.755Z 89eea698-50df-4578-9aa7-5c6fd629396c error: ErrorMiddleware: Set HTTP Header: x-ms-error-code=PropertiesNeedValue 2021-11-22T16:34:47.755Z 89eea698-50df-4578-9aa7-5c6fd629396c error: ErrorMiddleware: Set HTTP Header: x-ms-request-id=89eea698-50df-4578-9aa7-5c6fd629396c 2021-11-22T16:34:47.755Z 89eea698-50df-4578-9aa7-5c6fd629396c error: ErrorMiddleware: Set HTTP Header: x-ms-version=2020-10-02 2021-11-22T16:34:47.755Z 89eea698-50df-4578-9aa7-5c6fd629396c error: ErrorMiddleware: Set content type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 2021-11-22T16:34:47.755Z 89eea698-50df-4578-9aa7-5c6fd629396c error: ErrorMiddleware: Set HTTP body: "{"odata.error":{"code":"PropertiesNeedValue","message":{"lang":"en-US","value":"The values are not specified for all properties in the entity.\nRequestId:89eea698-50df-4578-9aa7-5c6fd629396c\nTime:2021-11-22T16:34:47.754Z"}}}" 2021-11-22T16:34:47.756Z 89eea698-50df-4578-9aa7-5c6fd629396c info: EndMiddleware: End response. TotalTimeInMS=3 StatusCode=400 StatusMessage=Bad Request Headers={"server":"Azurite-Table/3.14.3","x-ms-error-code":"PropertiesNeedValue","x-ms-request-id":"89eea698-50df-4578-9aa7-5c6fd629396c","x-ms-version":"2020-10-02","content-type":"application/json;odata=minimalmetadata;streaming=true;charset=utf-8"}

Have you found a mitigation/solution?

No

WimDoze avatar Nov 23 '21 09:11 WimDoze

Thanks for raising this.
I shall take a look and see about adding support for rows with empty strings.

edwin-huber avatar Nov 29 '21 19:11 edwin-huber

exactly. the same code is working in Storage Emulator in VS 2019 but with Azurite and VS 2022 the same Delete Operation will throw following Bad Request Exception.

The values are not specified for all properties in the entity.

In our case the entity rowKey is also empty.

imanabidi avatar Nov 30 '21 12:11 imanabidi