{"record":{"id":"5982d0c3424257b6","repo":"dotnet/orleans","slug":"configuration-for-dynamodbgrainstorage-name-is-i","errorCode":null,"errorMessage":"Configuration for DynamoDBGrainStorage {name} is invalid. TableName is not valid.","messagePattern":"Configuration for DynamoDBGrainStorage (.+?) is invalid\\. TableName is not valid\\.","errorType":"validation","errorClass":"OrleansConfigurationException","httpStatus":null,"severity":"error","filePath":"src/AWS/Orleans.Persistence.DynamoDB/Options/DynamoDBStorageOptions.cs","lineNumber":87,"sourceCode":"    {\n        private readonly DynamoDBStorageOptions options;\n        private readonly string name;\n\n        /// <summary>\n        /// Constructor\n        /// </summary>\n        /// <param name=\"options\">The option to be validated.</param>\n        /// <param name=\"name\">The option name to be validated.</param>\n        public DynamoDBGrainStorageOptionsValidator(DynamoDBStorageOptions options, string name)\n        {\n            this.options = options;\n            this.name = name;\n        }\n\n        public void ValidateConfiguration()\n        {\n            if (string.IsNullOrWhiteSpace(this.options.TableName))\n                throw new OrleansConfigurationException(\n                    $\"Configuration for DynamoDBGrainStorage {this.name} is invalid. {nameof(this.options.TableName)} is not valid.\");\n\n            if (this.options.UseProvisionedThroughput)\n            {\n                if (this.options.ReadCapacityUnits == 0)\n                    throw new OrleansConfigurationException(\n                        $\"Configuration for DynamoDBGrainStorage {this.name} is invalid. {nameof(this.options.ReadCapacityUnits)} is not valid.\");\n\n                if (this.options.WriteCapacityUnits == 0)\n                    throw new OrleansConfigurationException(\n                        $\"Configuration for DynamoDBGrainStorage {this.name} is invalid. {nameof(this.options.WriteCapacityUnits)} is not valid.\");\n            }\n        }\n    }\n}\n","sourceCodeStart":69,"sourceCodeEnd":103,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AWS/Orleans.Persistence.DynamoDB/Options/DynamoDBStorageOptions.cs#L69-L103","documentation":"Thrown by DynamoDBGrainStorageOptionsValidator.ValidateConfiguration during silo startup when the TableName on DynamoDBStorageOptions is null, empty, or whitespace. Orleans runs configuration validators before the silo accepts clients, so this fails the host fast rather than at the first grain write.","triggerScenarios":"Registering DynamoDB grain storage (e.g. AddDynamoDBGrainStorage / UseDynamoDBGrainStorage) without setting options.TableName, or setting it to an empty string.","commonSituations":"Reading TableName from a missing config key/environment variable; a typo in the options lambda; copying a storage registration block and forgetting to rename the table.","solutions":["Set options.TableName to a non-empty DynamoDB table name when configuring the storage provider.","If the name comes from configuration, verify that config key exists and is non-empty (log it during startup without leaking credentials).","Create the table in DynamoDB beforehand if auto-create is off."],"exampleFix":"// before\nsilo.AddDynamoDBGrainStorage(\"storage\", o => { /* TableName omitted */ });\n\n// after\nsilo.AddDynamoDBGrainStorage(\"storage\", o => { o.TableName = \"OrleansGrainState\"; o.Service = ...; });","handlingStrategy":"validation","validationCode":"// Assert the table name is set before starting the silo\nif (string.IsNullOrWhiteSpace(options.TableName))\n    throw new InvalidOperationException(\"Set DynamoDBStorageOptions.TableName before silo start.\");","typeGuard":"static bool HasTableName(DynamoDBStorageOptions o) => !string.IsNullOrWhiteSpace(o.TableName);","tryCatchPattern":"null","preventionTips":["Always set TableName in the options lambda.","Pull the table name from a known config key and assert it is non-empty at startup.","Pre-create the DynamoDB table if auto-create is disabled."],"tags":["dynamodb","configuration","validation","aws","persistence"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}