{"record":{"id":"e78be96b30fc9540","repo":"dotnet/orleans","slug":"invalid-nameof-adonetstreamoptions-values-for-a-e78be9","errorCode":null,"errorMessage":"Invalid {nameof(AdoNetStreamOptions)} values for ADO.NET Streaming Provider '{name}': {nameof(options.DeadLetterEvictionTimeout)} must be greater than zero.","messagePattern":"Invalid (.+?) values for ADO\\.NET Streaming Provider '(.+?)': (.+?) must be greater than zero\\.","errorType":"validation","errorClass":"OrleansConfigurationException","httpStatus":null,"severity":"error","filePath":"src/AdoNet/Orleans.Streaming.AdoNet/AdoNetStreamOptionsValidator.cs","lineNumber":45,"sourceCode":"\n        if (options.VisibilityTimeout < TimeSpan.Zero)\n        {\n            throw new OrleansConfigurationException($\"Invalid {nameof(AdoNetStreamOptions)} values for ADO.NET Streaming Provider '{name}': {nameof(options.VisibilityTimeout)} must be greater than zero.\");\n        }\n\n        if (options.EvictionInterval < TimeSpan.Zero)\n        {\n            throw new OrleansConfigurationException($\"Invalid {nameof(AdoNetStreamOptions)} values for ADO.NET Streaming Provider '{name}': {nameof(options.EvictionInterval)} must be greater than zero.\");\n        }\n\n        if (options.ExpiryTimeout < TimeSpan.Zero)\n        {\n            throw new OrleansConfigurationException($\"Invalid {nameof(AdoNetStreamOptions)} values for ADO.NET Streaming Provider '{name}': {nameof(options.ExpiryTimeout)} must be greater than zero.\");\n        }\n\n        if (options.DeadLetterEvictionTimeout < TimeSpan.Zero)\n        {\n            throw new OrleansConfigurationException($\"Invalid {nameof(AdoNetStreamOptions)} values for ADO.NET Streaming Provider '{name}': {nameof(options.DeadLetterEvictionTimeout)} must be greater than zero.\");\n        }\n\n        if (options.EvictionBatchSize < 0)\n        {\n            throw new OrleansConfigurationException($\"Invalid {nameof(AdoNetStreamOptions)} values for ADO.NET Streaming Provider '{name}': {nameof(options.EvictionBatchSize)} must be greater than zero.\");\n        }\n    }\n}","sourceCodeStart":27,"sourceCodeEnd":53,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AdoNet/Orleans.Streaming.AdoNet/AdoNetStreamOptionsValidator.cs#L27-L53","documentation":"Thrown by the ADO.NET streaming options validator when DeadLetterEvictionTimeout is negative. This timeout is how long a failed message lives in the dead-letter table before deletion. The check is `< TimeSpan.Zero`, so zero is accepted though the message says 'greater than zero'.","triggerScenarios":"ValidateConfiguration() runs on AdoNetStreamOptions with DeadLetterEvictionTimeout < TimeSpan.Zero. The default is 7 days, so this only fires if it was explicitly set negative.","commonSituations":"Setting DeadLetterEvictionTimeout to a negative TimeSpan; mistyping a duration string in config; computing the value with a sign error.","solutions":["Set options.DeadLetterEvictionTimeout to a positive TimeSpan greater than ExpiryTimeout (e.g. the default 7 days).","Check the appsettings.json string format and sign.","Use TimeSpan.FromDays to set it explicitly."],"exampleFix":"// before\nbuilder.AddAdoNetStreams(\"ads\", o =>\n{\n    o.DeadLetterEvictionTimeout = TimeSpan.FromDays(-7);\n});\n\n// after\nbuilder.AddAdoNetStreams(\"ads\", o =>\n{\n    o.DeadLetterEvictionTimeout = TimeSpan.FromDays(7);\n});","handlingStrategy":"validation","validationCode":"static void CheckDeadLetterEvictionTimeout(AdoNetStreamOptions o)\n{\n    if (o.DeadLetterEvictionTimeout < TimeSpan.Zero)\n        throw new InvalidOperationException(\"AdoNetStreamOptions.DeadLetterEvictionTimeout must be non-negative and greater than ExpiryTimeout.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep DeadLetterEvictionTimeout positive and larger than ExpiryTimeout (default 7 days).","Use TimeSpan.FromDays with explicit positive values.","Add a config test asserting the ordering of stream eviction timeouts."],"tags":["configuration","adonet","streaming","eviction","startup-validation"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}