{"record":{"id":"7bf8c464586bf53d","repo":"crowdsecurity/crowdsec","slug":"no-appsec-rules-found-for-pattern-s","errorCode":null,"errorMessage":"no appsec-rules found for pattern %s","messagePattern":"no appsec-rules found for pattern (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/appsec/appsec_rules_collection.go","lineNumber":200,"sourceCode":"\n\t\tloadSecLangFilesRules(appsecRule, hub, logger, &appsecCol)\n\n\t\tif appsecRule.SecLangRules != nil {\n\t\t\tlogger.Tracef(\"Adding inline rules %+v\", appsecRule.SecLangRules)\n\t\t\tappsecCol.NativeRules = append(appsecCol.NativeRules, appsecRule.SecLangRules...)\n\t\t}\n\n\t\tif err := loadCustomRules(appsecRule, logger, &appsecCol); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tinitRuleData(appsecRule, hub, logger)\n\n\t\tret = append(ret, appsecCol)\n\t}\n\n\tif len(ret) == 0 {\n\t\treturn nil, fmt.Errorf(\"no appsec-rules found for pattern %s\", pattern)\n\t}\n\n\treturn ret, nil\n}\n\nfunc (w AppsecCollection) String() string {\n\tret := \"\"\n\tfor _, rule := range w.Rules {\n\t\tret += rule + \"\\n\"\n\t}\n\n\treturn ret\n}\n","sourceCodeStart":182,"sourceCodeEnd":214,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/appsec/appsec_rules_collection.go#L182-L214","documentation":"After globbing the appsec collections directory for the given pattern, zero appsec collections were loaded — no seclang files, no hub items, no custom rules matched. The pattern (from an appsec config 'load' directive) matched nothing usable, so the runtime has no rules for that config.","triggerScenarios":"Thrown at pkg/appsec/appsec_rules_collection.go:200 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the pattern path in the appsec configuration's load directive (typos, wrong relative base)","Ensure the referenced hub appsec configs are installed (`cscli hub list` / `cscli collections install appsec_*`)","Verify the files inside the matched directory actually contain appsec rules"],"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"}