{"record":{"id":"a2fbfe004b3844fc","repo":"hashicorp/nomad","slug":"failed-to-create-container-configuration-cannot-u","errorCode":null,"errorMessage":"Failed to create container configuration, cannot use isolation mode \"%s\" on %s","messagePattern":"Failed to create container configuration, cannot use isolation mode \"(.+?)\" on (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/docker/driver.go","lineNumber":1081,"sourceCode":"\n\tcontainerRuntime := driverConfig.Runtime\n\tif _, ok := task.DeviceEnv[nvidiaVisibleDevices]; ok {\n\t\tif !d.gpuRuntime {\n\t\t\treturn c, fmt.Errorf(\"requested docker runtime %q was not found\", d.config.GPURuntimeName)\n\t\t}\n\t\tif containerRuntime != \"\" && containerRuntime != d.config.GPURuntimeName {\n\t\t\treturn c, fmt.Errorf(\"conflicting runtime requests: gpu runtime %q conflicts with task runtime %q\", d.config.GPURuntimeName, containerRuntime)\n\t\t}\n\t\tcontainerRuntime = d.config.GPURuntimeName\n\t}\n\tif _, ok := d.config.allowRuntimes[containerRuntime]; !ok && containerRuntime != \"\" {\n\t\treturn c, fmt.Errorf(\"requested runtime %q is not allowed\", containerRuntime)\n\t}\n\n\t// Validate isolation modes on windows\n\tif runtime.GOOS != \"windows\" {\n\t\tif driverConfig.Isolation != \"\" {\n\t\t\treturn c, fmt.Errorf(\"Failed to create container configuration, cannot use isolation mode \\\"%s\\\" on %s\", driverConfig.Isolation, runtime.GOOS)\n\t\t}\n\t} else {\n\t\tif driverConfig.Isolation == \"\" {\n\t\t\tdriverConfig.Isolation = windowsIsolationModeHyperV\n\t\t}\n\t\tif !slices.Contains(windowsIsolationModes, driverConfig.Isolation) {\n\t\t\treturn c, fmt.Errorf(\"Unsupported isolation mode \\\"%s\\\"\", driverConfig.Isolation)\n\t\t}\n\t}\n\n\tvar pidsLimit int64 = -1 // default unlimited\n\n\t// Pids limit defined in Nomad plugin config.\n\tif d.config.PidsLimit > 0 {\n\t\tpidsLimit = d.config.PidsLimit\n\t}\n\n\t// Override Nomad plugin config pids limit, by user defined pids limit.","sourceCodeStart":1063,"sourceCodeEnd":1099,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/docker/driver.go#L1063-L1099","documentation":"The `isolation` docker task option (process vs hyperv) is only meaningful on Windows. On non-Windows platforms, setting it to anything other than empty is rejected with this error. On Windows, an empty isolation defaults to hyperv and must be one of the supported modes.","triggerScenarios":"A job with `isolation = \"hyperv\"` (or \"process\") in the docker task config is scheduled onto a Linux client; runtime.GOOS != \"windows\" makes any non-empty isolation invalid.","commonSituations":"Job spec written for Windows clients reused in a mixed-OS datacenter without constraints; copy-pasted docker config template carrying isolation everywhere.","solutions":["Remove the `isolation` field from the docker task config (it only applies to Windows).","Add `constraint { attribute = \"${attr.kernel.name}\" = \"windows\" }` if the job genuinely needs Windows isolation semantics.","Parameterize the job template so isolation is only rendered for Windows targets."],"exampleFix":"// task docker config\n// before\nisolation = \"hyperv\"\n// after\n// (remove isolation line on Linux)","handlingStrategy":"validation","validationCode":"function validateIsolationForPlatform(isolation, kernelName) {\n  if (kernelName !== 'windows' && isolation) {\n    throw new Error(`isolation option is only valid on Windows, got \"${isolation}\"`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await client.jobs.submit(job);\n} catch (err) {\n  if (/cannot use isolation mode/.test(err.message)) {\n    console.error('Remove isolation from the task or constrain the job to Windows clients');\n  }\n  throw err;\n}","preventionTips":["Add a Windows kernel constraint to jobs that use the isolation option.","Keep isolation out of shared multi-OS job templates.","Template-render isolation only when the target datacenter/clients are Windows."],"tags":["docker","windows","isolation","portability"],"backgroundTag":"option-not-supported-on-platform","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"}