Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table transaction batch upsert merge and upsert replace fails with 404 #1232

Closed
joelverhagen opened this issue Dec 19, 2021 · 2 comments
Closed
Assignees

Comments

@joelverhagen
Copy link
Contributor

joelverhagen commented Dec 19, 2021

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

table

Which version of the Azurite was used?

Locally running version of #1157

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

Git clone

What's the Node.js version?

16.13.0

What problem was encountered?

When using the upsert-merge table transaction batch action, a 404 is thrown. This should always succeed if the table exists. Note that this operation succeeds perfectly fine outside of a batch.

Steps to reproduce the issue?

using Azure.Data.Tables;

var tableClient = new TableServiceClient("UseDevelopmentStorage=true");
var table = tableClient.GetTableClient("table0");
table.Delete();
table.Create();
table.SubmitTransaction(new[]
{
    new TableTransactionAction(TableTransactionActionType.UpsertMerge, new TableEntity("PK", "RK1")),
    // TableTransactionActionType.UpsertReplace also fails
});
var entity = table.GetEntity<TableEntity>("PK", "RK1");
Console.WriteLine(entity.Value.ETag);
2021-12-19T04:08:32.849Z 	 info: Azurite Blob service is starting on 127.0.0.1:10000
2021-12-19T04:08:32.851Z 	 info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2021-12-19T04:08:32.851Z 	 info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2021-12-19T04:08:32.885Z 	 info: BlobGCManager:start() Starting BlobGCManager. Set status to Initializing.
2021-12-19T04:08:32.886Z 	 info: BlobGCManager:start() Trigger mark and sweep loop. Set status to Running.
2021-12-19T04:08:32.886Z 	 info: BlobGCManager:markSweepLoop() Start next mark and sweep.
2021-12-19T04:08:32.886Z 	 info: BlobGCManager:markSweep() Get all extents.
2021-12-19T04:08:32.888Z 	 info: BlobGCManager:start() BlobGCManager successfully started.
2021-12-19T04:08:32.901Z 	 info: BlobGCManager:markSweep() Got 17 extents.
2021-12-19T04:08:32.901Z 	 info: BlobGCManager:markSweep() Get referred extents.
2021-12-19T04:08:32.904Z 	 info: BlobGCManager:markSweep() Got referred extents, unreferenced extents count is 3.
2021-12-19T04:08:32.905Z 	 info: BlobGCManager:markSweep() Try to delete function entries() { [native code] } unreferenced extents.
2021-12-19T04:08:32.906Z 	 debug: FSExtentStore:deleteExtents() Delete extent:8f135c76-c56a-45ff-b093-ed0972e594b8 location:Default path:C:\z\Git\joelverhagen\Azurite\__blobstorage__\8f135c76-c56a-45ff-b093-ed0972e594b8
2021-12-19T04:08:32.910Z 	 info: Azurite Blob service successfully listens on http://127.0.0.1:10000
2021-12-19T04:08:32.911Z 	 info: Azurite Queue service is starting on 127.0.0.1:10001
2021-12-19T04:08:32.911Z 	 info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2021-12-19T04:08:32.911Z 	 info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2021-12-19T04:08:32.913Z 	 debug: FSExtentStore:deleteExtents() Delete extent:ac5ac2d8-799d-4a75-8c57-63cf767b2ba1 location:Default path:C:\z\Git\joelverhagen\Azurite\__blobstorage__\ac5ac2d8-799d-4a75-8c57-63cf767b2ba1
2021-12-19T04:08:32.914Z 	 debug: FSExtentStore:deleteExtents() Delete extent:9ade7284-2d89-4aa5-ab54-9f15e3b72b03 location:Default path:C:\z\Git\joelverhagen\Azurite\__blobstorage__\9ade7284-2d89-4aa5-ab54-9f15e3b72b03
2021-12-19T04:08:32.919Z 	 info: BlobGCManager:markSweep() Deleted unreferenced 3 extents, after excluding active write extents.
2021-12-19T04:08:32.919Z 	 info: BlobGCManager:markSweepLoop() Mark and sweep finished, taken 33ms.
2021-12-19T04:08:32.919Z 	 info: BlobGCManager:markSweepLoop() Sleep for 600000ms.
2021-12-19T04:08:32.946Z 	 info: QueueGCManager:start() Starting QueueGCManager, set status to Initializing
2021-12-19T04:08:32.947Z 	 info: QueueGCManager:start() Trigger mark and sweep loop, set status to Running.
2021-12-19T04:08:32.947Z 	 info: QueueGCManager:markSweepLoop() Start new mark and sweep.
2021-12-19T04:08:32.947Z 	 info: QueueGCManger:markSweep() Get all extents.
2021-12-19T04:08:32.947Z 	 info: QueueGCManager:start() QueueGCManager successfully started.
2021-12-19T04:08:32.948Z 	 info: QueueGCManager:marksweep() Get 2 extents.
2021-12-19T04:08:32.948Z 	 info: QueueGCManager:markSweep() Get referred extents, then remove from allExtents.
2021-12-19T04:08:32.949Z 	 info: QueueGCManager:markSweep() Got referred extents, unreferenced extents count is 1.
2021-12-19T04:08:32.949Z 	 info: QueueGCManager:markSweep() Start to delete 1 unreferenced extents.
2021-12-19T04:08:32.949Z 	 debug: FSExtentStore:deleteExtents() Delete extent:4fb1efe8-f9db-4e1e-9f1a-9d837f1433e4 location:Default path:C:\z\Git\joelverhagen\Azurite\__queuestorage__\4fb1efe8-f9db-4e1e-9f1a-9d837f1433e4
2021-12-19T04:08:32.951Z 	 info: Azurite Queue service successfully listens on http://127.0.0.1:10001
2021-12-19T04:08:32.952Z 	 info: Azurite Table service is starting on 127.0.0.1:10002
2021-12-19T04:08:32.952Z 	 info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2021-12-19T04:08:32.952Z 	 info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2021-12-19T04:08:32.953Z 	 info: QueueGCManager:markSweep() Deleted 1 unreferenced extents, after excluding active write extents.
2021-12-19T04:08:32.953Z 	 info: QueueGCManager:markSweepLoop() Mark and sweep finished, take 6ms.
2021-12-19T04:08:32.953Z 	 info: QueueGCManager:markSweepLoop() Sleep for 60000
2021-12-19T04:08:33.041Z 	 info: Azurite Table service successfully listens on http://127.0.0.1:10002
2021-12-19T04:08:35.284Z 551b423b-d7f6-4924-9473-8cb40176e753 info: TableStorageContextMiddleware: RequestMethod=DELETE RequestURL=http://127.0.0.1/devstoreaccount1/Tables('table0') RequestHeaders:{"host":"127.0.0.1:10002","x-ms-version":"2019-02-02","accept":"application/json","x-ms-client-request-id":"56199b27-f50d-4e35-963a-5ba009d10c86","x-ms-return-client-request-id":"true","user-agent":"azsdk-net-Data.Tables/12.3.0 (.NET 6.0.0-rtm.21522.10; Microsoft Windows 10.0.22000)","x-ms-date":"Sun, 19 Dec 2021 04:08:35 GMT","authorization":"SharedKeyLite devstoreaccount1:e491WDZBMkMHXGFyqH5/58+al1pL+29MMahqPxeoi54="} ClientIP=127.0.0.1 Protocol=http HTTPVersion=1.1
2021-12-19T04:08:35.284Z 551b423b-d7f6-4924-9473-8cb40176e753 debug: tableStorageContextMiddleware: Dispatch pattern string: /Tables('table0')
2021-12-19T04:08:35.285Z 551b423b-d7f6-4924-9473-8cb40176e753 info: tableStorageContextMiddleware: Account=devstoreaccount1 tableName=table0
2021-12-19T04:08:35.285Z 551b423b-d7f6-4924-9473-8cb40176e753 verbose: DispatchMiddleware: Dispatching request...
2021-12-19T04:08:35.287Z 551b423b-d7f6-4924-9473-8cb40176e753 info: DispatchMiddleware: Operation=Table_Delete
2021-12-19T04:08:35.287Z 551b423b-d7f6-4924-9473-8cb40176e753 verbose: AuthenticationMiddlewareFactory:createAuthenticationMiddleware() Validating authentications.
2021-12-19T04:08:35.288Z 551b423b-d7f6-4924-9473-8cb40176e753 info: TableSharedKeyLiteAuthenticator:validate() Start validation against account shared key authentication.
2021-12-19T04:08:35.288Z 551b423b-d7f6-4924-9473-8cb40176e753 info: TableSharedKeyLiteAuthenticator:validate() [STRING TO SIGN]:"Sun, 19 Dec 2021 04:08:35 GMT\n/devstoreaccount1/devstoreaccount1/Tables('table0')"
2021-12-19T04:08:35.289Z 551b423b-d7f6-4924-9473-8cb40176e753 info: TableSharedKeyLiteAuthenticator:validate() Calculated authentication header based on key1: SharedKeyLite devstoreaccount1:e491WDZBMkMHXGFyqH5/58+al1pL+29MMahqPxeoi54=
2021-12-19T04:08:35.289Z 551b423b-d7f6-4924-9473-8cb40176e753 info: TableSharedKeyLiteAuthenticator:validate() Signature 1 matched.
2021-12-19T04:08:35.291Z 551b423b-d7f6-4924-9473-8cb40176e753 verbose: DeserializerMiddleware: Start deserializing...
2021-12-19T04:08:35.293Z 551b423b-d7f6-4924-9473-8cb40176e753 info: HandlerMiddleware: DeserializedParameters={"version":"2019-02-02","options":{"requestId":"56199b27-f50d-4e35-963a-5ba009d10c86"}}
2021-12-19T04:08:35.296Z 551b423b-d7f6-4924-9473-8cb40176e753 verbose: SerializerMiddleware: Start serializing...
2021-12-19T04:08:35.298Z 551b423b-d7f6-4924-9473-8cb40176e753 info: EndMiddleware: End response. TotalTimeInMS=15 StatusCode=204 StatusMessage=undefined Headers={"server":"Azurite-Table/3.14.3","content-type":"application/json;odata=minimalmetadata","x-ms-client-request-id":"56199b27-f50d-4e35-963a-5ba009d10c86","x-ms-request-id":"551b423b-d7f6-4924-9473-8cb40176e753","x-ms-version":"2020-10-02","date":"Sun, 19 Dec 2021 04:08:35 GMT"}
2021-12-19T04:08:35.323Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: TableStorageContextMiddleware: RequestMethod=POST RequestURL=http://127.0.0.1/devstoreaccount1/Tables?$format=application%2Fjson%3Bodata%3Dminimalmetadata RequestHeaders:{"host":"127.0.0.1:10002","x-ms-version":"2019-02-02","dataserviceversion":"3.0","accept":"application/json;odata=minimalmetadata","x-ms-client-request-id":"cb930a97-0429-4a5f-8949-6736b630f083","x-ms-return-client-request-id":"true","user-agent":"azsdk-net-Data.Tables/12.3.0 (.NET 6.0.0-rtm.21522.10; Microsoft Windows 10.0.22000)","x-ms-date":"Sun, 19 Dec 2021 04:08:35 GMT","authorization":"SharedKeyLite devstoreaccount1:zcnVCxLiDLSXG6w0W/uEODzFHEW1JFqT0EURG2LCvpg=","content-type":"application/json;odata=nometadata","content-length":"22"} ClientIP=127.0.0.1 Protocol=http HTTPVersion=1.1
2021-12-19T04:08:35.323Z bbcd92ed-6dd1-4094-a76c-390ffb18643e debug: tableStorageContextMiddleware: Dispatch pattern string: /Tables
2021-12-19T04:08:35.323Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: tableStorageContextMiddleware: Account=devstoreaccount1 tableName=undefined
2021-12-19T04:08:35.323Z bbcd92ed-6dd1-4094-a76c-390ffb18643e verbose: DispatchMiddleware: Dispatching request...
2021-12-19T04:08:35.324Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: DispatchMiddleware: Operation=Table_Create
2021-12-19T04:08:35.324Z bbcd92ed-6dd1-4094-a76c-390ffb18643e verbose: AuthenticationMiddlewareFactory:createAuthenticationMiddleware() Validating authentications.
2021-12-19T04:08:35.324Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: TableSharedKeyLiteAuthenticator:validate() Start validation against account shared key authentication.
2021-12-19T04:08:35.324Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: TableSharedKeyLiteAuthenticator:validate() [STRING TO SIGN]:"Sun, 19 Dec 2021 04:08:35 GMT\n/devstoreaccount1/devstoreaccount1/Tables"
2021-12-19T04:08:35.324Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: TableSharedKeyLiteAuthenticator:validate() Calculated authentication header based on key1: SharedKeyLite devstoreaccount1:zcnVCxLiDLSXG6w0W/uEODzFHEW1JFqT0EURG2LCvpg=
2021-12-19T04:08:35.324Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: TableSharedKeyLiteAuthenticator:validate() Signature 1 matched.
2021-12-19T04:08:35.325Z bbcd92ed-6dd1-4094-a76c-390ffb18643e verbose: DeserializerMiddleware: Start deserializing...
2021-12-19T04:08:35.327Z bbcd92ed-6dd1-4094-a76c-390ffb18643e debug: deserialize(): Raw request body string is (removed all empty characters) {"TableName":"table0"}
2021-12-19T04:08:35.328Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: HandlerMiddleware: DeserializedParameters={"options":{"queryOptions":{"format":"application/json;odata=minimalmetadata"},"requestId":"cb930a97-0429-4a5f-8949-6736b630f083","dataServiceVersion":"3.0"},"version":"2019-02-02","tableProperties":{"tableName":"table0"},"body":"ReadableStream"}
2021-12-19T04:08:35.330Z bbcd92ed-6dd1-4094-a76c-390ffb18643e verbose: SerializerMiddleware: Start serializing...
2021-12-19T04:08:35.331Z bbcd92ed-6dd1-4094-a76c-390ffb18643e debug: Serializer: Raw response body string is {"odata.metadata":"http://127.0.0.1:10002/devstoreaccount1/$metadata#Tables/@Element","TableName":"table0"}
2021-12-19T04:08:35.332Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: Serializer: Start returning stream body.
2021-12-19T04:08:35.332Z bbcd92ed-6dd1-4094-a76c-390ffb18643e info: EndMiddleware: End response. TotalTimeInMS=9 StatusCode=201 StatusMessage=Created Headers={"server":"Azurite-Table/3.14.3","content-type":"application/json;odata=minimalmetadata","x-ms-client-request-id":"cb930a97-0429-4a5f-8949-6736b630f083","x-ms-request-id":"bbcd92ed-6dd1-4094-a76c-390ffb18643e","x-ms-version":"2020-10-02","date":"Sun, 19 Dec 2021 04:08:35 GMT","preference-applied":"return-content"}
2021-12-19T04:08:35.377Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: TableStorageContextMiddleware: RequestMethod=POST RequestURL=http://127.0.0.1/devstoreaccount1/$batch RequestHeaders:{"host":"127.0.0.1:10002","x-ms-version":"2019-02-02","dataserviceversion":"3.0","accept":"application/json","x-ms-client-request-id":"81b07a1a-9295-4d41-9cee-0b807554dc91","x-ms-return-client-request-id":"true","user-agent":"azsdk-net-Data.Tables/12.3.0 (.NET 6.0.0-rtm.21522.10; Microsoft Windows 10.0.22000)","x-ms-date":"Sun, 19 Dec 2021 04:08:35 GMT","authorization":"SharedKeyLite devstoreaccount1:RVqsNyOVIEvmrHBwAm3jP9CyPoZfqbFFsV6LLCH06mY=","content-type":"multipart/mixed; boundary=batch_3a7c4dc2-3162-47ab-9f56-36d355c37fc1","content-length":"671"} ClientIP=127.0.0.1 Protocol=http HTTPVersion=1.1
2021-12-19T04:08:35.378Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 debug: tableStorageContextMiddleware: Dispatch pattern string: /$batch
2021-12-19T04:08:35.378Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: tableStorageContextMiddleware: Account=devstoreaccount1 tableName=$batch
2021-12-19T04:08:35.378Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 verbose: DispatchMiddleware: Dispatching request...
2021-12-19T04:08:35.378Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: DispatchMiddleware: Operation=Table_Batch
2021-12-19T04:08:35.378Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 verbose: AuthenticationMiddlewareFactory:createAuthenticationMiddleware() Validating authentications.
2021-12-19T04:08:35.378Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: TableSharedKeyLiteAuthenticator:validate() Start validation against account shared key authentication.
2021-12-19T04:08:35.379Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: TableSharedKeyLiteAuthenticator:validate() [STRING TO SIGN]:"Sun, 19 Dec 2021 04:08:35 GMT\n/devstoreaccount1/devstoreaccount1/$batch"
2021-12-19T04:08:35.379Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: TableSharedKeyLiteAuthenticator:validate() Calculated authentication header based on key1: SharedKeyLite devstoreaccount1:RVqsNyOVIEvmrHBwAm3jP9CyPoZfqbFFsV6LLCH06mY=
2021-12-19T04:08:35.379Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: TableSharedKeyLiteAuthenticator:validate() Signature 1 matched.
2021-12-19T04:08:35.379Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 verbose: DeserializerMiddleware: Start deserializing...
2021-12-19T04:08:35.379Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: HandlerMiddleware: DeserializedParameters={"version":"2019-02-02","options":{"requestId":"81b07a1a-9295-4d41-9cee-0b807554dc91","dataServiceVersion":"3.0"},"multipartContentType":"multipart/mixed; boundary=batch_3a7c4dc2-3162-47ab-9f56-36d355c37fc1","contentLength":671,"body":"ReadableStream"}
2021-12-19T04:08:35.381Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 debug: TableHandler:batch() Raw request string is "--batch_3a7c4dc2-3162-47ab-9f56-36d355c37fc1\r\nContent-Type: multipart/mixed; boundary=changeset_9eb1a7de-6c50-4f41-85d1-e939bbf2c7bd\r\n\r\n--changeset_9eb1a7de-6c50-4f41-85d1-e939bbf2c7bd\r\nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nPATCH http://127.0.0.1:10002/devstoreaccount1/table0(PartitionKey='PK',RowKey='RK1')?$format=application%2Fjson%3Bodata%3Dminimalmetadata HTTP/1.1\r\nHost: 127.0.0.1\r\nx-ms-version: 2019-02-02\r\nDataServiceVersion: 3.0\r\nAccept: application/json\r\nContent-Type: application/json\r\n\r\n{\"PartitionKey\":\"PK\",\"RowKey\":\"RK1\"}\r\n--changeset_9eb1a7de-6c50-4f41-85d1-e939bbf2c7bd--\r\n\r\n--batch_3a7c4dc2-3162-47ab-9f56-36d355c37fc1--\r\n"
2021-12-19T04:08:35.387Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 debug: TableHandler:batch() Raw response string is "--batchresponse_3a7c4dc2-3162-47ab-9f56-36d355c37fc1\r\nContent-Type: multipart/mixed; boundary=changesetresponse_9eb1a7de-6c50-4f41-85d1-e939bbf2c7bd\r\n\r\n--changesetresponse_9eb1a7de-6c50-4f41-85d1-e939bbf2c7bd\r\nContent-Type: application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nHTTP/1.1 404 Not Found\r\nContent-ID: 1\r\nDataServiceVersion: 3.0;\r\nContent-Type: application/json;odata=minimalmetadata;charset=utf-8\r\n\r\n{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:24ce991c-7cee-4c86-aca8-49b6b8cffea2\\nTime:2021-12-19T04:08:35.386Z\"}}}\r\n--changesetresponse_9eb1a7de-6c50-4f41-85d1-e939bbf2c7bd--\r\n--batchresponse_3a7c4dc2-3162-47ab-9f56-36d355c37fc1--\r\n"
2021-12-19T04:08:35.388Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 verbose: SerializerMiddleware: Start serializing...
2021-12-19T04:08:35.388Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: Serializer: Start returning stream body.
2021-12-19T04:08:35.391Z 24ce991c-7cee-4c86-aca8-49b6b8cffea2 info: EndMiddleware: End response. TotalTimeInMS=14 StatusCode=202 StatusMessage=Accepted Headers={"server":"Azurite-Table/3.14.3","content-type":"multipart/mixed; boundary=batchresponse_3a7c4dc2-3162-47ab-9f56-36d355c37fc1","x-ms-request-id":"24ce991c-7cee-4c86-aca8-49b6b8cffea2","x-ms-version":"2020-10-02","date":"Sun, 19 Dec 2021 04:08:35 GMT"}
2021-12-19T04:08:39.699Z 	 info: Azurite Blob service is closing...
2021-12-19T04:08:39.700Z 	 info: Azurite Queue service is closing...
2021-12-19T04:08:39.700Z 	 info: Azurite Table service is closing...
2021-12-19T04:08:39.703Z 	 info: BlobGCManager:close() Start closing BlobGCManager. Set status to Closing.
2021-12-19T04:08:39.704Z 	 info: QueueGCManager:close() Start closing QueueGCManager, set status to Closing.
2021-12-19T04:08:39.704Z 	 info: BlobGCManager:start() Mark and sweep loop is closed.
2021-12-19T04:08:39.704Z 	 info: BlobGCManager:close() BlobGCManager successfully closed. Set status to Closed.
2021-12-19T04:08:39.704Z 	 info: QueueGCManager:start() Mark and sweep loop is closed.
2021-12-19T04:08:39.704Z 	 info: QueueGCManager:close() QueueGCManager successfully closed, set status to Closed.
2021-12-19T04:08:39.704Z 	 info: Azurite Table service successfully closed
2021-12-19T04:08:39.706Z 	 info: Azurite Blob service successfully closed
2021-12-19T04:08:39.706Z 	 info: Azurite Queue service successfully closed

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?

