{"record":{"id":"a6e00ca5667eac8c","repo":"crowdsecurity/crowdsec","slug":"no-appsec-config-found-for-s","errorCode":null,"errorMessage":"no appsec-config found for %s","messagePattern":"no appsec-config found for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/appsec/appsec.go","lineNumber":889,"sourceCode":"\n\treturn out, nil\n}\n\nfunc (wc *AppsecConfig) Load(configName string, hub *cwhub.Hub) error {\n\titem := hub.GetItem(cwhub.APPSEC_CONFIGS, configName)\n\n\tif item != nil && item.State.IsInstalled() {\n\t\twc.Logger.Infof(\"loading %s\", item.State.LocalPath)\n\n\t\terr := wc.LoadByPath(item.State.LocalPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to load appsec-config %s : %s\", item.State.LocalPath, err)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"no appsec-config found for %s\", configName)\n}\n\nfunc (wc *AppsecConfig) Build(ctx context.Context, hub *cwhub.Hub) (*AppsecRuntimeConfig, error) {\n\tret := &AppsecRuntimeConfig{Logger: wc.Logger.WithField(\"component\", \"appsec_runtime_config\")}\n\n\tret.RequestValidator = apivalidation.NewRequestValidator(wc.Logger.WithField(\"component\", \"api_validator\"))\n\n\tif wc.BouncerBlockedHTTPCode == 0 {\n\t\twc.BouncerBlockedHTTPCode = http.StatusForbidden\n\t}\n\n\tif wc.BouncerPassedHTTPCode == 0 {\n\t\twc.BouncerPassedHTTPCode = http.StatusOK\n\t}\n\n\tif wc.UserBlockedHTTPCode == 0 {\n\t\twc.UserBlockedHTTPCode = http.StatusForbidden\n\t}","sourceCodeStart":871,"sourceCodeEnd":907,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/appsec/appsec.go#L871-L907","documentation":"Thrown by AppsecConfigs collection loading in pkg/appsec/appsec.go when a requested appsec-config name does not match any config loaded into the collection. The loader iterates its loaded AppsecConfigs and, if no entry's Name matches the requested configName, returns this error instead of a runtime config. It indicates a name mismatch between what an acquisition/source config references and what exists in the hub/config directory.","triggerScenarios":"Calling the loader's GetBuild/Load function with a configName that was never registered; an appsec_config file failed to load earlier (e.g. YAML parse error) so the name is absent; a typo in the `appsec_config` directive of an appsec acquisition source.","commonSituations":"User references `appsec_config: crowdsecurity/virtual-patching` but only installed the rules collection, not the appsec-config; hub not updated so the config file is missing; case/spelling mismatch in config name; the appsec-config YAML failed validation and was silently skipped.","solutions":["Check the acquisition config `appsec_config:` name and fix typos against names in /etc/crowdsec/appsec-configs/ (or your config dir)","Run `cscli hub update && cscli hub upgrade` and install the appsec-config collection (e.g. `cscli collections install crowdsecurity/appsec-virtual-patching`)","Verify the appsec-config YAML loads by checking crowdsec startup logs for earlier load errors","Confirm appsec_configs_dir is correctly set so the config directory is actually scanned"],"exampleFix":"// before (acquis.yaml)\nappsec_config: crowdsec/virtual-patching\n// after\nappsec_config: crowdsecurity/virtual-patching","handlingStrategy":"validation","validationCode":"name := \"crowdsecurity/virtual-patching\"\nloaded, _ := cscliListAppsecConfigs() // cscli appsec-configs list -o json\nif !slices.Contains(loaded, name) {\n    return fmt.Errorf(\"appsec config %q not installed\", name)\n}","typeGuard":null,"tryCatchPattern":"if err := loadAppsecConfig(name); err != nil {\n    log.Fatalf(\"appsec config %q missing: %v — run: cscli collections install %s\", name, err, name)\n}","preventionTips":["Keep acquisition `appsec_config` names in sync with `cscli appsec-configs list`","Run `cscli hub update && cscli hub upgrade` before deploying configs","Watch startup logs for earlier appsec-config load failures"],"tags":["appsec","config","crowdsec"],"backgroundTag":"entity-not-found","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"}