dotnet/orleans · error · OrleansConfigurationException
Named option AzureBlobLeaseProviderOptions of name {name} is
Error message
Named option AzureBlobLeaseProviderOptions of name {name} is invalid. Name cannot be empty or whitespace. What it means
Thrown by AzureBlobLeaseProviderOptionsValidator.ValidateConfiguration() when the options name is non-null but empty or whitespace. The validator allows null names (converted to string.Empty in the constructor) but considers empty/whitespace non-null names invalid. Note: the constructor sets this.name = name ?? string.Empty, so a null name becomes empty string and this check WILL fire on it — meaning effectively any empty or whitespace name triggers the error.
Source
Thrown at src/Azure/Orleans.Streaming.AzureStorage/Options/AzureBlobLeaseProviderOptions.cs:150
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="options">The option to be validated.</param>
/// <param name="name">The option name to be validated.</param>
private AzureBlobLeaseProviderOptionsValidator(AzureBlobLeaseProviderOptions options, string? name)
{
this.options = options;
this.name = name ?? string.Empty;
}
public void ValidateConfiguration()
{
// name can be null, but not empty or white space.
if(this.name != null && string.IsNullOrWhiteSpace(this.name))
{
throw new OrleansConfigurationException($"Named option {nameof(AzureBlobLeaseProviderOptions)} of name {this.name} is invalid. Name cannot be empty or whitespace.");
}
if (this.options.CreateClient is null)
{
throw new OrleansConfigurationException($"No credentials specified for Azure Blob Service lease provider \"{name}\". Use the {options.GetType().Name}.{nameof(AzureBlobLeaseProviderOptions.ConfigureBlobServiceClient)} method to configure the Azure Blob Service client.");
}
try
{
AzureBlobUtils.ValidateContainerName(this.options.BlobContainerName);
}
catch (ArgumentException e)
{
var errorStr = string.IsNullOrEmpty(this.name)
? $"Configuration for {nameof(AzureBlobLeaseProviderOptions)} {this.name} is invalid. {nameof(this.options.BlobContainerName)} is not valid"
: $"Configuration for {nameof(AzureBlobLeaseProviderOptions)} is invalid. {nameof(this.options.BlobContainerName)} is not valid";
throw new OrleansConfigurationException(errorStr , e);
}View on GitHub (pinned to fca799fa70)
Solutions
- Register the AzureBlobLeaseProvider with a non-empty, non-whitespace name.
- If using Orleans streaming, ensure the stream provider name is non-empty and flows through to the lease provider options.
- Check the AddAzureBlobLeaseProvider or equivalent registration call — pass an explicit non-empty name string.
- Avoid passing string.Empty or null as the options name.
Example fix
// before: empty name
siloBuilder.AddAzureBlobLeaseProvider("", o => { ... });
// after: non-empty name
siloBuilder.AddAzureBlobLeaseProvider("blobLeases", o => { ... }); Defensive patterns
Strategy: validation
Validate before calling
// Verify the lease provider name is non-empty before registration
var leaseProviderName = "blobLeases";
if (string.IsNullOrWhiteSpace(leaseProviderName))
throw new InvalidOperationException("Lease provider name must be non-empty and non-whitespace.");
siloBuilder.AddAzureBlobLeaseProvider(leaseProviderName, o => { ... }); Try / catch
try { await host.StartAsync(ct); }
catch (OrleansConfigurationException ex) when (ex.Message.Contains("Name cannot be empty or whitespace"))
{
logger.LogCritical(ex, "Lease provider name is empty — provide a non-empty name.");
throw;
} Prevention
- Always pass a non-empty, non-whitespace name to AddAzureBlobLeaseProvider.
- Avoid using string.Empty or null as a provider name.
- Use a naming convention for streaming providers that guarantees non-empty names.
- Be aware the constructor converts null to empty string, so null names WILL trigger this error.
When it happens
Trigger: Fires during ValidateConfiguration() when this.name is a non-null, empty-or-whitespace string. Since the constructor converts null to string.Empty, any null or empty name passed to the validator will trigger this. This typically means the lease provider options were registered with an empty name.
Common situations: A streaming provider or lease provider registered without a name (or with an explicit empty string). Orleans default options name is often empty string "" — if the validator is wired for that default name, this fires. Mismatch between the name used to register the provider and the expected name.
Related errors
- Configuration for AzureBlobLeaseProviderOptions {name} is in
- Configuration for AzureBlobLeaseProviderOptions is invalid.
- No credentials specified for Azure Blob Service lease provid
- No credentials specified. Use the AzureBlobStorageOptions.Co
- Configuration for AzureBlobStorageOptions {name} is invalid.
AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13).
Data as JSON: /api/errors/f285f751237bd649.
Report an issue: GitHub.