hashicorp/nomad · error

device attribute %q invalid: %v

Error message

device attribute %q invalid: %v

What it means

DeviceGroup.Validate: one of the attribute values in the attributes map failed its own Attribute.Validate check (bad unit, wrong value cardinality, etc.), keyed by the attribute name.

Source

Thrown at plugins/device/device.go:114

	}
	if d.Name == "" {
		_ = multierror.Append(&mErr, fmt.Errorf("device name must be specified"))
	}

	for i, dev := range d.Devices {
		if dev == nil {
			_ = multierror.Append(&mErr, fmt.Errorf("device %d is nil", i))
			continue
		}

		if err := dev.Validate(); err != nil {
			_ = multierror.Append(&mErr, multierror.Prefix(err, fmt.Sprintf("device %d: ", i)))
		}
	}

	for k, v := range d.Attributes {
		if err := v.Validate(); err != nil {
			_ = multierror.Append(&mErr, fmt.Errorf("device attribute %q invalid: %v", k, err))
		}
	}

	return mErr.ErrorOrNil()

}

// Device is an instance of a particular device.
type Device struct {
	// ID is the identifier for the device.
	ID string

	// Healthy marks whether the device is healthy and can be used for
	// scheduling.
	Healthy bool

	// HealthDesc describes why the device may be unhealthy.
	HealthDesc string

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Fix the named attribute per its nested validation error
  2. Ensure each attribute has exactly one value and a recognized unit
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at plugins/device/device.go:114 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/2f1ec05da1165278. Report an issue: GitHub.