{"record":{"id":"2aaa213d5787b3da","repo":"crowdsecurity/crowdsec","slug":"failed-to-check-version-s","errorCode":null,"errorMessage":"failed to check version : %s","messagePattern":"failed to check version : (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/parser/stage.go","lineNumber":124,"sourceCode":"\n\t\t\treturn nil, fmt.Errorf(\"error decoding parsing configuration file '%s': %v\", stageFile.Filename, err)\n\t\t}\n\n\t\t// check for empty bucket\n\t\tif node.Name == \"\" && node.Description == \"\" && node.Author == \"\" {\n\t\t\tlog.Infof(\"Node in %s has no name, author or description. Skipping.\", stageFile.Filename)\n\t\t\tcontinue\n\t\t}\n\n\t\t// check compat\n\t\tif node.FormatVersion == \"\" {\n\t\t\tlog.Tracef(\"no version in %s, assuming '1.0'\", node.Name)\n\t\t\tnode.FormatVersion = \"1.0\"\n\t\t}\n\n\t\tok, err := constraint.Satisfies(node.FormatVersion, constraint.Parser)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to check version : %s\", err)\n\t\t}\n\n\t\tif !ok {\n\t\t\tlog.Errorf(\"%s : %s doesn't satisfy parser format %s, skip\", node.Name, node.FormatVersion, constraint.Parser)\n\t\t\tcontinue\n\t\t}\n\n\t\tnode.Stage = stageFile.Stage\n\t\t// compile the node : grok pattern and expression\n\n\t\terr = node.compile(pctx, ectx)\n\t\tif err != nil {\n\t\t\tif node.Name != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to compile node '%s' in '%s' : %s\", node.Name, stageFile.Filename, err)\n\t\t\t}\n\n\t\t\treturn nil, fmt.Errorf(\"failed to compile node in '%s' : %s\", stageFile.Filename, err)\n\t\t}","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/parser/stage.go#L106-L142","documentation":"Wraps an error from evaluating the parser format-version constraint (constraint.Satisfies) for a node in processStageFile. This is not 'version unsupported' (that path is logged and skipped) — it means the version string itself could not be checked, e.g. constraint parsing or comparison failed internally.","triggerScenarios":"Calling processStageFile (via LoadStages) when constraint.Satisfies(node.FormatVersion, constraint.Parser) returns err — malformed internal constraint or an unparsable FormatVersion reaching the checker despite the earlier defaulting to '1.0'.","commonSituations":"A parser file with a FormatVersion value that slips past the defaulting logic (non-empty but invalid), a corrupted constraint.Parser constant from a bad build, unusual version strings like 'v1.0' or '1.0.0-beta' that the checker cannot compare.","solutions":["Set a plain valid format_version in the parser YAML (e.g. \"1.0\")","Check node.FormatVersion in the file — remove exotic values like 'v1.0'","If the version looks fine, report/inspect constraint.Satisfies — the failure is in the checker itself","Upgrade CrowdSec so the version-constraint library matches the hub expectations"],"exampleFix":"# before\nformat_version: v1.0\n# after\nformat_version: 1.0","handlingStrategy":"validation","validationCode":"v := strings.TrimPrefix(strings.TrimSpace(node.FormatVersion), \"v\")\nif v == \"\" { v = \"1.0\" }\n// only plain x.y / x.y.z values are known-good\nif !regexp.MustCompile(`^\\d+(\\.\\d+){0,2}$`).MatchString(v) {\n    return fmt.Errorf(\"unsupported format_version %q\", node.FormatVersion)\n}","typeGuard":null,"tryCatchPattern":"if _, err := constraint.Satisfies(node.FormatVersion, constraint.Parser); err != nil {\n    log.Warnf(\"bad version in %s: %v\", node.Name, err)\n}","preventionTips":["Always use plain numeric format_version values (e.g. \"1.0\")","Rely on the loader's defaulting rather than inventing version strings","Upgrade CrowdSec if the constraint checker itself errors"],"tags":["parser","version","constraint","config"],"backgroundTag":"invalid-version-constraint","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"}