{"record":{"id":"90b80b4b0f9cd8e3","repo":"crowdsecurity/crowdsec","slug":"sqs-name-is-required-when-using-sqs-polling-method","errorCode":null,"errorMessage":"sqs_name is required when using sqs polling method","messagePattern":"sqs_name is required when using sqs polling method","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/s3/config.go","lineNumber":139,"sourceCode":"\n\tif s.Config.PollingInterval == 0 {\n\t\ts.Config.PollingInterval = 60\n\t}\n\n\tif s.Config.MaxBufferSize == 0 {\n\t\ts.Config.MaxBufferSize = bufio.MaxScanTokenSize\n\t}\n\n\tif s.Config.PollingMethod != PollMethodList && s.Config.PollingMethod != PollMethodSQS {\n\t\treturn fmt.Errorf(\"invalid polling method %s\", s.Config.PollingMethod)\n\t}\n\n\tif s.Config.BucketName != \"\" && s.Config.SQSName != \"\" {\n\t\treturn errors.New(\"bucket_name and sqs_name are mutually exclusive\")\n\t}\n\n\tif s.Config.PollingMethod == PollMethodSQS && s.Config.SQSName == \"\" {\n\t\treturn errors.New(\"sqs_name is required when using sqs polling method\")\n\t}\n\n\tif s.Config.BucketName == \"\" && s.Config.PollingMethod == PollMethodList {\n\t\treturn errors.New(\"bucket_name is required\")\n\t}\n\n\tif s.Config.SQSFormat != \"\" && s.Config.SQSFormat != SQSFormatEventBridge && s.Config.SQSFormat != SQSFormatS3Notification && s.Config.SQSFormat != SQSFormatSNS {\n\t\treturn fmt.Errorf(\"invalid sqs_format %s, must be empty, %s, %s or %s\", s.Config.SQSFormat, SQSFormatEventBridge, SQSFormatS3Notification, SQSFormatSNS)\n\t}\n\n\treturn nil\n}\n\nfunc (s *Source) Configure(ctx context.Context, yamlConfig []byte, logger *log.Entry, _ metrics.AcquisitionMetricsLevel) error {\n\terr := s.UnmarshalConfig(yamlConfig)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/s3/config.go#L121-L157","documentation":"Validation in the S3 datasource's UnmarshalConfig: polling_method is sqs (SQS-event-driven ingestion) but sqs_name is unset. With SQS polling, the queue is the trigger source — without its name the module cannot subscribe to any queue. Note bucket_name and sqs_name are themselves mutually exclusive; this check fires only when the name is missing in sqs mode.","triggerScenarios":"An s3 acquisition config with `polling_method: sqs` but empty/missing `sqs_name`, checked in UnmarshalConfig.","commonSituations":"Switching polling_method to sqs without adding the queue name, YAML indentation putting sqs_name outside the source block, or a typo like sqs_queue_name.","solutions":["Add `sqs_name: my-queue` to the s3 source config","Revert polling_method to `list` if you meant direct bucket polling","Check key spelling and indentation of the sqs_name field"],"exampleFix":"// before\npolling_method: sqs\n// after\npolling_method: sqs\nsqs_name: my-queue","handlingStrategy":"validation","validationCode":"if cfg.PollingMethod == \"sqs\" && cfg.SQSName == \"\" {\n    return errors.New(\"sqs_name required for sqs polling\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set sqs_name whenever polling_method is sqs","Check YAML indentation of required keys","Validate configs with cscli before restart"],"tags":["config","s3","sqs","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}