{"record":{"id":"0eaf2431333fb027","repo":"kubernetes/kops","slug":"error-creating-group-v-output-s","errorCode":null,"errorMessage":"error creating group: %v\nOutput: %s","messagePattern":"error creating group: (.+?)\nOutput: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/nodetasks/group.go","lineNumber":98,"sourceCode":"\tif e.GID != nil {\n\t\targs = append(args, \"-g\", strconv.Itoa(*e.GID))\n\t}\n\tif e.System {\n\t\targs = append(args, \"--system\")\n\t}\n\targs = append(args, e.Name)\n\treturn args\n}\n\nfunc (_ *GroupTask) RenderLocal(t *local.LocalTarget, a, e, changes *GroupTask) error {\n\tif a == nil {\n\t\targs := buildGroupaddArgs(e)\n\t\tklog.Infof(\"Creating group %q\", e.Name)\n\t\tcmd := exec.Command(\"groupadd\", args...)\n\t\tklog.V(2).Infof(\"running command: groupadd %s\", strings.Join(args, \" \"))\n\t\toutput, err := cmd.CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating group: %v\\nOutput: %s\", err, output)\n\t\t}\n\t} else {\n\t\tvar args []string\n\n\t\tif changes.GID != nil {\n\t\t\targs = append(args, \"-g\", strconv.Itoa(*e.GID))\n\t\t}\n\n\t\tif len(args) != 0 {\n\t\t\targs = append(args, e.Name)\n\t\t\tklog.Infof(\"Reconfiguring group %q\", e.Name)\n\t\t\tcmd := exec.Command(\"groupmod\", args...)\n\t\t\tklog.V(2).Infof(\"running command: groupmod %s\", strings.Join(args, \" \"))\n\t\t\toutput, err := cmd.CombinedOutput()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error reconfiguring group: %v\\nOutput: %s\", err, output)\n\t\t\t}\n\t\t}","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/nodetasks/group.go#L80-L116","documentation":"nodeup ran the system 'groupadd' binary to create an OS group and it exited non-zero. The error includes groupadd's combined output. This is a host-level OS user/group management failure during instance bootstrap.","triggerScenarios":"RenderLocal of a Group task with create=true changes; exec.Command(\"groupadd\", args...) returns an error (e.g. exit status 9, group already exists).","commonSituations":"The group already exists because the base image pre-creates it; groupadd is missing on minimal images; GID conflicts with an existing group; name violates OS naming rules.","solutions":["Check the Output: section for groupadd's specific message","If the group already exists, mark the task as not needing creation or use groupmod (update) instead","Verify the group name/GID is valid and not conflicting: getent group <name>","Ensure the base image ships groupadd (shadow-utils package)"],"exampleFix":"// before\nName: fi.String(\"docker\") // image already has docker group -> groupadd fails\n// after\nName: fi.String(\"docker\"), SystemUser: fi.Bool(true) // align GID/name with image, or handle existing group","handlingStrategy":"validation","validationCode":"// pre-check group existence on the target image\nout, err := exec.Command(\"getent\", \"group\", name).Output()\nexists := err == nil\n","typeGuard":null,"tryCatchPattern":"if err := t.RenderLocal(ctx, a, b); err != nil {\n  if strings.Contains(err.Error(), \"group already exists\") {\n    klog.Warningf(\"group %s pre-exists; converting to update path\", name)\n    return nil\n  }\n  return err\n}","preventionTips":["Align cluster group names/GIDs with the node base image","Ensure shadow-utils is installed in the image","Use getent/groupadd dry-runs when building custom images"],"tags":["nodeup","groupadd","os-groups"],"backgroundTag":"groupadd-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}