{"record":{"id":"9e49f5a6c9c055ca","repo":"crowdsecurity/crowdsec","slug":"config-file-for-plugin-s-not-found","errorCode":null,"errorMessage":"config file for plugin %s not found","messagePattern":"config file for plugin (.+?) not found","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/csplugin/broker.go","lineNumber":256,"sourceCode":"\t\t\t\tlog.Warningf(\"notification '%s' is defined multiple times\", pluginConfig.Name)\n\t\t\t}\n\n\t\t\tpb.pluginConfigByName[pluginConfig.Name] = pluginConfig\n\t\t\tif !pb.profilesContainPlugin(pluginConfig.Name) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\n\treturn pb.verifyPluginConfigsWithProfile()\n}\n\n// checks whether every notification in profile has its own config file\nfunc (pb *PluginBroker) verifyPluginConfigsWithProfile() error {\n\tfor _, profileCfg := range pb.profileConfigs {\n\t\tfor _, pluginName := range profileCfg.Notifications {\n\t\t\tif _, ok := pb.pluginConfigByName[pluginName]; !ok {\n\t\t\t\treturn fmt.Errorf(\"config file for plugin %s not found\", pluginName)\n\t\t\t}\n\n\t\t\tpb.pluginsTypesToDispatch[pb.pluginConfigByName[pluginName].Type] = struct{}{}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// check whether each plugin in profile has its own binary\nfunc (pb *PluginBroker) verifyPluginBinaryWithProfile() error {\n\tfor _, profileCfg := range pb.profileConfigs {\n\t\tfor _, pluginName := range profileCfg.Notifications {\n\t\t\tif _, ok := pb.notificationPluginByName[pluginName]; !ok {\n\t\t\t\treturn fmt.Errorf(\"binary for plugin %s not found\", pluginName)\n\t\t\t}\n\t\t}\n\t}","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/csplugin/broker.go#L238-L274","documentation":"verifyPluginConfigsWithProfile checks that every notification named in profiles.yaml has a corresponding config file in the notification dir. If a profile references a plugin name that has no pluginConfigByName entry, this error aborts loadConfig. It is a cross-file consistency check between profiles and notification configs.","triggerScenarios":"PluginBroker.Init -> loadConfig, after loading notification configs: a profile lists a notification (e.g. email_default) whose yaml is absent, misnamed, or failed to parse and was skipped.","commonSituations":"Enabled a notification in /etc/crowdsec/profiles.yaml but never created its config under notifications/; typo between profile notification name and the yaml `name:` field; notification config file not installed (hub notifications not installed).","solutions":["Ensure names match exactly: profile.yaml `notifications:` entries must equal the `name:` field in a notification yaml.","Install missing notification configs (cscli hub update && cscli hub install notification-*).","Check the config file loaded without error — a parse failure (802) also leaves the name unregistered.","Remove the notification from profiles.yaml if you do not actually use it."],"exampleFix":"// before: profiles.yaml references missing notification\nnotifications:\n  - slack_default   # no notifications/slack_default.yaml\n// after: install slack config or fix the name to match an existing yaml","handlingStrategy":"validation","validationCode":"// cross-check profile notifications against loaded configs\nfor _, n := range profileNotifications {\n    if _, ok := loadedConfigs[n]; !ok {\n        log.Warnf(\"profile notification %s has no config file\", n)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := broker.Init(ctx, cfg); err != nil {\n    if strings.Contains(err.Error(), \"config file for plugin\") {\n        // extract plugin name, check notifications/ dir for matching yaml\n    }\n    return err\n}","preventionTips":["Always install the notification config (cscli hub install notification-*) before enabling it in profiles.yaml.","Keep names identical between profiles.yaml and notification yaml `name:`.","Grep profiles.yaml notifications after upgrades to re-check they still exist."],"tags":["config","notifications","profiles","consistency"],"backgroundTag":"config-file-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"}