{"record":{"id":"d1fead38d2cea3b1","repo":"crowdsecurity/crowdsec","slug":"invalid-polling-method-s","errorCode":null,"errorMessage":"invalid polling method %s","messagePattern":"invalid polling method (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/s3/config.go","lineNumber":131,"sourceCode":"\n\tif s.Config.Mode == \"\" {\n\t\ts.Config.Mode = configuration.TAIL_MODE\n\t}\n\n\tif s.Config.PollingMethod == \"\" {\n\t\ts.Config.PollingMethod = PollMethodList\n\t}\n\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","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/s3/config.go#L113-L149","documentation":"The polling_method config key is validated against the module's enum: only the values matching PollMethodList ('list') and PollMethodSQS ('sqs') are accepted. Any other string fails this check at the end of UnmarshalConfig.","triggerScenarios":"Setting polling_method in the S3 acquisition yaml to a misspelled, wrongly-cased, or invented value such as 'sqs_polling', 'LIST', or 'scan'.","commonSituations":"Copy-pasting config from other tools' documentation; assuming case-insensitivity; guessing values instead of using the two documented ones.","solutions":["Set polling_method to exactly `list` (poll bucket_name directly) or `sqs` (consume sqs_name)","Fix the value's spelling and case to match the enum exactly","If unsure, consult the module's Configuration struct or docs for the accepted strings"],"exampleFix":"// before\npolling_method: sqs_polling\n// after\npolling_method: sqs","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"list\": true, \"sqs\": true}\nif pm != \"\" && !allowed[pm] {\n    return fmt.Errorf(\"polling_method must be list or sqs, got %q\", pm)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use the documented enum values, exact case","Choose `list` with bucket_name, `sqs` with sqs_name","Review the module's Configuration struct when in doubt"],"tags":["s3","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-14T00:17:10.932Z"}