{"record":{"id":"8e74c89133c51089","repo":"crowdsecurity/crowdsec","slug":"cannot-parse-s-8e74c8","errorCode":null,"errorMessage":"cannot parse: %s","messagePattern":"cannot parse: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/kubernetesaudit/config.go","lineNumber":31,"sourceCode":"\t\"github.com/crowdsecurity/crowdsec/pkg/metrics\"\n)\n\n// defaultMaxBodySize is the maximum size of a request body, in bytes.\nconst defaultMaxBodySize = int64(10 * 1024 * 1024)\n\ntype Configuration struct {\n\tListenAddr                        string `yaml:\"listen_addr\"`\n\tListenPort                        int    `yaml:\"listen_port\"`\n\tWebhookPath                       string `yaml:\"webhook_path\"`\n\tMaxBodySize                       *int64 `yaml:\"max_body_size\"`\n\tconfiguration.DataSourceCommonCfg `yaml:\",inline\"`\n}\n\nfunc ConfigurationFromYAML(y []byte) (Configuration, error) {\n\tvar cfg Configuration\n\n\tif err := yaml.UnmarshalWithOptions(y, &cfg, yaml.Strict()); err != nil {\n\t\treturn cfg, fmt.Errorf(\"cannot parse: %s\", yaml.FormatError(err, false, false))\n\t}\n\n\tcfg.SetDefaults()\n\tcfg.Normalize()\n\n\terr := cfg.Validate()\n\tif err != nil {\n\t\treturn cfg, err\n\t}\n\n\treturn cfg, nil\n}\n\nfunc (c *Configuration) SetDefaults() {\n\tif c.Mode == \"\" {\n\t\tc.Mode = configuration.TAIL_MODE\n\t}\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/kubernetesaudit/config.go#L13-L49","documentation":"ConfigurationFromYAML for the kubernetesaudit source unmarshals the acquisition YAML in strict mode; invalid YAML or unknown configuration keys cause this parse failure, propagated by UnmarshalConfig.","triggerScenarios":"Thrown at pkg/acquisition/modules/kubernetesaudit/config.go:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the YAML syntax error indicated after 'cannot parse'","Remove unknown or misspelled keys from the source config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}