{"record":{"id":"edf2245a3e95493a","repo":"dotnet/orleans","slug":"failed-to-read-table-tablename-exc-message","errorCode":null,"errorMessage":"Failed to read table {tableName}: {exc.Message}","messagePattern":"Failed to read table (.+?): (.+?)","errorType":"exception","errorClass":"OrleansException","httpStatus":null,"severity":"error","filePath":"src/AWS/Shared/Storage/DynamoDBStorage.cs","lineNumber":866,"sourceCode":"                        }\n                    }\n\n                    if (response.LastEvaluatedKey == null || response.LastEvaluatedKey.Count == 0)\n                    {\n                        break;\n                    }\n                    else\n                    {\n                        exclusiveStartKey = response.LastEvaluatedKey;\n                    }\n                }\n\n                return resultList;\n            }\n            catch (Exception exc)\n            {\n                LogWarningFailedToReadTable(_logger, exc, tableName);\n                throw new OrleansException($\"Failed to read table {tableName}: {exc.Message}\", exc);\n            }\n        }\n\n        /// <summary>\n        /// Crete or replace multiple entries in a DynamoDB table (Batch put)\n        /// </summary>\n        /// <param name=\"tableName\">The name of the table to search for the entry</param>\n        /// <param name=\"toCreate\">List of key values for each entry that must be created or replaced in the batch</param>\n        /// <returns></returns>\n        public Task PutEntriesAsync(string tableName, IReadOnlyCollection<Dictionary<string, AttributeValue>> toCreate)\n        {\n            LogTracePutEntries(_logger, tableName);\n\n            if (toCreate == null) throw new ArgumentNullException(nameof(toCreate));\n\n            if (toCreate.Count == 0)\n                return Task.CompletedTask;\n","sourceCodeStart":848,"sourceCodeEnd":884,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AWS/Shared/Storage/DynamoDBStorage.cs#L848-L884","documentation":"Thrown by the DynamoDB read/scan path when any exception escapes the paged ScanAsync loop while reading a table. The library logs the underlying exception and re-throws it wrapped in a generic OrleansException so callers see a single error type for arbitrary DynamoDB read failures. The inner exception carries the real cause.","triggerScenarios":"Produced during a paginated consistent-read Scan used by clustering/persistence/reminders lookups when ScanAsync throws. Triggered by DynamoDB throttling (ProvisionedThroughputExceededException), a missing table (ResourceNotFoundException surfaced as inner), network/timeout errors, auth errors, or item-size/expression errors.","commonSituations":"Read capacity exceeded on a provisioned table; transient network blips to DynamoDB; expired/invalid credentials surfacing during a read; a table that was deleted while the silo was running; malformed filter expressions.","solutions":["Inspect the inner Exception (exc.Message is included in the text) to identify throttling, auth, or ResourceNotFound.","If throttling: raise read capacity or switch the table to PAY_PER_REQUEST / on-demand.","If the table is missing, recreate it (or re-run Init so the provider recreates it).","For transient errors, rely on Orleans' built-in retries or add a caller-side retry policy around the read."],"exampleFix":"// The exception wraps the real cause; surface the inner exception for diagnosis\n// before\ntry { await storage.Read...; } catch (OrleansException e) { log.Error(e.Message); }\n\n// after\ntry { await storage.Read...(); }\ncatch (OrleansException e) when (e.InnerException is ProvisionedThroughputExceededException)\n{\n    // raise capacity or switch to on-demand, then retry\n}","handlingStrategy":"try-catch","validationCode":"// Pre-flight: confirm the table exists and has read capacity headroom before heavy reads\nvar desc = await DescribeExistingTableAsync(tableName);\nif (desc is null) throw new InvalidOperationException($\"Table {tableName} does not exist\");","typeGuard":"static bool IsReadableFailure(Exception inner) => inner switch\n{\n    ProvisionedThroughputExceededException => true,\n    ResourceNotFoundException => true,\n    AmazonDynamoDBException => true,\n    _ => false\n};","tryCatchPattern":"try { await storage.ReadAllAsync(...); }\ncatch (OrleansException ox) when (ox.InnerException is ProvisionedThroughputExceededException)\n{\n    _logger.LogWarning(\"DynamoDB read throttled; raising read capacity or retrying\");\n    throw;\n}","preventionTips":["Provision enough read capacity (or use on-demand) for your scan workload.","Inspect the inner exception to distinguish throttling from missing-table/auth errors.","Avoid full-table scans; use Query with a partition key when possible.","Add a retry policy with backoff/jitter around read-heavy paths."],"tags":["dynamodb","read","scan","throttling","io"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}