hashicorp/nomad · error

missing claim ID to delete

Error message

missing claim ID to delete

What it means

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.

Source

Thrown at nomad/task_group_host_volume_claim_endpoint.go:127

		return err
	}
	tgvc.srv.MeasureRPCRate("task_group_host_volume_claim", structs.RateMetricWrite, args)
	if authErr != nil {
		return structs.ErrPermissionDenied
	}
	defer metrics.MeasureSince([]string{"nomad", "task_group_host_volume_claim", "delete"}, time.Now())

	allowClaim := acl.NamespaceValidator(acl.NamespaceCapabilityHostVolumeDelete)
	aclObj, err := tgvc.srv.ResolveACL(args)
	if err != nil {
		return err
	}
	if !allowClaim(aclObj, args.RequestNamespace()) {
		return structs.ErrPermissionDenied
	}

	if args.ClaimID == "" {
		return fmt.Errorf("missing claim ID to delete")
	}

	snap, err := tgvc.srv.State().Snapshot()
	if err != nil {
		return err
	}
	claim, err := snap.TaskGroupHostVolumeClaimByID(nil, args.RequestNamespace(), args.ClaimID)
	if err != nil {
		return err
	}
	if claim == nil {
		return fmt.Errorf("task group volume claim does not exist")
	}

	_, index, err := tgvc.srv.raftApply(structs.TaskGroupHostVolumeClaimDeleteRequestType, args)
	if err != nil {
		return err
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Set ClaimID on the delete request to the claim's ID before calling Delete
  2. Fetch the claim first (e.g. via a claim list/get) to obtain its ID
  3. Add client-side validation that ClaimID is non-empty before issuing the RPC

Example fix

// before
deleteReq := &nomad.TaskGroupHostVolumeClaimDeleteRequest{Namespace: "default"}

// after
deleteReq := &nomad.TaskGroupHostVolumeClaimDeleteRequest{Namespace: "default", ClaimID: claim.ID}
Defensive patterns

Strategy: validation

Validate before calling

if claimID == "" {
    return errors.New("claim ID is required to delete a task group host volume claim")
}

Try / catch

err := client.HostVolumes().DeleteClaim(ns, claimID, nil)
if err != nil && strings.Contains(err.Error(), "missing claim ID") {
    // fix request construction: populate ClaimID
}

Prevention

When it happens

Trigger: Calling the Task Group Host Volume Claim Delete RPC (or nomad volume claim delete equivalent) with a TaskGroupHostVolumeClaimDeleteRequest whose ClaimID is unset/empty.

Common situations: Automation scripts or SDK callers forgetting to populate ClaimID; deriving the delete request from a partial API response that lacked the claim ID.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/43c221c3919211df. Report an issue: GitHub.