{"record":{"id":"4f3aa78a62301a5d","repo":"hashicorp/nomad","slug":"failed-to-create-reserve-cpuset-partition-w","errorCode":null,"errorMessage":"failed to create reserve cpuset partition: %w","messagePattern":"failed to create reserve cpuset partition: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"client/lib/cgroupslib/init.go","lineNumber":113,"sourceCode":"\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\n\t\tif err := writeCG(noClone, \"cpuset\", NomadCgroupParent, ReservePartition(), 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, ReservePartition(), memsFile); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to set cpuset.mems on reserve cpuset partition: %w\", err)\n\t\t}\n\n\t\tlog.Debug(\"nomad cpuset partitions initialized\", \"cores\", cores)\n\n\tcase CG2:\n\t\t// the cgroup controllers we need to activate at the root and on the nomad slice\n\t\tconst activation = \"+cpuset +cpu +io +memory +pids\"\n\n\t\t// the name of the cgroup subtree interface file\n\t\tconst subtreeFile = \"cgroup.subtree_control\"","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/lib/cgroupslib/init.go#L95-L131","documentation":"During cgroupslib.Init in CG1 mode, creating the reserve cpuset partition directory (/sys/fs/cgroup/cpuset/<nomad-parent>/reserve) via os.MkdirAll failed. This directory holds cgroups for tasks with reserved (dedicated) cores. The error is a filesystem mkdir failure, typically EACCES, EROFS, or a missing cpuset mount.","triggerScenarios":"mkCG(\"cpuset\", NomadCgroupParent, ReservePartition()) fails during Init CG1, after the share partition was fully configured.","commonSituations":"Agent without root privileges; cgroupfs mounted read-only; cgroup v2-only host lacking /sys/fs/cgroup/cpuset; leftover filesystem object at the reserve path.","solutions":["Run Nomad as root or grant capabilities to manage cgroups.","Confirm the cpuset controller is mounted and the parent nomad cgroup exists and is writable.","Remount cgroupfs rw in containerized environments.","Clear any stale file occupying the reserve directory path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"test -d /sys/fs/cgroup/cpuset/nomad && echo ok || echo \"nomad cpuset parent missing\"\nmkdir -p /sys/fs/cgroup/cpuset/nomad/reserve 2>&1 # pre-check as the running user","typeGuard":null,"tryCatchPattern":"if err := cgroupslib.Init(logger, cores); err != nil {\n    if strings.Contains(err.Error(), \"reserve cpuset partition\") {\n        return fmt.Errorf(\"cannot create reserve cgroup; run as root on cgroup v1 host: %w\", err)\n    }\n    return err\n}","preventionTips":["Run the client as root.","Confirm the cpuset controller is mounted before startup.","Keep cgroupfs mounted rw in containerized deployments."],"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"}