{"record":{"id":"b2c01de0b71492ec","repo":"dotnet/orleans","slug":"dataconnectionstring-b2c01d","errorCode":null,"errorMessage":"dataConnectionString","messagePattern":"dataConnectionString","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/AWS/Orleans.Streaming.SQS/Streams/SQSAdapterReceiver.cs","lineNumber":31,"sourceCode":"{\n    /// <summary>\n    /// Receives batches of messages from a single partition of a message queue.\n    /// </summary>\n    internal partial class SQSAdapterReceiver : IQueueAdapterReceiver\n    {\n        private SQSStorage? queue;\n        private long lastReadMessage;\n        private Task? outstandingTask;\n        private readonly ILogger logger;\n        private readonly Serializer<SQSBatchContainer> serializer;\n\n\n        public QueueId Id { get; private set; }\n\n        public static IQueueAdapterReceiver Create(Serializer<SQSBatchContainer> serializer, ILoggerFactory loggerFactory, QueueId queueId, string dataConnectionString, string serviceId)\n        {\n            if (queueId.IsDefault) throw new ArgumentNullException(nameof(queueId));\n            if (string.IsNullOrEmpty(dataConnectionString)) throw new ArgumentNullException(nameof(dataConnectionString));\n            if (string.IsNullOrEmpty(serviceId)) throw new ArgumentNullException(nameof(serviceId));\n\n            var queue = new SQSStorage(loggerFactory, queueId.ToString(), dataConnectionString, serviceId);\n            return new SQSAdapterReceiver(serializer, loggerFactory, queueId, queue);\n        }\n\n        private SQSAdapterReceiver(Serializer<SQSBatchContainer> serializer, ILoggerFactory loggerFactory, QueueId queueId, SQSStorage queue)\n        {\n            if (queueId.IsDefault) throw new ArgumentNullException(nameof(queueId));\n            if (queue == null) throw new ArgumentNullException(nameof(queue));\n\n            Id = queueId;\n            this.queue = queue;\n            logger = loggerFactory.CreateLogger<SQSAdapterReceiver>();\n            this.serializer = serializer;\n        }\n\n        public Task Initialize(TimeSpan timeout)","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AWS/Orleans.Streaming.SQS/Streams/SQSAdapterReceiver.cs#L13-L49","documentation":"Thrown by SQSAdapterReceiver.Create when dataConnectionString is null or empty. The receiver needs AWS connectivity info (region/credentials) to construct its underlying SQSStorage; an empty string cannot be parsed into access key, secret key, or service region.","triggerScenarios":"Creating an SQSAdapterReceiver without passing a valid connection string, usually because the adapter forwarded a null/empty DataConnectionString from misconfigured SQSOptions.","commonSituations":"Missing DataConnectionString in stream provider config; the adapter's DataConnectionString field was never set; config binding silently produced an empty string; environment-specific config not loaded.","solutions":["Provide a valid DataConnectionString in SQSOptions before the receiver is created.","Verify the stream provider configuration section is bound correctly at silo startup.","Add an IConfigurationValidator that checks DataConnectionString is non-empty.","Confirm secrets/env vars are resolved into the connection string before hosting builds the receiver."],"exampleFix":"// before\nvar rcv = SQSAdapterReceiver.Create(serializer, lf, queueId, \"\", svc); // throws\n\n// after\nvar rcv = SQSAdapterReceiver.Create(serializer, lf, queueId, connStr, svc);","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);","tryCatchPattern":"try { /* create receiver */ }\ncatch (ArgumentNullException ex) when (ex.ParamName == \"dataConnectionString\")\n{\n    logger.LogCritical(\"SQS receiver missing DataConnectionString.\");\n    throw;\n}","preventionTips":["Bind SQSOptions.DataConnectionString before the host builds receivers.","Add a config validator for non-empty DataConnectionString.","Confirm secrets/env vars are resolved into the connection string."],"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"}