{"record":{"id":"128846ca77be8720","repo":"crowdsecurity/crowdsec","slug":"cannot-parse-s3acquisition-configuration-s","errorCode":null,"errorMessage":"cannot parse S3Acquisition configuration: %s","messagePattern":"cannot parse S3Acquisition configuration: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/s3/config.go","lineNumber":111,"sourceCode":"\tcfg, err := config.LoadDefaultConfig(ctx, loadOpts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load aws config: %w\", err)\n\t}\n\n\tvar clientOpts []func(*sqs.Options)\n\tif s.Config.AwsEndpoint != \"\" {\n\t\tclientOpts = append(clientOpts, func(o *sqs.Options) { o.BaseEndpoint = aws.String(s.Config.AwsEndpoint) })\n\t}\n\n\treturn sqs.NewFromConfig(cfg, clientOpts...), nil\n}\n\nfunc (s *Source) UnmarshalConfig(yamlConfig []byte) error {\n\ts.Config = Configuration{}\n\n\terr := yaml.UnmarshalWithOptions(yamlConfig, &s.Config, yaml.Strict())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot parse S3Acquisition configuration: %s\", yaml.FormatError(err, false, false))\n\t}\n\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","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/s3/config.go#L93-L129","documentation":"UnmarshalConfig parses the S3 acquisition yaml with yaml.Strict(), which rejects unknown fields in addition to syntax errors. Any parse failure is formatted and wrapped as 'cannot parse S3Acquisition configuration'.","triggerScenarios":"Loading an S3 acquisition yaml containing a syntax error, wrong indentation, or any key not present in the module's Configuration struct (strict mode).","commonSituations":"Typo'd keys (bucket_nam vs bucket_name); config copied from another acquisition module; keys renamed/deprecated after a crowdsec upgrade; tab/indent mistakes.","solutions":["Read the formatted error message: it names the exact unknown field or syntax problem","Fix the typo or remove the unsupported key","Compare the config against the documented S3 source keys for your crowdsec version","Lint the file with yamllint before deploying"],"exampleFix":"// before\nbucket_nam: my-bucket\n// after\nbucket_name: my-bucket","handlingStrategy":"validation","validationCode":"var cfg s3acquisition.Configuration\nif err := yaml.UnmarshalWithOptions(data, &cfg, yaml.Strict()); err != nil {\n    // fix the yaml before deploying\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate acquisition yaml in CI with a strict unmarshal","Use only documented S3 source keys for your crowdsec version","Run yamllint on config files","Check release notes for renamed/deprecated keys when upgrading"],"tags":["s3","yaml","config"],"backgroundTag":"yaml-parse-error","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"}