dotnet/orleans · error · OrleansConfigurationException
Configuration for DynamoDBGrainStorage {name} is invalid. Wr
Error message
Configuration for DynamoDBGrainStorage {name} is invalid. WriteCapacityUnits is not valid. What it means
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.
Source
Thrown at src/AWS/Orleans.Persistence.DynamoDB/Options/DynamoDBStorageOptions.cs:97
{
this.options = options;
this.name = name;
}
public void ValidateConfiguration()
{
if (string.IsNullOrWhiteSpace(this.options.TableName))
throw new OrleansConfigurationException(
$"Configuration for DynamoDBGrainStorage {this.name} is invalid. {nameof(this.options.TableName)} is not valid.");
if (this.options.UseProvisionedThroughput)
{
if (this.options.ReadCapacityUnits == 0)
throw new OrleansConfigurationException(
$"Configuration for DynamoDBGrainStorage {this.name} is invalid. {nameof(this.options.ReadCapacityUnits)} is not valid.");
if (this.options.WriteCapacityUnits == 0)
throw new OrleansConfigurationException(
$"Configuration for DynamoDBGrainStorage {this.name} is invalid. {nameof(this.options.WriteCapacityUnits)} is not valid.");
}
}
}
}
View on GitHub (pinned to fca799fa70)
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.
Example fix
// before o.UseProvisionedThroughput = true; o.ReadCapacityUnits = 50; // WriteCapacityUnits still 0 -> throws // after o.UseProvisionedThroughput = true; o.ReadCapacityUnits = 50; o.WriteCapacityUnits = 10;
Defensive patterns
Strategy: validation
Validate before calling
// If using provisioned throughput, ensure a positive write capacity
if (options.UseProvisionedThroughput && options.WriteCapacityUnits <= 0)
throw new InvalidOperationException("Set WriteCapacityUnits > 0 or disable UseProvisionedThroughput."); Type guard
static bool IsValidProvisioned(DynamoDBStorageOptions o)
=> !o.UseProvisionedThroughput || o.WriteCapacityUnits > 0; Try / catch
null
Prevention
- Set WriteCapacityUnits alongside ReadCapacityUnits when using provisioned throughput.
- Use on-demand mode to avoid managing capacities.
- Confirm both capacity values resolve from configuration.
When it happens
Trigger: Configuring DynamoDB storage with options.UseProvisionedThroughput = true and WriteCapacityUnits left at 0 or set to 0.
Common situations: 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.
Related errors
- Configuration for DynamoDBGrainStorage {name} is invalid. Re
- Configuration for DynamoDBGrainStorage {name} is invalid. Ta
- Data too large to write to DynamoDB table. Size={dataSize} M
- Configuration for DynamoDBTransactionalStateStorage {this.na
- Configuration for DynamoDBTransactionalStateStorage {this.na
AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13).
Data as JSON: /api/errors/ba45a5afa0cca019.
Report an issue: GitHub.