{"record":{"id":"8a2164ba80f611b7","repo":"crowdsecurity/crowdsec","slug":"invalid-sqs-format-s-must-be-empty-s-s-or-s","errorCode":null,"errorMessage":"invalid sqs_format %s, must be empty, %s, %s or %s","messagePattern":"invalid sqs_format (.+?), must be empty, (.+?), (.+?) or (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/s3/config.go","lineNumber":147,"sourceCode":"\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}\n\n\tif s.Config.SQSName != \"\" {\n\t\ts.logger = logger.WithFields(log.Fields{\n\t\t\t\"queue\": s.Config.SQSName,\n\t\t})\n\t} else {\n\t\ts.logger = logger.WithFields(log.Fields{\n\t\t\t\"bucket\": s.Config.BucketName,","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/s3/config.go#L129-L165","documentation":"When set, sqs_format must equal one of the module's format constants (event_bridge, s3_notification, sns); empty is allowed for auto-detection. Any other value fails this validation in UnmarshalConfig.","triggerScenarios":"Configuring an SQS-polled S3 source with sqs_format holding an unsupported string such as 'cloudwatch', 'EventBridge' (wrong case/spacing), or a legacy name.","commonSituations":"Confusing AWS console terminology ('EventBridge pump') with the expected enum string; typos; using format names from older module versions that predate SNS support.","solutions":["Set sqs_format to exactly one of: event_bridge, s3_notification, sns (strings shown in the error)","Or remove sqs_format entirely (empty) to let the source auto-detect the message format","Match the format to how your bucket actually publishes: EventBridge rule, direct S3 notification, or S3 notification via SNS"],"exampleFix":"// before\nsqs_format: cloudwatch\n// after\nsqs_format: s3_notification","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"event_bridge\": true, \"s3_notification\": true, \"sns\": true}\nif f != \"\" && !allowed[f] {\n    return fmt.Errorf(\"sqs_format must be empty, event_bridge, s3_notification or sns, got %q\", f)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit sqs_format to rely on auto-detection unless detection misfires","Match sqs_format to the actual bucket event publishing mechanism","Copy the exact strings from the error message or docs"],"tags":["s3","sqs","config","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}