{"record":{"id":"59c489173d6fcf93","repo":"tailscale/tailscale","slug":"running-id-command-w","errorCode":null,"errorMessage":"running 'id' command: %w","messagePattern":"running 'id' command: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/osuser/group_ids.go","lineNumber":55,"sourceCode":"\n\tif ids, err := getGroupIdsWithId(user.Username); err == nil {\n\t\treturn ids, nil\n\t}\n\treturn user.GroupIds()\n}\n\nfunc getGroupIdsWithId(usernameOrUID string) ([]string, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\n\tcmd := exec.CommandContext(ctx, \"id\", \"-Gz\", usernameOrUID)\n\tif runtime.GOOS == \"freebsd\" {\n\t\tcmd = exec.CommandContext(ctx, \"id\", \"-G\", usernameOrUID)\n\t}\n\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"running 'id' command: %w\", err)\n\t}\n\n\treturn parseGroupIds(out), nil\n}\n\nfunc parseGroupIds(cmdOutput []byte) []string {\n\ts := strings.TrimSpace(string(cmdOutput))\n\t// Parse NUL-delimited output.\n\tif strings.ContainsRune(s, '\\x00') {\n\t\treturn strings.Split(strings.Trim(s, \"\\x00\"), \"\\x00\")\n\t}\n\t// Parse whitespace-delimited output.\n\treturn strings.Fields(s)\n}\n","sourceCodeStart":37,"sourceCodeEnd":70,"githubUrl":"https://github.com/tailscale/tailscale/blob/6e0912f97994f927632b34ae9e63b53d6516a6ac/util/osuser/group_ids.go#L37-L70","documentation":"Fired in getGroupIdsWithId when the external `id -Gz` (or `id -G` on FreeBSD) command exits non-zero or errors; means the system `id` binary was unavailable, timed out (10s context), or failed for the given username/UID, so group IDs fall back to os/user.","triggerScenarios":"Thrown at util/osuser/group_ids.go:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fall back to user.GroupIds() as the caller does","Verify the `id` binary exists in PATH","Check the username/UID is valid on this system","Increase timeout if the system is slow to resolve users (e.g. LDAP/NSS)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6e0912f97994f927632b34ae9e63b53d6516a6ac","analyzedAt":"2026-08-18T08:17:25.280Z","contentChangedAt":"2026-08-18T08:17:25.280Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}