{"record":{"id":"f91cc951acef4fbd","repo":"hashicorp/nomad","slug":"missing-volume-id-f91cc9","errorCode":null,"errorMessage":"missing volume ID","messagePattern":"missing volume ID","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/csi_endpoint.go","lineNumber":189,"sourceCode":"\t}\n\n\tallowCSIAccess := acl.NamespaceValidator(acl.NamespaceCapabilityCSIReadVolume,\n\t\tacl.NamespaceCapabilityCSIMountVolume,\n\t\tacl.NamespaceCapabilityReadJob)\n\taclObj, err := v.srv.ResolveACL(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tns := args.RequestNamespace()\n\tif !allowCSIAccess(aclObj, ns) {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"volume\", \"get\"}, time.Now())\n\n\tif args.ID == \"\" {\n\t\treturn fmt.Errorf(\"missing volume ID\")\n\t}\n\n\topts := blockingOptions{\n\t\tqueryOpts: &args.QueryOptions,\n\t\tqueryMeta: &reply.QueryMeta,\n\t\trun: func(ws memdb.WatchSet, state *state.StateStore) error {\n\t\t\tsnap, err := state.Snapshot()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tvol, err := snap.CSIVolumeByID(ws, ns, args.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif vol != nil {\n\t\t\t\tvol, err = snap.CSIVolumeDenormalize(ws, vol)\n\t\t\t}","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/csi_endpoint.go#L171-L207","documentation":"Guard in the CSIVolume.Get RPC: the request's volume ID is an empty string, so there is nothing to look up; the caller must supply the ID of the volume to fetch.","triggerScenarios":"Calling CSIVolumeGet (or the nomad volume status CLI/API) with args.ID set to \"\".","commonSituations":"Scripting the HTTP API with a missing/unexpanded variable for the volume ID; CLI parsing bugs; copying an example command without filling the ID.","solutions":["Pass the volume ID in the request (args.ID)","List volumes first with nomad volume status to find the correct ID","Add client-side validation for the ID before calling the API"],"exampleFix":"// before\nargs := structs.CSIVolumeGetRequest{}\n// after\nargs := structs.CSIVolumeGetRequest{ID: \"my-volume\"}","handlingStrategy":"validation","validationCode":"if args.ID == \"\" {\n    return errors.New(\"volume ID is required\")\n}","typeGuard":null,"tryCatchPattern":"err := client volume get; if err != nil && strings.Contains(err.Error(), \"missing volume ID\") { fix request and retry }","preventionTips":["Always fetch the volume ID from nomad volume status before querying","Check shell variables are non-empty before API calls","Validate request structs client-side before RPC"],"tags":["validation","csi","api"],"backgroundTag":"missing-required-argument","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"}