{"record":{"id":"5edd478f10a30197","repo":"dotnet/orleans","slug":"configuration-for-dynamodbtransactionalstatestorag-5edd47","errorCode":null,"errorMessage":"Configuration for DynamoDBTransactionalStateStorage {this.name} is invalid. WriteCapacityUnits is not valid.","messagePattern":"Configuration for DynamoDBTransactionalStateStorage (.+?) is invalid\\. WriteCapacityUnits is not valid\\.","errorType":"exception","errorClass":"OrleansConfigurationException","httpStatus":null,"severity":"error","filePath":"src/AWS/Orleans.Transactions.DynamoDB/Options/DynamoDBTransactionalStorageOptions.cs","lineNumber":108,"sourceCode":"        this.options = options;\n        this.name = name;\n    }\n\n    /// <inheritdoc />\n    public void ValidateConfiguration()\n    {\n        if (string.IsNullOrWhiteSpace(this.options.TableName))\n            throw new OrleansConfigurationException(\n                $\"Configuration for DynamoDBTransactionalStateStorage {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 DynamoDBTransactionalStateStorage {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 DynamoDBTransactionalStateStorage {this.name} is invalid. {nameof(this.options.WriteCapacityUnits)} is not valid.\");\n        }\n    }\n}\n","sourceCodeStart":90,"sourceCodeEnd":113,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AWS/Orleans.Transactions.DynamoDB/Options/DynamoDBTransactionalStorageOptions.cs#L90-L113","documentation":"Thrown by DynamoDBTransactionalStorageOptionsValidator.ValidateConfiguration when UseProvisionedThroughput is true but WriteCapacityUnits is 0. Same rationale as the read-units check: provisioned DynamoDB tables require a positive write capacity, and the validator enforces it at startup.","triggerScenarios":"Enabling UseProvisionedThroughput while leaving WriteCapacityUnits at default 0, or explicitly zeroing it. Validator runs at configuration validation during host/silo build.","commonSituations":"Template/config sets provisioned mode but omits write units; switching billing modes without updating capacity; assuming write units default to a sane non-zero value (they do not).","solutions":["Set WriteCapacityUnits to a positive value whenever UseProvisionedThroughput is true.","Use on-demand mode (UseProvisionedThroughput = false) if capacity planning is unwanted.","Base the value on transaction commit write load and DynamoDB throttling metrics.","Add a startup assertion that both capacity units are > 0 when provisioned."],"exampleFix":"// before\nopt.UseProvisionedThroughput = true; // WriteCapacityUnits default 0 -> validator throws\n\n// after\nopt.UseProvisionedThroughput = true;\nopt.ReadCapacityUnits = 50;\nopt.WriteCapacityUnits = 25;","handlingStrategy":"validation","validationCode":"if (options.UseProvisionedThroughput && options.WriteCapacityUnits <= 0)\n    throw new OrleansConfigurationException(\"WriteCapacityUnits must be > 0 when provisioned.\");","typeGuard":null,"tryCatchPattern":"try { /* build silo */ }\ncatch (OrleansConfigurationException ex) when (ex.Message.Contains(\"WriteCapacityUnits\"))\n{\n    logger.LogCritical(\"Set DynamoDB WriteCapacityUnits > 0 or disable provisioned throughput.\");\n    throw;\n}","preventionTips":["Set WriteCapacityUnits when enabling provisioned throughput.","Base the value on observed commit write load.","Assert both capacity units are > 0 in your deployment checks."],"tags":["aws","dynamodb","transactions","configuration","orleans"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}