{"record":{"id":"8dc9f43eb4c995d4","repo":"hashicorp/nomad","slug":"no-task-supports-csi","errorCode":null,"errorMessage":"no task supports CSI","messagePattern":"no task supports CSI","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/csi_hook.go","lineNumber":240,"sourceCode":"// task driver that supports CSI. This prevents us from publishing CSI volumes\n// only to find out once we get to the taskrunner/volume_hook that no task can\n// mount them.\nfunc (c *csiHook) validateTasksSupportCSI(tg *structs.TaskGroup) error {\n\n\tfor _, task := range tg.Tasks {\n\t\tcaps, err := c.allocRunnerShim.GetTaskDriverCapabilities(task.Name)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not validate task driver capabilities: %v\", err)\n\t\t}\n\n\t\tif caps.MountConfigs == drivers.MountConfigSupportNone {\n\t\t\tcontinue\n\t\t}\n\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"no task supports CSI\")\n}\n\n// restoreMounts tries to restore the mount info from the local client state and\n// then verifies it with the plugin. If the volume is already mounted, we don't\n// want to re-run the claim and mount workflow again. This lets us tolerate\n// restarting clients even on disconnected nodes.\nfunc (c *csiHook) restoreMounts(results map[string]*volumePublishResult) error {\n\tstubs, err := c.allocRunnerShim.GetCSIVolumes()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif stubs == nil {\n\t\treturn nil // no previous volumes\n\t}\n\tfor _, result := range results {\n\t\tstub := stubs[result.request.Name]\n\t\tif stub == nil {\n\t\t\tcontinue","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/csi_hook.go#L222-L258","documentation":"Nomad's CSI hook verifies that at least one task in the allocation's task group uses a driver whose capabilities include CSI mount support (MountConfigs != MountConfigSupportNone). If every task's driver reports no CSI mount capability, the client refuses to proceed with the volume claim/mount workflow, since no task could ever mount the requested CSI volumes.","triggerScenarios":"Prerun -> validateTasksSupportCSI: the job's task group declares CSI volume blocks, but GetTaskDriverCapabilities returns MountConfigSupportNone for every task in the group — e.g. the driver doesn't implement CSI mounting at all, or the driver advertises no mount-config capability on this client.","commonSituations":"Running a job with csi volumes on a client whose driver version is too old to support CSI (pre-CSI plugin drivers), or using a driver like docker/qemu that doesn't mount CSI volumes, after upgrading a Nomad client but not the task drivers, or scheduling a CSI-volume job onto clients where the CSI-capable driver is not enabled.","solutions":["Ensure at least one task in the group runs with a CSI-capable driver (e.g. docker with mount_config support or an exec/raw_exec driver that supports CSI).","Upgrade the task driver / Nomad client so the driver reports MountConfigs support in its capabilities.","Remove the CSI volume blocks from the jobspec if the workload doesn't actually need them.","Verify the client's fingerprinted drivers with `nomad node status <node> -verbose` and confirm the driver is enabled and CSI-capable."],"exampleFix":"// before: group has only a task whose driver can't mount CSI volumes\ntask \"rawexec-loader\" { driver = \"raw_exec\" }\nvolume \"data\" { type = \"csi\" ... }\n\n// after: add a task using a CSI-capable driver (e.g. docker) that mounts the volume\ntask \"app\" {\n  driver = \"docker\"\n  volume_mount { volume = \"data\" destination = \"/data\" }\n}","handlingStrategy":"validation","validationCode":"// before submitting/running, confirm at least one task driver supports CSI mounting\ncaps, err := driver.GetTaskDriverCapabilities(taskName)\nif err != nil || caps == nil || caps.MountConfigs == drivers.MountConfigSupportNone {\n    return fmt.Errorf(\"task %s driver cannot mount CSI volumes\", taskName)\n}","typeGuard":"func supportsCSI(caps *drivers.Capabilities) bool {\n    return caps != nil && caps.MountConfigs != drivers.MountConfigSupportNone\n}","tryCatchPattern":null,"preventionTips":["Only attach CSI volumes to groups with a CSI-capable driver task.","Pin driver/agent versions that support CSI (Nomad >= 0.11 with CSI-capable drivers).","Run nomad job validate and check node driver capabilities before placement.","Keep driver fingerprints healthy on target clients."],"tags":["nomad","csi","volumes","task-driver"],"backgroundTag":"csi-driver-unsupported","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"}