dotnet/orleans · error · OrleansConfigurationException

Invalid {nameof(AdoNetReminderTableOptions)} values for {nam

Error message

Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. {nameof(options.Invariant)} is required.

What it means

Thrown by the ADO.NET reminders options validator when Invariant is null or whitespace. AdoNetReminderTableOptions.Invariant has no default, so it must be set explicitly for the reminder service to know which database driver and query dialect to use.

Source

Thrown at src/AdoNet/Orleans.Reminders.AdoNet/ReminderService/AdoNetReminderTableOptionsValidator.cs:24

{
    /// <summary>
    /// Validates <see cref="AdoNetReminderTableOptions"/> configuration.
    /// </summary>
    public class AdoNetReminderTableOptionsValidator : IConfigurationValidator
    {
        private readonly AdoNetReminderTableOptions options;
        
        public AdoNetReminderTableOptionsValidator(IOptions<AdoNetReminderTableOptions> options)
        {
            this.options = options.Value;
        }

        /// <inheritdoc />
        public void ValidateConfiguration()
        {
            if (string.IsNullOrWhiteSpace(this.options.Invariant))
            {
                throw new OrleansConfigurationException($"Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. {nameof(options.Invariant)} is required.");
            }

            if (string.IsNullOrWhiteSpace(this.options.ConnectionString) == (this.options.DataSource is null))
            {
                throw new OrleansConfigurationException($"Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. Configure exactly one of {nameof(options.ConnectionString)} or {nameof(options.DataSource)}.");
            }
        }
    }
}

View on GitHub (pinned to fca799fa70)

Solutions

  1. Set options.Invariant = AdoNetInvariants.InvariantNameSqlServer (or the relevant driver).
  2. Use the UseAdoNetReminders overload that accepts a configure delegate and set Invariant there.
  3. Ensure the reminders section in appsettings.json contains an Invariant key.

Example fix

// before
builder.UseAdoNetReminders(o =>
{
    o.ConnectionString = "Server=.;Database=Orleans;";
});

// after
builder.UseAdoNetReminders(o =>
{
    o.Invariant = AdoNetInvariants.InvariantNameSqlServer;
    o.ConnectionString = "Server=.;Database=Orleans;";
});
Defensive patterns

Strategy: validation

Validate before calling

static void CheckReminderInvariant(AdoNetReminderTableOptions o)
{
    if (string.IsNullOrWhiteSpace(o.Invariant))
        throw new InvalidOperationException("AdoNetReminderTableOptions.Invariant is required.");
}

Prevention

When it happens

Trigger: ValidateConfiguration() runs on AdoNetReminderTableOptions with a blank Invariant. Triggered at host startup when UseAdoNetReminders is registered without setting Invariant.

Common situations: Registering reminders with only a connection string; assuming the reminder table shares the clustering Invariant; copy-paste from storage config that has a default Invariant.

Related errors


AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13). Data as JSON: /api/errors/270452afec3bf255. Report an issue: GitHub.