{"record":{"id":"ba45a5afa0cca019","repo":"dotnet/orleans","slug":"configuration-for-dynamodbgrainstorage-name-is-i-ba45a5","errorCode":null,"errorMessage":"Configuration for DynamoDBGrainStorage {name} is invalid. WriteCapacityUnits is not valid.","messagePattern":"Configuration for DynamoDBGrainStorage (.+?) is invalid\\. WriteCapacityUnits is not valid\\.","errorType":"validation","errorClass":"OrleansConfigurationException","httpStatus":null,"severity":"error","filePath":"src/AWS/Orleans.Persistence.DynamoDB/Options/DynamoDBStorageOptions.cs","lineNumber":97,"sourceCode":"        {\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":79,"sourceCodeEnd":103,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AWS/Orleans.Persistence.DynamoDB/Options/DynamoDBStorageOptions.cs#L79-L103","documentation":"Thrown by DynamoDBGrainStorageOptionsValidator.ValidateConfiguration at startup when UseProvisionedThroughput is enabled but WriteCapacityUnits is 0. It is the write-side counterpart to the ReadCapacityUnits check; both must be positive under provisioned throughput.","triggerScenarios":"Configuring DynamoDB storage with options.UseProvisionedThroughput = true and WriteCapacityUnits left at 0 or set to 0.","commonSituations":"Setting only ReadCapacityUnits when enabling provisioned throughput; reading the value from a config key that is absent; migrating from on-demand without setting write capacity.","solutions":["Set options.WriteCapacityUnits to a positive value whenever UseProvisionedThroughput is true.","Use on-demand mode (UseProvisionedThroughput = false) if you do not want to manage capacities.","Validate both capacity values are non-zero in your hosting setup before the silo starts."],"exampleFix":"// before\no.UseProvisionedThroughput = true;\no.ReadCapacityUnits = 50; // WriteCapacityUnits still 0 -> throws\n\n// after\no.UseProvisionedThroughput = true;\no.ReadCapacityUnits = 50;\no.WriteCapacityUnits = 10;","handlingStrategy":"validation","validationCode":"// If using provisioned throughput, ensure a positive write capacity\nif (options.UseProvisionedThroughput && options.WriteCapacityUnits <= 0)\n    throw new InvalidOperationException(\"Set WriteCapacityUnits > 0 or disable UseProvisionedThroughput.\");","typeGuard":"static bool IsValidProvisioned(DynamoDBStorageOptions o)\n    => !o.UseProvisionedThroughput || o.WriteCapacityUnits > 0;","tryCatchPattern":"null","preventionTips":["Set WriteCapacityUnits alongside ReadCapacityUnits when using provisioned throughput.","Use on-demand mode to avoid managing capacities.","Confirm both capacity values resolve from configuration."],"tags":["dynamodb","configuration","validation","aws","persistence","provisioned-throughput"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}