{"record":{"id":"c9dec91e68293e53","repo":"crowdsecurity/crowdsec","slug":"couldn-t-find-custom-postoverflow-s-in-the-foll","errorCode":null,"errorMessage":"couldn't find custom postoverflow '%s' in the following location: %+v","messagePattern":"couldn't find custom postoverflow '(.+?)' in the following location: %\\+v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/hubtest/postoverflow.go","lineNumber":91,"sourceCode":"\t\treturn false, fmt.Errorf(\"unable to copy custom parser '%s' to '%s': %w\", customPostOverflowPath, customPostoverflowDest, err)\n\t}\n\n\treturn true, nil\n}\n\nfunc (t *HubTestItem) installPostoverflowCustom(postoverflow string) error {\n\tfor _, customPath := range t.CustomItemsLocation {\n\t\tfound, err := t.installPostoverflowCustomFrom(postoverflow, customPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif found {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"couldn't find custom postoverflow '%s' in the following location: %+v\", postoverflow, t.CustomItemsLocation)\n}\n\nfunc (t *HubTestItem) installPostoverflow(name string) error {\n\tif hubPostOverflow := t.HubIndex.GetItem(cwhub.POSTOVERFLOWS, name); hubPostOverflow != nil {\n\t\treturn t.installPostoverflowItem(hubPostOverflow)\n\t}\n\n\treturn t.installPostoverflowCustom(name)\n}\n","sourceCodeStart":73,"sourceCodeEnd":101,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/hubtest/postoverflow.go#L73-L101","documentation":"installPostoverflowCustom in pkg/hubtest installs a custom (locally-authored, not from the hub) postoverflow for a hub test. It iterates over t.CustomItemsLocation directories looking for a file whose name matches the requested postoverflow; if none of those directories contain a matching item, it returns this error. It means the test referenced a custom postoverflow that does not exist under any of the configured custom item locations.","triggerScenarios":"Calling installPostoverflow (via HubTestItem test loading) with a postoverflow name that is not found in the hub index and not found in any directory listed in t.CustomItemsLocation.","commonSituations":"Typo in the postoverflow name in the test's .tests config; the custom postoverflow yaml lives in a directory not added to CustomItemsLocation; the file was renamed or deleted; tests run from a different working directory so relative custom paths don't resolve.","solutions":["Verify the postoverflow file name matches exactly (including extension) the name passed to the test.","Add the directory containing the custom postoverflow to the test's CustomItemsLocation.","If the postoverflow comes from the hub instead, ensure 'cscli hub update'/'cscli postoverflows install' has been run so it appears in the hub index.","Run the test from the repository root / correct cwd so relative custom locations resolve."],"exampleFix":"// before\ninstallPostoverflowCustom(t, \"my-pos\") // file is at ./custom/my-postoverflow.yaml\n// after\n// rename the file to ./custom/my-pos.yaml or pass \"my-postoverflow\"\ninstallPostoverflowCustom(t, \"my-postoverflow\")","handlingStrategy":"validation","validationCode":"for _, loc := range item.CustomItemsLocation {\n\tif _, err := os.Stat(filepath.Join(loc, postoverflow+\".yaml\")); err == nil {\n\t\t// safe to call installPostoverflow\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := t.installPostoverflow(name); err != nil {\n\tif strings.Contains(err.Error(), \"couldn't find custom postoverflow\") {\n\t\tlog.Warnf(\"custom postoverflow %q missing, skipping: %v\", name, err)\n\t\treturn nil\n\t}\n\treturn err\n}","preventionTips":["Keep custom postoverflow filenames identical to the names referenced in test configs.","Always register custom item directories in CustomItemsLocation before running tests.","Run tests from a stable working directory with relative paths resolved."],"tags":["crowdsec","hub","postoverflow","testing"],"backgroundTag":"resource-not-found","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"}