{"record":{"id":"3a517668e61f877e","repo":"hashicorp/nomad","slug":"pids-limit-cannot-be-greater-than-nomad-plugin-con","errorCode":null,"errorMessage":"pids_limit cannot be greater than nomad plugin config pids_limit: %d","messagePattern":"pids_limit cannot be greater than nomad plugin config pids_limit: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/docker/driver.go","lineNumber":1102,"sourceCode":"\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.\n\tif driverConfig.PidsLimit > 0 {\n\t\tif d.config.PidsLimit > 0 && driverConfig.PidsLimit > d.config.PidsLimit {\n\t\t\treturn c, fmt.Errorf(\"pids_limit cannot be greater than nomad plugin config pids_limit: %d\", d.config.PidsLimit)\n\t\t}\n\t\tpidsLimit = driverConfig.PidsLimit\n\t}\n\n\tcpuShares := d.cpuResources(task.Resources.LinuxResources.CPUShares)\n\n\thostConfig := &containerapi.HostConfig{\n\t\tCgroupnsMode: containerapi.CgroupnsMode(driverConfig.CgroupnsMode),\n\t\t// do not set cgroup parent anymore\n\n\t\tOomScoreAdj: driverConfig.OOMScoreAdj, // ignored on platforms other than linux\n\n\t\t// Binds are used to mount a host volume into the container. We mount a\n\t\t// local directory for storage and a shared alloc directory that can be\n\t\t// used to share data between different tasks in the same task group.\n\t\tBinds: binds,\n\n\t\tIsolation:    containerapi.Isolation(driverConfig.Isolation),","sourceCodeStart":1084,"sourceCodeEnd":1120,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/docker/driver.go#L1084-L1120","documentation":"The docker plugin supports an operator-level pids_limit cap. If a job's task config specifies a pids_limit larger than the plugin config's pids_limit (when that cap is > 0), container configuration fails. This keeps task PID usage within operator-enforced bounds.","triggerScenarios":"Task sets pids_limit = 500 while the client plugin config has pids_limit = 100; both values > 0 and task > plugin cap during createContainerConfig.","commonSituations":"Operators lowering the cluster-wide plugin pids_limit after jobs were authored with higher values; jobs copied from clusters without a plugin cap; forgetting to update job specs after tightening client policy.","solutions":["Lower the task's pids_limit in the job spec to be <= the plugin config pids_limit.","Raise the plugin config pids_limit in the Nomad client docker plugin block and reload the client.","Remove the plugin-level cap (pids_limit = 0) if per-job limits should be unrestricted.","Target the task at clients whose plugin cap accommodates the requested limit."],"exampleFix":"// job task config\n// before\npids_limit = 500  // plugin cap = 100\n// after\npids_limit = 100","handlingStrategy":"validation","validationCode":"function validatePidsLimit(taskPidsLimit, pluginPidsLimit) {\n  if (taskPidsLimit > 0 && pluginPidsLimit > 0 && taskPidsLimit > pluginPidsLimit) {\n    throw new Error(`task pids_limit ${taskPidsLimit} exceeds plugin cap ${pluginPidsLimit}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await client.jobs.submit(job);\n} catch (err) {\n  if (/pids_limit cannot be greater/.test(err.message)) {\n    console.error('Lower task pids_limit or raise the plugin cap in client config');\n  }\n  throw err;\n}","preventionTips":["Track plugin pids_limit per client class and lint jobs against it.","Announce cap changes to job owners before tightening client config.","Prefer per-task pids_limit below the cluster cap with headroom."],"tags":["docker","pids-limit","config","nomad"],"backgroundTag":"resource-limit-exceeded","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"}