{"record":{"id":"d618842dd604149d","repo":"dotnet/orleans","slug":"configuration-for-dynamodbgrainstorage-name-is-i-d61884","errorCode":null,"errorMessage":"Configuration for DynamoDBGrainStorage {name} is invalid. ReadCapacityUnits is not valid.","messagePattern":"Configuration for DynamoDBGrainStorage (.+?) is invalid\\. ReadCapacityUnits is not valid\\.","errorType":"validation","errorClass":"OrleansConfigurationException","httpStatus":null,"severity":"error","filePath":"src/AWS/Orleans.Persistence.DynamoDB/Options/DynamoDBStorageOptions.cs","lineNumber":93,"sourceCode":"        /// </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":75,"sourceCodeEnd":103,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AWS/Orleans.Persistence.DynamoDB/Options/DynamoDBStorageOptions.cs#L75-L103","documentation":"Thrown by DynamoDBGrainStorageOptionsValidator.ValidateConfiguration at startup when UseProvisionedThroughput is enabled but ReadCapacityUnits is 0. Provisioned throughput mode requires explicit read/write capacity, so a zero read capacity is treated as misconfiguration.","triggerScenarios":"Configuring DynamoDB storage with options.UseProvisionedThroughput = true while leaving ReadCapacityUnits at its default 0 (or explicitly setting it to 0).","commonSituations":"Switching from on-demand to provisioned billing and forgetting to set capacities; copying options where only WriteCapacityUnits was set; reading capacity from a config key that resolves to 0.","solutions":["Set options.ReadCapacityUnits to a positive value when UseProvisionedThroughput is true.","If you want on-demand billing, leave UseProvisionedThroughput = false so capacity units are not validated.","Confirm the capacity values are populated from configuration before the validator runs."],"exampleFix":"// before\no.UseProvisionedThroughput = true; // ReadCapacityUnits left at 0 -> throws\n\n// after\no.UseProvisionedThroughput = true;\no.ReadCapacityUnits = 50;\no.WriteCapacityUnits = 10;","handlingStrategy":"validation","validationCode":"// If using provisioned throughput, ensure a positive read capacity\nif (options.UseProvisionedThroughput && options.ReadCapacityUnits <= 0)\n    throw new InvalidOperationException(\"Set ReadCapacityUnits > 0 or disable UseProvisionedThroughput.\");","typeGuard":"static bool IsValidProvisioned(DynamoDBStorageOptions o)\n    => !o.UseProvisionedThroughput || o.ReadCapacityUnits > 0;","tryCatchPattern":"null","preventionTips":["When enabling UseProvisionedThroughput, always set both capacity units.","Prefer on-demand mode (UseProvisionedThroughput = false) if you do not need capacities.","Validate capacities against configuration before silo start."],"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"}