{"record":{"id":"f30227d9879da1f7","repo":"dotnet/orleans","slug":"dataconnectionstring","errorCode":null,"errorMessage":"dataConnectionString","messagePattern":"dataConnectionString","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/AWS/Orleans.Streaming.SQS/Streams/SQSAdapter.cs","lineNumber":28,"sourceCode":"\nnamespace OrleansAWSUtils.Streams\n{\n    internal class SQSAdapter : IQueueAdapter\n    {\n        protected readonly string ServiceId;\n        private readonly Serializer<SQSBatchContainer> serializer;\n        protected readonly string DataConnectionString;\n        private readonly IConsistentRingStreamQueueMapper streamQueueMapper;\n        protected readonly ConcurrentDictionary<QueueId, SQSStorage> Queues = new ConcurrentDictionary<QueueId, SQSStorage>();\n        private readonly ILoggerFactory loggerFactory;\n        public string Name { get; private set; }\n        public bool IsRewindable { get { return false; } }\n\n        public StreamProviderDirection Direction { get { return StreamProviderDirection.ReadWrite; } }\n\n        public SQSAdapter(Serializer<SQSBatchContainer> serializer, IConsistentRingStreamQueueMapper streamQueueMapper, ILoggerFactory loggerFactory, string dataConnectionString, string serviceId, string providerName)\n        {\n            if (string.IsNullOrEmpty(dataConnectionString)) throw new ArgumentNullException(nameof(dataConnectionString));\n            if (string.IsNullOrEmpty(serviceId)) throw new ArgumentNullException(nameof(serviceId));\n            this.loggerFactory = loggerFactory;\n            this.serializer = serializer;\n            DataConnectionString = dataConnectionString;\n            this.ServiceId = serviceId;\n            Name = providerName;\n            this.streamQueueMapper = streamQueueMapper;\n        }\n\n        public IQueueAdapterReceiver CreateReceiver(QueueId queueId)\n        {\n            return SQSAdapterReceiver.Create(this.serializer, this.loggerFactory, queueId, DataConnectionString, this.ServiceId);\n        }\n\n        public async Task QueueMessageBatchAsync<T>(StreamId streamId, IEnumerable<T> events, StreamSequenceToken? token, Dictionary<string, object>? requestContext)\n        {\n            if (token != null)\n            {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AWS/Orleans.Streaming.SQS/Streams/SQSAdapter.cs#L10-L46","documentation":"Thrown by the SQSAdapter constructor when dataConnectionString is null or empty. The connection string carries AWS access key, secret key, and service/region; without it the adapter cannot build SQS clients. The provider fails fast at construction rather than failing later during streaming.","triggerScenarios":"Configuring the SQS stream provider without a DataConnectionString, or passing a null/empty value from a missing configuration section. The adapter is typically constructed by the SQS stream provider from SQSOptions.","commonSituations":"Missing 'DataConnectionString' in appsettings/stream provider config; environment-specific config not loaded (e.g., user secrets in dev); misnamed key; empty value after substitution.","solutions":["Set DataConnectionString in the SQS stream provider configuration (e.g., AddSQSStreams with a valid connection string).","Confirm the config section is bound to SQSOptions and the key name matches exactly.","Load environment-specific config (secrets manager, user secrets) before silo startup.","Validate configuration at startup via IConfigurationValidator so this surfaces early."],"exampleFix":"// before\nsilo.AddSQSStreams(\"SqsProvider\", new SQSOptions()); // no DataConnectionString\n\n// after\nsilo.AddSQSStreams(\"SqsProvider\", new SQSOptions\n{\n    DataConnectionString = \"Service=us-west-2;AccessKey=...;SecretKey=...\"\n});","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(dataConnectionString))\n    throw new ArgumentException(\"SQS DataConnectionString is required.\", nameof(dataConnectionString));","typeGuard":"static bool IsValidSqsConnectionString(string? s) => !string.IsNullOrWhiteSpace(s) && s.Contains('=');","tryCatchPattern":"try { /* construct adapter / host */ }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"dataConnectionString\")\n{\n    logger.LogCritical(\"SQS stream provider is missing DataConnectionString in configuration.\");\n    throw;\n}","preventionTips":["Set DataConnectionString in SQSOptions explicitly.","Validate provider config in an IConfigurationValidator at startup.","Load environment-specific secrets before building the silo."],"tags":["aws","sqs","streaming","configuration","orleans"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}