hashicorp/nomad · error

failed to convert RTarget %q to uint64: %v

Error message

failed to convert RTarget %q to uint64: %v

What it means

PropertySet constraint helper error: the right-hand target of a distinct_property constraint cannot be converted to uint64 (e.g. a non-numeric string where a number is required). The offending RTarget value is quoted in the message.

Source

Thrown at scheduler/feasible/propertyset.go:96

func (p *propertySet) SetJobConstraint(constraint *structs.Constraint) {
	p.setConstraint(constraint, "")
}

// SetTGConstraint is used to parameterize the property set for a
// distinct_property constraint set at the task group level. The inputs are the
// constraint and the task group name.
func (p *propertySet) SetTGConstraint(constraint *structs.Constraint, taskGroup string) {
	p.setConstraint(constraint, taskGroup)
}

// setConstraint is a shared helper for setting a job or task group constraint.
func (p *propertySet) setConstraint(constraint *structs.Constraint, taskGroup string) {
	var allowedCount uint64
	// Determine the number of allowed allocations with the property.
	if v := constraint.RTarget; v != "" {
		c, err := strconv.ParseUint(v, 10, 64)
		if err != nil {
			p.errorBuilding = fmt.Errorf("failed to convert RTarget %q to uint64: %v", v, err)
			p.logger.Error("failed to convert RTarget to uint64", "RTarget", v, "error", err)
			return
		}

		allowedCount = c
	} else {
		allowedCount = 1
	}
	p.setTargetAttributeWithCount(constraint.LTarget, allowedCount, taskGroup)
}

// SetTargetAttribute is used to populate this property set without also storing allowed count
// This is used when evaluating spread blocks
func (p *propertySet) SetTargetAttribute(targetAttribute string, taskGroup string) {
	p.setTargetAttributeWithCount(targetAttribute, 0, taskGroup)
}

// setTargetAttributeWithCount is a shared helper for setting a job or task group attribute and allowedCount

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Provide a numeric value on the right side of the constraint
  2. Quote or correct the constraint value so it matches the node attribute's type
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scheduler/feasible/propertyset.go:96 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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