{"record":{"id":"2b36fa72424f5bdb","repo":"hashicorp/nomad","slug":"missing-volume-ids","errorCode":null,"errorMessage":"missing volume IDs","messagePattern":"missing volume IDs","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/csi_endpoint.go","lineNumber":432,"sourceCode":"\tif authErr != nil {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\tallowVolume := acl.NamespaceValidator(acl.NamespaceCapabilityCSIWriteVolume)\n\taclObj, err := v.srv.ResolveACL(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"volume\", \"deregister\"}, time.Now())\n\n\tns := args.RequestNamespace()\n\tif !allowVolume(aclObj, ns) {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\tif len(args.VolumeIDs) == 0 {\n\t\treturn fmt.Errorf(\"missing volume IDs\")\n\t}\n\n\t_, index, err := v.srv.raftApply(structs.CSIVolumeDeregisterRequestType, args)\n\tif err != nil {\n\t\tv.logger.Error(\"csi raft apply failed\", \"error\", err, \"method\", \"deregister\")\n\t\treturn err\n\t}\n\n\treply.Index = index\n\tv.srv.setQueryMeta(&reply.QueryMeta)\n\treturn nil\n}\n\n// Claim submits a change to a volume claim\nfunc (v *CSIVolume) Claim(args *structs.CSIVolumeClaimRequest, reply *structs.CSIVolumeClaimResponse) error {\n\n\tauthErr := v.srv.Authenticate(v.ctx, args)\n\tif done, err := v.srv.forward(\"CSIVolume.Claim\", args, args, reply); done {","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/csi_endpoint.go#L414-L450","documentation":"Guard in the CSIVolume.Deregister RPC: the request's VolumeIDs list is empty, so there are no volumes to deregister; supply at least one volume ID.","triggerScenarios":"Calling CSIVolumeDeregister with args.VolumeIDs empty, e.g. scripted API calls where the ID list failed to populate.","commonSituations":"Empty variable expansion in scripts; automation passing an empty array after an upstream listing returned nothing.","solutions":["Populate args.VolumeIDs with the IDs to deregister","Verify the upstream step that produces the ID list returned results","Add a client-side length check before calling deregister"],"exampleFix":"// before\nargs := structs.CSIVolumeDeregisterRequest{VolumeIDs: []string{}}\n// after\nargs := structs.CSIVolumeDeregisterRequest{VolumeIDs: []string{\"my-volume\"}}","handlingStrategy":"validation","validationCode":"if len(args.VolumeIDs) == 0 {\n    return errors.New(\"volumeIDs must not be empty\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"missing volume IDs\") { fix ID list and retry }","preventionTips":["Check list length before deregister calls","Ensure upstream listing steps produced IDs","Fail fast in scripts when ID lists are empty"],"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"}