{"record":{"id":"05f61674bad93558","repo":"crowdsecurity/crowdsec","slug":"plugin-name-s-is-invalid-name-should-be-like-ty","errorCode":null,"errorMessage":"plugin name %s is invalid. Name should be like {type-name}","messagePattern":"plugin name (.+?) is invalid\\. Name should be like (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/csplugin/utils.go","lineNumber":72,"sourceCode":"\tg, err := user.LookupGroup(groupname)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tgid, err := strconv.ParseInt(g.Gid, 10, 32)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif gid < 0 || gid > math.MaxInt32 {\n\t\treturn 0, errors.New(\"out of bound gid\")\n\t}\n\treturn uint32(gid), nil\n}\n\nfunc getPluginTypeAndSubtypeFromPath(path string) (string, string, error) {\n\tpluginFileName := filepath.Base(path)\n\tparts := strings.Split(pluginFileName, \"-\")\n\tif len(parts) < 2 {\n\t\treturn \"\", \"\", fmt.Errorf(\"plugin name %s is invalid. Name should be like {type-name}\", path)\n\t}\n\treturn strings.Join(parts[:len(parts)-1], \"-\"), parts[len(parts)-1], nil\n}\n\nfunc getProcessAttr(username string, groupname string) (*unix.SysProcAttr, error) {\n\tuid, err := getUID(username)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgid, err := getGID(groupname)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &unix.SysProcAttr{\n\t\tCredential: &syscall.Credential{\n\t\t\tUid: uid,\n\t\t\tGid: gid,","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/csplugin/utils.go#L54-L90","documentation":"getPluginTypeAndSubtypeFromPath derives the plugin type and subtype from the binary's file name by splitting on '-' and requiring at least two parts. If the file name has no '-' separator, the {type-name} convention cannot be parsed and this error is returned.","triggerScenarios":"A plugin binary in the plugin directory is named without any '-' in its base name (e.g. /etc/crowdsec/plugins/http instead of /etc/crowdsec/plugins/notification-http), so strings.Split on '-' yields one part.","commonSituations":"Renaming a plugin binary to a shorter name; downloading a plugin whose release artifact name doesn't follow crowdsec's notification-<name> convention; a wrapper script placed in the plugin directory with a custom name.","solutions":["Rename the plugin binary to follow the {type}-{subtype} convention, e.g. notification-http","If it's a third-party plugin, check its docs for the required binary naming scheme and keep the '-' separator","Verify the path configured for the plugin points at the correctly named binary"],"exampleFix":"# before\ncp slack-plugin /etc/crowdsec/plugins/\n# after\ncp slack-plugin /etc/crowdsec/plugins/notification-slack","handlingStrategy":"validation","validationCode":"base := filepath.Base(pluginPath)\nif !strings.Contains(base, \"-\") {\n    return fmt.Errorf(\"plugin binary %q must be named {type}-{name}\", base)\n}","typeGuard":null,"tryCatchPattern":"if err := pluginIsValid(path); err != nil {\n    if strings.Contains(err.Error(), \"is invalid. Name should be like\") {\n        log.Fatalf(\"rename plugin binary to {type}-{name}: %v\", err)\n    }\n    return err\n}","preventionTips":["Name plugin binaries notification-<subtype> (or <type>-<subtype> for other types)","Never rename a plugin binary manually; keep the release artifact name","Document the naming convention in deployment scripts"],"tags":["go","plugin","naming","config"],"backgroundTag":"invalid-identifier-format","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"}