hashicorp/nomad · error

device vendor must be specified

Error message

device vendor must be specified

What it means

DeviceGroup.Validate() builds a multierror of required fields; this entry is appended when the device group's Vendor field is empty. Device groups in Nomad must be namespaced by vendor, type, and name, so a missing vendor makes the group identity invalid.

Source

Thrown at plugins/device/device.go:92

	// Type is the type of the device (gpu, fpga, etc).
	Type string

	// Name is the devices model name.
	Name string

	// Devices is the set of device instances.
	Devices []*Device

	// Attributes are a set of attributes shared for all the devices.
	Attributes map[string]*structs.Attribute
}

// Validate validates that the device group is valid
func (d *DeviceGroup) Validate() error {
	var mErr multierror.Error

	if d.Vendor == "" {
		_ = multierror.Append(&mErr, fmt.Errorf("device vendor must be specified"))
	}
	if d.Type == "" {
		_ = multierror.Append(&mErr, fmt.Errorf("device type must be specified"))
	}
	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)))
		}
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Set the Vendor field on the DeviceGroup in the plugin (e.g. "nvidia", "usb") and redeploy the plugin
  2. If configuring the plugin, supply the vendor value in the plugin's client config so fingerprinting populates it
  3. Add a unit test / validate call around DeviceGroup construction to catch empty fields before fingerprinting

Example fix

// before
return &device.DeviceGroup{Type: device.DeviceTypeGPU, Name: "k80"}, nil
// after
return &device.DeviceGroup{Vendor: "nvidia", Type: device.DeviceTypeGPU, Name: "k80"}, nil
Defensive patterns

Strategy: validation

Validate before calling

// Go: guard before returning a DeviceGroup
if g.Vendor == "" {
    return nil, fmt.Errorf("device group %q missing vendor", g.Name)
}

Prevention

When it happens

Trigger: A device plugin's fingerprint/DeviceGroup struct returned with Vendor == "" and passed to Validate() — typically a mis-implemented or misconfigured device plugin.

Common situations: Custom/first-party device plugin whose config lacks a vendor identifier; plugin author returning a DeviceGroup literal without setting Vendor; test fixtures omitting the field.

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/dc1fd382ea58897d. Report an issue: GitHub.