{"record":{"id":"281df2efd25d8c20","repo":"k3s-io/k3s","slug":"password-file-s-must-have-at-least-3-columns-p","errorCode":null,"errorMessage":"password file '%s' must have at least 3 columns (password, user name, user uid), found %d","messagePattern":"password file '(.+?)' must have at least 3 columns \\(password, user name, user uid\\), found (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/authenticator/passwordfile/passwordfile.go","lineNumber":66,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\trecordNum := 0\n\tusers := make(map[string]*userPasswordInfo)\n\treader := csv.NewReader(file)\n\treader.FieldsPerRecord = -1\n\tfor {\n\t\trecord, err := reader.Read()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(record) < 3 {\n\t\t\treturn nil, fmt.Errorf(\"password file '%s' must have at least 3 columns (password, user name, user uid), found %d\", path, len(record))\n\t\t}\n\t\thash, err := nodepassword.Hasher.CreateHash(record[0])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to hash password for username '%s' in password file '%s': %v\", record[1], path, err)\n\t\t}\n\t\tobj := &userPasswordInfo{\n\t\t\tinfo: &user.DefaultInfo{Name: record[1], UID: record[2]},\n\t\t\thash: hash,\n\t\t}\n\t\tif len(record) >= 4 {\n\t\t\tobj.info.Groups = strings.Split(record[3], \",\")\n\t\t}\n\t\trecordNum++\n\t\tif _, exist := users[obj.info.Name]; exist {\n\t\t\tklog.Warningf(\"duplicate username '%s' has been found in password file '%s', record number '%d'\", obj.info.Name, path, recordNum)\n\t\t}\n\t\tusers[obj.info.Name] = obj\n\t}","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/k3s-io/k3s/blob/6ba341e396edc16b8dcae978a7c5e3ac7ee5606e/pkg/authenticator/passwordfile/passwordfile.go#L48-L84","documentation":"Error \"password file '%s' must have at least 3 columns (password, user name, user uid), found %d\" thrown in k3s-io/k3s.","triggerScenarios":"Thrown at pkg/authenticator/passwordfile/passwordfile.go:66 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":"6ba341e396edc16b8dcae978a7c5e3ac7ee5606e","analyzedAt":"2026-08-15T16:27:54.286Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}