@joelverhagen
Copy link
Contributor Author

joelverhagen commented Dec 19, 2021

Fix appears to be:

diff --git a/src/table/persistence/LokiTableMetadataStore.ts b/src/table/persistence/LokiTableMetadataStore.ts
index b0c6c15..027361a 100644
--- a/src/table/persistence/LokiTableMetadataStore.ts
+++ b/src/table/persistence/LokiTableMetadataStore.ts
@@ -295,7 +295,7 @@ export default class LokiTableMetadataStore implements ITableMetadataStore {
     ifMatch?: string,
     batchID?: string
   ): Promise<Entity> {
-    if (ifMatch === undefined) {
+    if (ifMatch === undefined || ifMatch === "*") {
       // Upsert
       const existingEntity =
         await this.queryTableEntitiesWithPartitionAndRowKey(
@@ -382,7 +382,7 @@ export default class LokiTableMetadataStore implements ITableMetadataStore {
     ifMatch?: string,
     batchID?: string
   ): Promise<Entity> {
-    if (ifMatch === undefined) {
+    if (ifMatch === undefined || ifMatch === "*") {
       // Upsert
       const existingEntity =
         await this.queryTableEntitiesWithPartitionAndRowKey(

@joelverhagen joelverhagen changed the title Table transaction batch upsert merge fails with 404 Table transaction batch upsert merge and upsert replace fails with 404 Dec 19, 2021
edwin-huber added a commit to edwin-huber/Azurite that referenced this issue Jan 18, 2022
@edwin-huber edwin-huber self-assigned this Feb 14, 2022
edwin-huber added a commit that referenced this issue Feb 16, 2022
…ion error handling updated (#1157)

* implement preflight table request and add test cases
* minor change in package.json and removing obsolete comments
* implement batch transaction error handling
* working transaction rollback
* removed unnecessary commented call to metadatastore endBatchTransaction
* updated transaction interface and tests, corrected serial transaction tracking
* fixes #1227 by adding the operation index to odata err msg
* fixes #1228 by adding the updateTableEntity to transaction rollback
* updated batch rollback tests to check etags after update, as noted in #1228
* fixes #1230
* adds wildcard if match to upsert handling addressing #1232
* added if-match check to update and merge handling in batch orchestrator / proxy class
* fixes #1233 added if-match check to update and merge handling in batch orchestrator / proxy class
* updated replaceEntity test to expect upsert and not fail
* renamed replaceEntity test to make test case clear and distinct from others
* corrected handling of if-match, batch rollback and updated raw REST test cases
* cleaned up some tests after pulling and merging main
* modified how we retrieve the account name on a batch request
* corrected SAS tests after changes to upsert logic
* refactoring table tests to make them easier to follow and resolve some issues with promises
* updated test to use arrow functions in LokiTableMetadataStore tests
* removed query entites from batch Orchestrator, added Not Implemented error for service parity
* added test case for query table entities in batch and modified orchestrator to handle that case
* moved BatchId to TableStorageContext
* added test to confirm getServiceProperties response for #121
* updated Edm Type Validation for issue #1259
* modified query tokenization regex for additional whitespacing case
* added a test to confirm behavior deleting entities with empty partition and row keys
* test files renamed for use with npm run table:test + removed comment from handler

Co-authored-by: RunyaoFan <44960511+RunyaoFan@users.noreply.github.com>
@joelverhagen
Copy link
Contributor Author

I have tried the repro on the latest main branch and it no longer reproduces. Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants