{"record":{"id":"1bdfc33120d17a73","repo":"hashicorp/nomad","slug":"missing-policy-name","errorCode":null,"errorMessage":"missing policy name","messagePattern":"missing policy name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/acl.go","lineNumber":36,"sourceCode":"// ACLPolicies returns a new handle on the ACL policies.\nfunc (c *Client) ACLPolicies() *ACLPolicies {\n\treturn &ACLPolicies{client: c}\n}\n\n// List is used to dump all of the policies.\nfunc (a *ACLPolicies) List(q *QueryOptions) ([]*ACLPolicyListStub, *QueryMeta, error) {\n\tvar resp []*ACLPolicyListStub\n\tqm, err := a.client.query(\"/v1/acl/policies\", &resp, q)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn resp, qm, nil\n}\n\n// Upsert is used to create or update a policy\nfunc (a *ACLPolicies) Upsert(policy *ACLPolicy, q *WriteOptions) (*WriteMeta, error) {\n\tif policy == nil || policy.Name == \"\" {\n\t\treturn nil, errors.New(\"missing policy name\")\n\t}\n\twm, err := a.client.put(\"/v1/acl/policy/\"+policy.Name, policy, nil, q)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn wm, nil\n}\n\n// Delete is used to delete a policy\nfunc (a *ACLPolicies) Delete(policyName string, q *WriteOptions) (*WriteMeta, error) {\n\tif policyName == \"\" {\n\t\treturn nil, errors.New(\"missing policy name\")\n\t}\n\twm, err := a.client.delete(\"/v1/acl/policy/\"+policyName, nil, nil, q)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn wm, nil","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/api/acl.go#L18-L54","documentation":"controllerUnpublishVolume found no CSI plugin in the Nomad state store matching vol.PluginID. The volume references a plugin that has been deregistered or never registered, so the detach cannot proceed. Nomad returns this instead of silently skipping the unpublish.","triggerScenarios":"Unpublish (claim release, job stop, node drain) on a volume whose plugin was deregistered via `nomad plugin status`/CSIPlugin.Deregister, or whose PluginID was misspelled/vanished after plugin GC while claims still exist.","commonSituations":"Operators deregister a CSI plugin that still has volumes with outstanding claims; changing a volume spec's plugin ID; upgrading and re-registering a plugin under a new ID while old volumes persist.","solutions":["Re-register the CSI plugin (restart plugin task on clients) so the ID exists again","List `nomad volume status <id>` to confirm vol.PluginID and compare with `nomad plugin status`","Free/deregister stale volumes referencing the missing plugin to clear claims","If the claim is orphaned, manually set claim state to ReadyToFree via state tooling or delete the volume"],"exampleFix":"// before: deregistering plugin with live volume claims\nnomad plugin status csi-ebs-plugin  # check controllers\nnomad system gc                     # wrong: drops plugin while claims exist\n// after: release claims first\nnomad volume status myvol           # confirm no claims\nnomad volume deregister -force myvol\n# then deregister the plugin","handlingStrategy":"validation","validationCode":"// check plugin exists before deregistering or using volumes\nplugins, _, _ := client.CSIPlugins().List(nil)\nvar found bool\nfor _, p := range plugins { if p.ID == vol.PluginID { found = true } }\nif !found { /* re-register plugin or release claims first */ }","typeGuard":null,"tryCatchPattern":"if err := unpublish(vol); err != nil && strings.Contains(err.Error(), \"no such plugin\") {\n    // plugin deregistered: re-register plugin or force-release the claim\n    requeueOrReleaseClaim(vol)\n}","preventionTips":["Never deregister a CSI plugin while volumes still have claims","Check `nomad volume status` claim list before plugin GC","Keep plugin IDs stable across upgrades"],"tags":["nomad","csi","missing-plugin","unpublish"],"backgroundTag":"csi-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"}