{"record":{"id":"cd0d9a0e8bfc3868","repo":"crowdsecurity/crowdsec","slug":"stash-s-w","errorCode":null,"errorMessage":"stash %s: %w","messagePattern":"stash (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/parser/node.go","lineNumber":469,"sourceCode":"\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif n.Grok.RegexpName != \"\" || n.Grok.RegexpValue != \"\" || n.Grok.ExpValue != \"\" {\n\t\trg, err := n.Grok.Compile(pctx, n.Logger)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tn.RuntimeGrok = *rg\n\t\tvalid = true\n\t}\n\n\tfor _, stash := range n.Stashes {\n\t\tcompiled, err := stash.Compile(n.Logger)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"stash %s: %w\", stash.Name, err)\n\t\t}\n\t\tn.RuntimeStashes = append(n.RuntimeStashes, *compiled)\n\t}\n\n\t/* compile leafs if present */\n\tfor idx := range n.LeavesNodes {\n\t\tif n.LeavesNodes[idx].Name == \"\" {\n\t\t\tn.LeavesNodes[idx].Name = \"child-\" + n.Name\n\t\t}\n\n\t\t// propagate debug/stats to child nodes\n\t\tif !n.LeavesNodes[idx].Debug && n.Debug {\n\t\t\tn.LeavesNodes[idx].Debug = true\n\t\t}\n\n\t\tif !n.LeavesNodes[idx].Profiling && n.Profiling {\n\t\t\tn.LeavesNodes[idx].Profiling = true\n\t\t}","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/parser/node.go#L451-L487","documentation":"Wraps an error from compiling one of a node's stash entries during node.compile(). The %s is the stash's Name, and %w is the underlying error from stash.Compile(n.Logger) (typically a failed expr compilation of the stash's expressions). It identifies which named stash failed so the offending parser config can be fixed.","triggerScenarios":"Calling node.compile() (from processStageFile or TestParserConfigs) when a stash's expressions cannot be compiled by expr — bad syntax, unknown functions, or type errors in the stash expression list.","commonSituations":"Hub parser updates introducing expressions incompatible with the local CrowdSec/expr version, hand-edited stashes, whitelists/stash expressions referencing non-existent helpers.","solutions":["Read the wrapped error for the exact failing expression inside the named stash","Fix or remove the offending expression in the parser YAML stash entry","Pin/upgrade CrowdSec so the expr helpers used by the hub config exist","Re-run TestParserConfigs or `cscli hubtool` to confirm"],"exampleFix":"# before\nstash:\n  - name: wl\n    expressions:\n      - Get('foo'\n# after (balanced, compilable)\nstash:\n  - name: wl\n    expressions:\n      - Get('foo') != nil","handlingStrategy":"validation","validationCode":"for _, stash := range node.Stashes {\n    if _, err := stash.Compile(logger); err != nil {\n        return fmt.Errorf(\"stash %q not compilable: %w\", stash.Name, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := node.compile(pctx, ectx); err != nil {\n    if strings.Contains(err.Error(), \"stash \") { /* isolate named stash and fix its expressions */ }\n    return err\n}","preventionTips":["Compile each stash expression in CI (TestParserConfigs)","Avoid helpers not present in your installed CrowdSec version","Keep stash expressions simple and independently testable"],"tags":["parser","expr","compilation","stash"],"backgroundTag":"invalid-regex-pattern","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"}