Invalid Status message for BadRequest
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 393
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 36
Description
### Which service(blob, file, queue, table) does this issue concern?
Table
### Which version of the Azurite was used?
3.22.0
### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
npm
### What's the Node.js version?
v18.14.2
### What problem was encountered?
When we try to delete a record and provide invalid Etag value in the delete request
then a 400 Bad Request error gets throw as expected.
But when it comes to the Error Message,
Previously when using Azure Storage Emulator the message returned was: ```"0:The etag value 'MalformedETag' specified in one of the request headers is not valid. Please make sure only one etag value is specified and is valid."```
Now when using Azurite the message returned is: ```'1:'``` which does not seem to be correct.
### Steps to reproduce the issue?
-> Insert a record in table.
-> Try deleting the same record from table but provide invalid Etag value in the delete request.
value provided by me for etag is "MalformedETag"
If possible, please provide the debug log using the -d parameter, replacing \ with an appropriate path for your OS, or review the instructions for docker containers:
```
info: HandlerMiddleware: DeserializedParameters={"version":"2018-03-28","options":{"requestId":"902cd6bd-a965-4ef1-820d-e36cc9c92013","dataServiceVersion":"3.0;"},"multipartContentType":"multipart/mixed; boundary=batch_82445a3b-2dd3-426d-848d-81cb7a61ec69","contentLength":1586,"body":"ReadableStream"}
debug: TableHandler:batch() Raw request string is "--batch_82445a3b-2dd3-426d-848d-81cb7a61ec69\r\nContent-Type: multipart/mixed; boundary=changeset_32c83aa7-1a3b-4892-8473-c9a18f163bb8\r\n\r\n--changeset_32c83aa7-1a3b-4892-8473-c9a18f163bb8\r\nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nDELETE [http://127.0.0.1:10002/devstoreaccount1/TableName(PartitionKey='3a0829a3-ae7a-493b-bbc9-eebafa0cd40e',RowKey='d326e5b3-dfba-48bd-9d27-57686d93d8e4')](http://127.0.0.1:10002/devstoreaccount1/TableName(PartitionKey=%273a0829a3-ae7a-493b-bbc9-eebafa0cd40e%27,RowKey=%27d326e5b3-dfba-48bd-9d27-57686d93d8e4%27)) HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Type: application/json\r\nDataServiceVersion: 3.0;\r\nIf-Match: W/\"datetime'2023-03-08T12%3A25%3A00.4743732Z'\"\r\n\r\n--changeset_32c83aa7-1a3b-4892-8473-c9a18f163bb8\r\nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nDELETE [http://127.0.0.1:10002/devstoreaccount1/TableName(PartitionKey='3a0829a3-ae7a-493b-bbc9-eebafa0cd40e',RowKey='115d0398-6987-467c-8a00-9fb8cad66968')](http://127.0.0.1:10002/devstoreaccount1/TableName(PartitionKey=%273a0829a3-ae7a-493b-bbc9-eebafa0cd40e%27,RowKey=%27115d0398-6987-467c-8a00-9fb8cad66968%27)) HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Type: application/json\r\nDataServiceVersion: 3.0;\r\nIf-Match: MalformedETag\r\n\r\n--changeset_32c83aa7-1a3b-4892-8473-c9a18f163bb8\r\nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nDELETE [http://127.0.0.1:10002/devstoreaccount1/TableName(PartitionKey='3a0829a3-ae7a-493b-bbc9-eebafa0cd40e',RowKey='fe52aac3-1b4c-46d5-b079-f36393dc4aee')](http://127.0.0.1:10002/devstoreaccount1/TableName(PartitionKey=%273a0829a3-ae7a-493b-bbc9-eebafa0cd40e%27,RowKey=%27fe52aac3-1b4c-46d5-b079-f36393dc4aee%27)) HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Type: application/json\r\nDataServiceVersion: 3.0;\r\nIf-Match: W/\"datetime'2023-03-08T12%3A25%3A00.4743737Z'\"\r\n\r\n--changeset_32c83aa7-1a3b-4892-8473-c9a18f163bb8--\r\n--batch_82445a3b-2dd3-426d-848d-81cb7a61ec69--\r\n"
2023-03-08T12:27:13.812Z 2f266c87-fd46-4452-bba6-52636f94e526 debug: TableHandler:batch() Raw response string is "--batchresponse_82445a3b-2dd3-426d-848d-81cb7a61ec69\r\nContent-Type: multipart/mixed; boundary=changesetresponse_32c83aa7-1a3b-4892-8473-c9a18f163bb8\r\n\r\n--changesetresponse_32c83aa7-1a3b-4892-8473-c9a18f163bb8\r\nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 400 Bad Request\r\nContent-ID: 2\r\nDataServiceVersion: 3.0;\r\nContent-Type: application/json;odata=minimalmetadata;charset=utf-8\r\n\r\n{\"odata.error\":{\"code\":\"InvalidOperation\",\"message\":{\"lang\":\"en-US\",\"value\":\"1:\\nRequestId:2f266c87-fd46-4452-bba6-52636f94e526\\nTime:2023-03-08T12:27:13.811Z\"}}}\r\n--changesetresponse_32c83aa7-1a3b-4892-8473-c9a18f163bb8--\r\n--batchresponse_82445a3b-2dd3-426d-848d-81cb7a61ec69--\r\n"
```
Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.
### Have you found a mitigation/solution?
No
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.