{"record":{"id":"da137386d4cde369","repo":"kubernetes/kops","slug":"error-reading-user-file-q","errorCode":null,"errorMessage":"error reading user file %q","messagePattern":"error reading user file %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/users.go","lineNumber":47,"sourceCode":"// Go has built-in user functionality, and group functionality is merged but not yet released\n// TODO: Replace this file with e.g. user.LookupGroup once 42f07ff2679d38a03522db3ccd488f4cc230c8c2 lands in go 1.7\n\ntype User struct {\n\tName    string\n\tUid     int\n\tGid     int\n\tComment string\n\tHome    string\n\tShell   string\n}\n\nfunc parseUsers() (map[string]*User, error) {\n\tusers := make(map[string]*User)\n\n\tpath := \"/etc/passwd\"\n\tb, err := os.ReadFile(path)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading user file %q\", path)\n\t}\n\tfor _, line := range strings.Split(string(b), \"\\n\") {\n\t\tline = strings.TrimSpace(line)\n\t\tif line == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\ttokens := strings.Split(line, \":\")\n\n\t\tif len(tokens) < 7 {\n\t\t\tklog.Warningf(\"Ignoring malformed /etc/passwd line (too few tokens): %q\\n\", line)\n\t\t\tcontinue\n\t\t}\n\n\t\tuid, err := strconv.Atoi(tokens[2])\n\t\tif err != nil {\n\t\t\tklog.Warningf(\"Ignoring malformed /etc/passwd line (bad uid): %q\", line)\n\t\t\tcontinue\n\t\t}","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/users.go#L29-L65","documentation":"Error \"error reading user file %q\" thrown in kubernetes/kops.","triggerScenarios":"Thrown at upup/pkg/fi/users.go:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}