{"record":{"id":"97e56dc168b15b40","repo":"crowdsecurity/crowdsec","slug":"bucket-name-is-required","errorCode":null,"errorMessage":"bucket_name is required","messagePattern":"bucket_name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/s3/config.go","lineNumber":143,"sourceCode":"\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}\n\n\tif s.Config.SQSName != \"\" {\n\t\ts.logger = logger.WithFields(log.Fields{\n\t\t\t\"queue\": s.Config.SQSName,","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/s3/config.go#L125-L161","documentation":"Validation in the S3 datasource's UnmarshalConfig: bucket_name is empty while the polling method is list. In list mode the module must enumerate objects directly from a bucket, so the bucket name is the identifying anchor; in sqs mode the bucket is derived from events and this check does not apply.","triggerScenarios":"An s3 acquisition config with `polling_method: list` (the default) and an empty/missing `bucket_name`, checked in UnmarshalConfig.","commonSituations":"Omitting bucket_name assuming it's optional, a typo (bucket), or YAML nesting placing bucket_name outside the parsed config block.","solutions":["Add `bucket_name: my-bucket` to the s3 source config","Set polling_method: sqs with sqs_name instead if you consume event notifications","Verify key spelling and indentation"],"exampleFix":"// before\nsource: s3\npolling_method: list\n// after\nsource: s3\npolling_method: list\nbucket_name: my-bucket","handlingStrategy":"validation","validationCode":"if (cfg.PollingMethod == \"\" || cfg.PollingMethod == \"list\") && cfg.BucketName == \"\" {\n    return errors.New(\"bucket_name required for list polling\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set bucket_name for list mode","Spell keys exactly (bucket_name)","Validate acquisition configs before deployment"],"tags":["config","s3","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"}