{"record":{"id":"e6d64340cf2ea7d3","repo":"hashicorp/nomad","slug":"failed-to-create-share-cpuset-partition-w","errorCode":null,"errorMessage":"failed to create share cpuset partition: %w","messagePattern":"failed to create share cpuset partition: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"client/lib/cgroupslib/init.go","lineNumber":97,"sourceCode":"\n\t\tif err := writeCG(noClone, \"cpuset\", NomadCgroupParent, cloneFile); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to set clone_children on nomad cpuset cgroup: %w\", err)\n\t\t}\n\n\t\tif err := writeCG(memsSet, \"cpuset\", NomadCgroupParent, memsFile); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to set cpuset.mems on nomad cpuset cgroup: %w\", err)\n\t\t}\n\n\t\tif err := writeCG(cores, \"cpuset\", NomadCgroupParent, cpusetFile); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to write cores to nomad cpuset cgroup: %w\", err)\n\t\t}\n\n\t\t//\n\t\t// share partition\n\t\t//\n\n\t\tif err := mkCG(\"cpuset\", NomadCgroupParent, SharePartition()); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create share cpuset partition: %w\", err)\n\t\t}\n\n\t\tif err := writeCG(noClone, \"cpuset\", NomadCgroupParent, SharePartition(), cloneFile); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to set clone_children on nomad cpuset cgroup: %w\", err)\n\t\t}\n\n\t\tif err := writeCG(memsSet, \"cpuset\", NomadCgroupParent, SharePartition(), memsFile); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to set cpuset.mems on share cpuset partition: %w\", err)\n\t\t}\n\n\t\t//\n\t\t// reserve partition\n\t\t//\n\n\t\tif err := mkCG(\"cpuset\", NomadCgroupParent, ReservePartition()); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create reserve cpuset partition: %w\", err)\n\t\t}\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/lib/cgroupslib/init.go#L79-L115","documentation":"During cgroupslib.Init in CG1 mode, creating the share cpuset partition directory (/sys/fs/cgroup/cpuset/<nomad-parent>/share) via os.MkdirAll failed. This directory holds the cgroup in which all tasks using shared (non-reserved) cores are placed. Common causes are permission errors or the parent cpuset controller not being mounted/available.","triggerScenarios":"mkCG(\"cpuset\", NomadCgroupParent, SharePartition()) fails during Init CG1, after the parent cpuset cgroup's clone_children/mems/cpus were configured.","commonSituations":"Agent running without root; cgroupfs mounted read-only; cgroup v2 host where /sys/fs/cgroup/cpuset does not exist; hit by mkdir EEXIST edge cases with a stale non-directory file at the path.","solutions":["Run the Nomad client as root or with capabilities to create cgroup directories.","Confirm /sys/fs/cgroup/cpuset/<parent> exists and is writable (ls -la, try mkdir manually).","Remount cgroup filesystem rw in containers (or use cgroupns=host / privileged mode).","Remove any stale file blocking the share directory path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"test -d /sys/fs/cgroup/cpuset || echo \"cgroup v1 cpuset controller missing on this host\"\ntest -w /sys/fs/cgroup/cpuset/nomad || echo \"nomad cpuset parent not writable\"\nmkdir -p /sys/fs/cgroup/cpuset/nomad/share 2>&1 # dry-run check as the same user","typeGuard":null,"tryCatchPattern":"if err := cgroupslib.Init(logger, cores); err != nil {\n    if strings.Contains(err.Error(), \"share cpuset partition\") {\n        return fmt.Errorf(\"cannot create cgroup dirs; run as root on cgroup v1 host: %w\", err)\n    }\n    return err\n}","preventionTips":["Confirm the host uses cgroup v1 for the cpuset controller before running CG1-mode Nomad.","Run the agent as root.","Remove stale filesystem objects blocking cgroup directory creation."],"tags":["linux","cgroups","cgroup-v1","cpuset","mkdir"],"backgroundTag":"cgroup-hierarchy-setup-failed","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"}