{"record":{"id":"a4651d7dadbfb4a6","repo":"hashicorp/nomad","slug":"plugin-s-for-type-s-not-found","errorCode":null,"errorMessage":"plugin %s for type %s not found","messagePattern":"plugin (.+?) for type (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/dynamicplugins/registry.go","lineNumber":405,"sourceCode":"\t}\n\n\t// After initially loading the dispenser (to avoid masking missing setup in\n\t// client/client.go), we then check to see if we have any stub dispensers for\n\t// this plugin type. If we do, then replace the dispenser fn with the stub.\n\tif d.stubDispensers != nil {\n\t\tif stub, ok := d.stubDispensers[ptype]; ok {\n\t\t\tdispenseFunc = stub\n\t\t}\n\t}\n\n\tpmap, ok := d.plugins[ptype]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"no plugins registered for type: %s\", ptype)\n\t}\n\n\tinfo, ok := pmap[name]\n\tif !ok || info.Front() == nil {\n\t\treturn nil, fmt.Errorf(\"plugin %s for type %s not found\", name, ptype)\n\t}\n\n\treturn dispenseFunc(info.Front().Value.(*PluginInfo))\n}\n\nfunc (d *dynamicRegistry) PluginForAlloc(ptype, name, allocID string) (*PluginInfo, error) {\n\td.pluginsLock.Lock()\n\tdefer d.pluginsLock.Unlock()\n\n\tpmap, ok := d.plugins[ptype]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"no plugins registered for type: %s\", ptype)\n\t}\n\n\tinfos, ok := pmap[name]\n\tif ok {\n\t\tfor e := infos.Front(); e != nil; e = e.Next() {\n\t\t\tplugin := e.Value.(*PluginInfo)","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/dynamicplugins/registry.go#L387-L423","documentation":"DispensePlugin found the plugins map for the type but the specific named plugin is missing from it, or the list entry for that name is empty (info.Front() == nil). This means plugins of the type exist, but not the named instance requested. It is the name-scoped variant of the not-registered family.","triggerScenarios":"Calling DispensePlugin(ptype, name) where ptype is registered but name is not present in pmap, or the entry's list is empty (plugin was deregistered, e.g. its allocation exited).","commonSituations":"Requesting a CSI controller/volume by a name that differs from the registered plugin name (case or suffix mismatch); the plugin allocation was rescheduled/stopped so its registration was removed; stale references in task config to an old plugin name.","solutions":["Confirm the exact plugin name used at RegisterPlugin time (check the plugin's job/alloc and the client registry logs).","Check the plugin allocation is running; if it stopped, restart it so the plugin re-registers.","Correct the name in the caller's config (task/volume/CSI config) to match the registered plugin ID.","If a race with deregistration is possible, handle the error by waiting/retrying rather than failing the task hard."],"exampleFix":"// before\n_, err := registry.DispensePlugin(\"csi-controller\", \"ebs-prod\") // wrong plugin ID\n// after\n_, err := registry.DispensePlugin(\"csi-controller\", \"aws-ebs\") // matches RegisterPlugin name","handlingStrategy":"validation","validationCode":"if name == \"\" {\n    return fmt.Errorf(\"plugin name must be set before dispensing %s\", ptype)\n}\n// optionally list registered names for the type and validate membership\nfor _, p := range registry.PluginsUpdatedCh(ptype) { /* use events to track known names */ }","typeGuard":null,"tryCatchPattern":"p, err := registry.DispensePlugin(ptype, name)\nif err != nil {\n    var target *dynamicplugins.PluginInfo\n    if strings.Contains(err.Error(), \"not found\") {\n        return fmt.Errorf(\"plugin %q of type %q is not registered (check the plugin job is running and the name matches): %w\", name, ptype, err)\n    }\n    return err\n}","preventionTips":["Source plugin names from the same config/job values used to register them - avoid hand-typed duplicates.","Watch PluginsUpdatedCh for deregistration events and invalidate cached references.","Log the list of registered plugin names on startup to make name mismatches obvious."],"tags":["plugin-registry","nomad","go","lookup-miss"],"backgroundTag":"plugin-not-found","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}