crowdsecurity/crowdsec · error
sqs_name is required when using sqs polling method
Error message
sqs_name is required when using sqs polling method
What it means
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.
Source
Thrown at pkg/acquisition/modules/s3/config.go:139
if s.Config.PollingInterval == 0 {
s.Config.PollingInterval = 60
}
if s.Config.MaxBufferSize == 0 {
s.Config.MaxBufferSize = bufio.MaxScanTokenSize
}
if s.Config.PollingMethod != PollMethodList && s.Config.PollingMethod != PollMethodSQS {
return fmt.Errorf("invalid polling method %s", s.Config.PollingMethod)
}
if s.Config.BucketName != "" && s.Config.SQSName != "" {
return errors.New("bucket_name and sqs_name are mutually exclusive")
}
if s.Config.PollingMethod == PollMethodSQS && s.Config.SQSName == "" {
return errors.New("sqs_name is required when using sqs polling method")
}
if s.Config.BucketName == "" && s.Config.PollingMethod == PollMethodList {
return errors.New("bucket_name is required")
}
if s.Config.SQSFormat != "" && s.Config.SQSFormat != SQSFormatEventBridge && s.Config.SQSFormat != SQSFormatS3Notification && s.Config.SQSFormat != SQSFormatSNS {
return fmt.Errorf("invalid sqs_format %s, must be empty, %s, %s or %s", s.Config.SQSFormat, SQSFormatEventBridge, SQSFormatS3Notification, SQSFormatSNS)
}
return nil
}
func (s *Source) Configure(ctx context.Context, yamlConfig []byte, logger *log.Entry, _ metrics.AcquisitionMetricsLevel) error {
err := s.UnmarshalConfig(yamlConfig)
if err != nil {
return err
}View on GitHub (pinned to 909b515798)
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
Example fix
// before polling_method: sqs // after polling_method: sqs sqs_name: my-queue
Defensive patterns
Strategy: validation
Validate before calling
if cfg.PollingMethod == "sqs" && cfg.SQSName == "" {
return errors.New("sqs_name required for sqs polling")
} Prevention
- Set sqs_name whenever polling_method is sqs
- Check YAML indentation of required keys
- Validate configs with cscli before restart
When it happens
Trigger: An s3 acquisition config with `polling_method: sqs` but empty/missing `sqs_name`, checked in UnmarshalConfig.
Common situations: 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.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- bucket_name and sqs_name are mutually exclusive
- bucket_name is required
- invalid sqs_format %s, must be empty, %s, %s or %s
- path must start with /
- basic_auth is selected, but basic_auth is not provided
AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06).
Data as JSON: /api/errors/90b80b4b0f9cd8e3.
Report an issue: GitHub.