{"record":{"id":"06a6117c5d266d3a","repo":"dotnet/orleans","slug":"resource-not-found","errorCode":null,"errorMessage":"Resource not found","messagePattern":"Resource not found","errorType":"exception","errorClass":"RequestFailedException","httpStatus":404,"severity":"warning","filePath":"src/Azure/Shared/Storage/AzureTableDataManager.cs","lineNumber":355,"sourceCode":"        /// Fails if the data does not already exist or if eTag does not match.\n        /// </summary>\n        /// <param name=\"data\">Data entry to be deleted from the table.</param>\n        /// <param name=\"eTag\">ETag to use.</param>\n        /// <returns>Completion promise for this storage operation.</returns>\n        public async Task DeleteTableEntryAsync(T data, ETag eTag)\n        {\n            const string operation = \"DeleteTableEntryAsync\";\n            var startTime = DateTime.UtcNow;\n            LogTraceTableEntry(Logger, operation, data, TableName);\n            try\n            {\n                data.ETag = eTag;\n                try\n                {\n                    var response = await Table.DeleteEntityAsync(data.PartitionKey, data.RowKey, data.ETag);\n                    if (response is { Status: 404 })\n                    {\n                        throw new RequestFailedException(response.Status, \"Resource not found\", response.ReasonPhrase, null);\n                    }\n                }\n                catch (Exception exc)\n                {\n                    LogWarningDeleteTableEntry(Logger, exc, data, TableName);\n                    throw;\n                }\n            }\n            finally\n            {\n                CheckAlertSlowAccess(startTime, operation);\n            }\n        }\n\n        /// <summary>\n        /// Read a single table entry from the storage table.\n        /// </summary>\n        /// <param name=\"partitionKey\">The partition key for the entry.</param>","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Shared/Storage/AzureTableDataManager.cs#L337-L373","documentation":"Thrown by AzureTableDataManager.DeleteTableEntryAsync when Table.DeleteEntityAsync returns HTTP 404 — the entity did not exist at delete time. The code synthesizes an Azure.RequestFailedException(status 404, 'Resource not found') so callers see a consistent exception for a missing resource. Semantically this is an idempotent-delete miss: the row is already gone.","triggerScenarios":"Deleting a table entity that was already deleted, expired, or never inserted; concurrent deleters racing on the same partition/row key; replay after a prior successful delete.","commonSituations":"Grain deactivation racing with another deleter; eventual-consistency replay; cleanup logic running twice; reminders/storage cleanup after data was purged out-of-band.","solutions":["Treat 404 on delete as success (idempotent) by catching RequestFailedException where Status == 404.","If strict existence is required, read-before-delete and handle the not-found case explicitly.","Coordinate concurrent deleters so they do not target the same partition/row key."],"exampleFix":"// before\ntry { await manager.DeleteTableEntryAsync(entity, etag); }\ncatch (Exception) { throw; } // 404 propagates and fails the caller\n// after\ntry { await manager.DeleteTableEntryAsync(entity, etag); }\ncatch (RequestFailedException ex) when (ex.Status == 404) { /* already deleted: idempotent success */ }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static bool IsNotFound(RequestFailedException ex) => ex.Status == 404;","tryCatchPattern":"try { await manager.DeleteTableEntryAsync(entity, etag); }\ncatch (RequestFailedException ex) when (ex.Status == 404) { /* already deleted: treat as success */ }","preventionTips":["Treat 404 on delete as idempotent success.","Coordinate concurrent deleters to avoid races.","Read-before-delete only if strict existence is required."],"tags":["orleans","azure-storage","azure-table","delete","idempotency","not-found"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}