{"record":{"id":"0203e0074b59218e","repo":"hashicorp/nomad","slug":"errpluginnotexists","errorCode":"ErrPluginNotExists","errorMessage":"no such plugin","messagePattern":"no such plugin","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/hostvolumemanager/host_volumes.go","lineNumber":21,"sourceCode":"\npackage hostvolumemanager\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"sync\"\n\n\t\"github.com/hashicorp/go-hclog\"\n\t\"github.com/hashicorp/go-multierror\"\n\tcstructs \"github.com/hashicorp/nomad/client/structs\"\n\t\"github.com/hashicorp/nomad/helper\"\n\t\"github.com/hashicorp/nomad/nomad/structs\"\n)\n\nvar (\n\tErrPluginNotExists     = errors.New(\"no such plugin\")\n\tErrPluginNotExecutable = errors.New(\"plugin not executable\")\n\tErrVolumeNameExists    = errors.New(\"volume name already exists on this node\")\n)\n\n// HostVolumeStateManager manages the lifecycle of volumes in client state.\ntype HostVolumeStateManager interface {\n\tPutDynamicHostVolume(*cstructs.HostVolumeState) error\n\tGetDynamicHostVolumes() ([]*cstructs.HostVolumeState, error)\n\tDeleteDynamicHostVolume(string) error\n}\n\n// Config is used to configure a HostVolumeManager.\ntype Config struct {\n\t// PluginDir is where external plugins may be found.\n\tPluginDir string\n\n\t// VolumesDir is where plugins should place the directory\n\t// that will later become a volume's HostPath","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/hostvolumemanager/host_volumes.go#L3-L39","documentation":"ErrPluginNotExists ('no such plugin') is the sentinel returned when a host-volume or secrets plugin binary cannot be found on disk. Producers wrap it with the plugin name (e.g. fmt.Errorf(\"%w: %q\", ErrPluginNotExists, name)) when the plugin executable does not exist (os.IsNotExist), so callers can errors.Is against it to detect a missing plugin distinctly from other failures.","triggerScenarios":"Creating a host volume or secrets plugin whose configured binary path does not exist on the client: NewExternalSecretsPlugin, NewHostVolumePluginExternal, or TestNewHostVolumePluginExternal hit os.IsNotExist when exec-ing/validating the plugin path from the task/volume config.","commonSituations":"Typo in the plugin binary path in job/volume config, plugin binary not installed or not shipped to the client node, wrong plugin_dir setting, or a job referencing a plugin removed from the node after an upgrade.","solutions":["Verify the plugin binary exists at the configured path on the client node (ls the plugin dir)","Fix the plugin path/name in the volume or secrets configuration","Install/deploy the correct plugin binary to the client's plugin directory","Check permissions and the client's plugin_dir config so the path resolves","Use errors.Is(err, hostvolumemanager.ErrPluginNotExists) in automation to distinguish missing-plugin failures and surface an actionable message"],"exampleFix":"// before\nplugin, err := NewHostVolumePluginExternal(cfg)\nif err != nil { return err }\n// after\nplugin, err := NewHostVolumePluginExternal(cfg)\nif err != nil {\n    if errors.Is(err, hostvolumemanager.ErrPluginNotExists) {\n        return fmt.Errorf(\"host volume plugin %q not found on node; check plugin_dir and config: %w\", cfg.PluginBinary, err)\n    }\n    return err\n}","handlingStrategy":"type-guard","validationCode":"// Before configuring a host volume / secrets plugin, verify the binary exists\nif _, err := os.Stat(pluginBinary); err != nil {\n    if os.IsNotExist(err) {\n        return fmt.Errorf(\"plugin binary %q not found; check plugin_dir and config\", pluginBinary)\n    }\n    return err\n}","typeGuard":"func isPluginNotExists(err error) bool {\n    return errors.Is(err, hostvolumemanager.ErrPluginNotExists)\n}","tryCatchPattern":"plugin, err := NewHostVolumePluginExternal(cfg)\nif err != nil {\n    if errors.Is(err, hostvolumemanager.ErrPluginNotExists) {\n        // handle missing plugin: surface actionable message, don't retry\n        return fmt.Errorf(\"install plugin %q on this node: %w\", cfg.PluginBinary, err)\n    }\n    return err\n}","preventionTips":["Deploy plugin binaries to every client node's plugin_dir before scheduling workloads","Validate plugin paths in job/volume configs during deployment pipelines","Pin and document the plugin binary name so config and filesystem stay in sync","Use errors.Is against ErrPluginNotExists to give precise user-facing diagnostics"],"tags":["plugin","host-volumes","filesystem","nomad"],"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"}