{"record":{"id":"43c221c3919211df","repo":"hashicorp/nomad","slug":"missing-claim-id-to-delete","errorCode":null,"errorMessage":"missing claim ID to delete","messagePattern":"missing claim ID to delete","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/task_group_host_volume_claim_endpoint.go","lineNumber":127,"sourceCode":"\t\treturn err\n\t}\n\ttgvc.srv.MeasureRPCRate(\"task_group_host_volume_claim\", structs.RateMetricWrite, args)\n\tif authErr != nil {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"task_group_host_volume_claim\", \"delete\"}, time.Now())\n\n\tallowClaim := acl.NamespaceValidator(acl.NamespaceCapabilityHostVolumeDelete)\n\taclObj, err := tgvc.srv.ResolveACL(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !allowClaim(aclObj, args.RequestNamespace()) {\n\t\treturn structs.ErrPermissionDenied\n\t}\n\n\tif args.ClaimID == \"\" {\n\t\treturn fmt.Errorf(\"missing claim ID to delete\")\n\t}\n\n\tsnap, err := tgvc.srv.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\tclaim, err := snap.TaskGroupHostVolumeClaimByID(nil, args.RequestNamespace(), args.ClaimID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif claim == nil {\n\t\treturn fmt.Errorf(\"task group volume claim does not exist\")\n\t}\n\n\t_, index, err := tgvc.srv.raftApply(structs.TaskGroupHostVolumeClaimDeleteRequestType, args)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/task_group_host_volume_claim_endpoint.go#L109-L145","documentation":"TaskGroupHostVolumeClaim.Delete requires a ClaimID to identify which claim to remove. If the request's ClaimID field is the empty string, the endpoint rejects it before touching the state store. This is a client-side request validation error.","triggerScenarios":"Calling the Task Group Host Volume Claim Delete RPC (or nomad volume claim delete equivalent) with a TaskGroupHostVolumeClaimDeleteRequest whose ClaimID is unset/empty.","commonSituations":"Automation scripts or SDK callers forgetting to populate ClaimID; deriving the delete request from a partial API response that lacked the claim ID.","solutions":["Set ClaimID on the delete request to the claim's ID before calling Delete","Fetch the claim first (e.g. via a claim list/get) to obtain its ID","Add client-side validation that ClaimID is non-empty before issuing the RPC"],"exampleFix":"// before\ndeleteReq := &nomad.TaskGroupHostVolumeClaimDeleteRequest{Namespace: \"default\"}\n\n// after\ndeleteReq := &nomad.TaskGroupHostVolumeClaimDeleteRequest{Namespace: \"default\", ClaimID: claim.ID}","handlingStrategy":"validation","validationCode":"if claimID == \"\" {\n    return errors.New(\"claim ID is required to delete a task group host volume claim\")\n}","typeGuard":null,"tryCatchPattern":"err := client.HostVolumes().DeleteClaim(ns, claimID, nil)\nif err != nil && strings.Contains(err.Error(), \"missing claim ID\") {\n    // fix request construction: populate ClaimID\n}","preventionTips":["Always populate ClaimID from a prior get/list of the claim","Validate required fields before sending RPCs","Use CLI/SDK helpers that enforce required fields"],"tags":["nomad","validation","volumes","missing-parameter"],"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"}