{"record":{"id":"10591d975037460a","repo":"hashicorp/nomad","slug":"failed-to-make-device-out-for-s-v","errorCode":null,"errorMessage":"failed to make device out for %s: %v","messagePattern":"failed to make device out for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/shared/executor/executor_linux_cgo.go","lineNumber":932,"sourceCode":"\tif l.compute.TotalCompute >= MaxCPUShares {\n\t\treturn int64(float64(shares) / float64(l.compute.TotalCompute) * MaxCPUShares)\n\t}\n\n\treturn shares\n}\n\n// cmdDevices converts a list of driver.DeviceConfigs into excutor.Devices.\nfunc cmdDevices(driverDevices []*drivers.DeviceConfig) ([]*config.Device, error) {\n\tif len(driverDevices) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tr := make([]*config.Device, len(driverDevices))\n\n\tfor i, d := range driverDevices {\n\t\ted, err := devices.DeviceFromPath(d.HostPath, d.Permissions)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to make device out for %s: %v\", d.HostPath, err)\n\t\t}\n\t\ted.Path = d.TaskPath\n\t\ted.Allow = true // rules will be used to allow devices via cgroups\n\t\tr[i] = ed\n\t}\n\n\treturn r, nil\n}\n\nvar userMountToUnixMount = map[string]int{\n\t// Empty string maps to `rprivate` for backwards compatibility in restored\n\t// older tasks, where mount propagation will not be present.\n\t\"\":                                       unix.MS_PRIVATE | unix.MS_REC, // rprivate\n\tstructs.VolumeMountPropagationPrivate:    unix.MS_PRIVATE | unix.MS_REC, // rprivate\n\tstructs.VolumeMountPropagationHostToTask: unix.MS_SLAVE | unix.MS_REC,   // rslave\n\tstructs.VolumeMountPropagationBidirectional: unix.MS_SHARED | unix.MS_REC, // rshared\n}\n","sourceCodeStart":914,"sourceCodeEnd":950,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/shared/executor/executor_linux_cgo.go#L914-L950","documentation":"cmdDevices converts driver-specified host device paths into libcontainer device rules via devices.DeviceFromPath. This error is returned when a host path listed as a device cannot be resolved to a device file, so no rule can be made for it.","triggerScenarios":"A task/driver declares devices with host paths, and devices.DeviceFromPath fails for one of them — the path does not exist, is not a device node (char/block), or stat fails (permissions).","commonSituations":"Typo in a device host path in the task's devices stanza; device exists on dev machines but not on the Nomad client host; a plugin/driver hardcodes device paths (e.g. /dev/nvidia*) absent on that node; device plugged in after task config written.","solutions":["Check the listed HostPath exists on the Nomad client node (ls -l /dev/...) and is a device node","Fix or remove the devices stanza entry in the job/task driver config","Use node-specific constraints or device plugins so tasks only run on nodes exposing the device","Verify permissions on the device file allow the Nomad client to stat/read it"],"exampleFix":"// before\ndevices = [{ host_path = \"/dev/nvidia0\" }]\n// after\n# ensure device exists on node, or guard:\nconstraint { attribute = \"${meta.gpu}\"; operator = \"isset\" }\ndevices = [{ host_path = \"/dev/nvidia0\" }]","handlingStrategy":"validation","validationCode":"for _, d := range devices {\n    if _, err := os.Stat(d.HostPath); err != nil {\n        return fmt.Errorf(\"device %s missing on node\", d.HostPath)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to make device out for\") {\n    // inspect d.HostPath in the error text and fix job devices stanza\n    return fmt.Errorf(\"bad device config: %w\", err)\n}","preventionTips":["List device host paths exactly as they appear in /dev on each node","Use device plugins / node constraints instead of hardcoding host paths","Validate devices stanza entries in CI against the target node inventory"],"tags":["devices","cgroups","executor"],"backgroundTag":"device-path-not-found","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"}