{"record":{"id":"11f0e5e751ca05ed","repo":"crowdsecurity/crowdsec","slug":"plugin-q-notifier-not-registered","errorCode":null,"errorMessage":"plugin %q: notifier not registered","messagePattern":"plugin %q: notifier not registered","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/csplugin/broker.go","lineNumber":390,"sourceCode":"\treturn raw.(protobufs.NotifierServer), nil\n}\n\nfunc (pb *PluginBroker) tryNotify(ctx context.Context, pluginName, message string) error {\n\t// config guard\n\tpc, ok := pb.pluginConfigByName[pluginName]\n\tif !ok {\n\t\treturn fmt.Errorf(\"plugin %q: config not found\", pluginName)\n\t}\n\n\ttimeout := pc.TimeOut\n\tctxTimeout, cancel := context.WithTimeout(ctx, timeout)\n\n\tdefer cancel()\n\n\t// plugin guard\n\tplugin, ok := pb.notificationPluginByName[pluginName]\n\tif !ok || plugin == nil {\n\t\treturn fmt.Errorf(\"plugin %q: notifier not registered\", pluginName)\n\t}\n\n\t_, err := plugin.Notify(\n\t\tctxTimeout,\n\t\t&protobufs.Notification{\n\t\t\tText: message,\n\t\t\tName: pluginName,\n\t\t},\n\t)\n\n\treturn err\n}\n\nfunc (pb *PluginBroker) pushNotificationsToPlugin(ctx context.Context, pluginName string, alerts []*models.Alert) error {\n\tlogger := log.WithField(\"plugin\", pluginName)\n\n\tlogger.Debugf(\"pushing %d alerts to plugin\", len(alerts))\n","sourceCodeStart":372,"sourceCodeEnd":408,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/csplugin/broker.go#L372-L408","documentation":"tryNotify checks that a registered gRPC client exists in notificationPluginByName before calling Notify; if missing or nil it returns \"plugin %q: notifier not registered\". Config exists, but the plugin binary client was never successfully registered (spawn/Configure failed) or was lost.","triggerScenarios":"tryNotify with a plugin that has a config but no registered client: binary failed to start earlier, Configure failed (805) but processing continued, or plugin process died and the client was removed.","commonSituations":"Plugin binary crashed after startup; startup error for this plugin was logged and crowdsec continued without it; plugin_dir changed between runs; partial Init failure tolerated in a caller that proceeds anyway.","solutions":["Search startup logs for the registration failure of this plugin (e.g. 'while configuring').","Restart crowdsec so loadPlugins re-spawns the plugin binary.","Verify the binary exists, is executable, and matches crowdsec's protobuf API.","Test the plugin manually: run it standalone and check it starts and accepts config."],"exampleFix":"// before: plugin binary removed after install\n$ ls plugins/  # notification-email missing\n// after\nmake build && cp ./plugins/notification-email /usr/local/lib/crowdsec/plugins/ && systemctl restart crowdsec","handlingStrategy":"type-guard","validationCode":"plugin, ok := broker.notificationPluginByName[name]\nif !ok || plugin == nil { /* skip or reschedule */ }","typeGuard":"func isRegistered(m map[string]protobufs.PluginClient, name string) bool {\n    p, ok := m[name]\n    return ok && p != nil\n}","tryCatchPattern":"if !isRegistered(broker.notificationPluginByName, name) {\n    log.Warnf(\"notifier %s not registered; will retry on next alert\", name)\n    return nil\n}","preventionTips":["Monitor crowdsec logs at startup for failed plugin registrations.","Add process supervision/alerting for plugin binaries (they crash independently).","After any Init error, restart crowdsec rather than assuming all plugins registered."],"tags":["plugins","grpc","notifications","runtime"],"backgroundTag":"missing-dependency","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"}