{"record":{"id":"a3e3db72cfe509f7","repo":"crowdsecurity/crowdsec","slug":"failed-to-compile-node-s-in-s-s","errorCode":null,"errorMessage":"failed to compile node '%s' in '%s' : %s","messagePattern":"failed to compile node '(.+?)' in '(.+?)' : (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/parser/stage.go","lineNumber":138,"sourceCode":"\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}\n\t\t/* if the stage is empty, the node is empty, it's a trailing entry in users yaml file */\n\t\tif node.Stage == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, data := range node.Data {\n\t\t\terr = exprhelpers.FileInit(pctx.DataFolder, data.DestPath, data.Type)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(err.Error())\n\t\t\t}\n\n\t\t\tif data.Type == \"regexp\" { // cache only makes sense for regexp\n\t\t\t\tif err = exprhelpers.RegexpCacheInit(data.DestPath, *data); err != nil {\n\t\t\t\t\tlog.Error(err.Error())","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/parser/stage.go#L120-L156","documentation":"Wraps an error from node.compile() while loading a parser stage file in processStageFile. The node's YAML was valid, but compiling its filter/grok/stash failed (see errors 1211/1212). The message includes the node name and file when known, so the offending parser entry is directly locatable.","triggerScenarios":"Calling processStageFile (via LoadStages) when node.compile(pctx, ectx) returns an error: uncompilable filter expression, bad grok pattern definitions, or failing stash compilation for that node.","commonSituations":"Third-party/custom parsers with expr or grok syntax errors, hub updates referencing expr helpers absent in the installed CrowdSec version, local overrides with an invalid filter that break stage loading at startup.","solutions":["Read the wrapped error — it names the failing filter/grok/stash (see also errors 1211/1212)","Test the parser file in isolation with `cscli hubtool test` on a sample log","Fix the offending expression/pattern in the YAML, or reinstall the parser from the hub","If a hub parser fails after a CrowdSec upgrade, `cscli hub update && cscli hub upgrade` to get compatible parser versions"],"exampleFix":"# before (node with broken filter blocks startup)\nfilter: evt.Parsed.foo =~\n# after\nfilter: evt.Parsed.foo contains 'bar'","handlingStrategy":"try-catch","validationCode":"// pre-compile check before install\nvar node parser.Node\n// ... yaml decode ...\nif err := node.compile(pctx, ectx); err != nil {\n    return fmt.Errorf(\"parser not installable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if _, err := processStageFile(sf, pctx, ectx); err != nil {\n    log.Errorf(\"stage %s failed to load: %v\", sf.Stage, err)\n    return nil, err\n}","preventionTips":["Run cscli hubtool test on parsers before deploying to production","After CrowdSec upgrades, upgrade the hub so parser expressions match available helpers","Keep custom parser filters minimal and unit-tested via TestParserConfigs"],"tags":["parser","compilation","config","startup"],"backgroundTag":"invalid-config-value","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"}