{"record":{"id":"0716509bf55ffbfa","repo":"crowdsecurity/crowdsec","slug":"cannot-parse-s-071650","errorCode":null,"errorMessage":"cannot parse: %s","messagePattern":"cannot parse: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/kubernetes/config.go","lineNumber":31,"sourceCode":"\n\t\"github.com/crowdsecurity/crowdsec/pkg/acquisition/configuration\"\n\t\"github.com/crowdsecurity/crowdsec/pkg/metrics\"\n)\n\ntype Configuration struct {\n\tconfiguration.DataSourceCommonCfg `yaml:\",inline\"`\n\n\tSelector       string `yaml:\"selector\"`\n\tNamespace      string `yaml:\"namespace\"`\n\tKubeConfigFile string `yaml:\"kube_config,omitempty\"`\n\tKubeContext    string `yaml:\"kube_context,omitempty\"`\n}\n\nfunc ConfigurationFromYAML(yamlConfig []byte) (Configuration, error) {\n\tvar cfg Configuration\n\n\tif err := yaml.UnmarshalWithOptions(yamlConfig, &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\n\tif err := cfg.Validate(); err != nil {\n\t\treturn cfg, err\n\t}\n\n\treturn cfg, nil\n}\n\nfunc (c *Configuration) SetDefaults() {\n\tif c.Namespace == \"\" {\n\t\tc.Namespace = \"default\"\n\t}\n\n\tif c.Mode == \"\" {\n\t\tc.Mode = configuration.TAIL_MODE","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/kubernetes/config.go#L13-L49","documentation":"Returned by ConfigurationFromYAML when strict YAML unmarshalling of the kubernetes acquisition configuration fails — for example unknown fields or wrong value types in the datasource YAML. Wraps the underlying yaml error and names the offending config blob.","triggerScenarios":"Thrown at pkg/acquisition/modules/kubernetes/config.go:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix YAML syntax errors reported after 'cannot parse'","Remove unknown/misspelled keys — strict mode rejects them","Compare against documented kubernetes source configuration"],"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-14T05:17:10.506Z"}