k3s-io/k3s · error
failed to hash password for username '%s' in password file '
Error message
failed to hash password for username '%s' in password file '%s': %v
What it means
Error "failed to hash password for username '%s' in password file '%s': %v" thrown in k3s-io/k3s.
Source
Thrown at pkg/authenticator/passwordfile/passwordfile.go:70
recordNum := 0
users := make(map[string]*userPasswordInfo)
reader := csv.NewReader(file)
reader.FieldsPerRecord = -1
for {
record, err := reader.Read()
if err == io.EOF {
break
}
if err != nil {
return nil, err
}
if len(record) < 3 {
return nil, fmt.Errorf("password file '%s' must have at least 3 columns (password, user name, user uid), found %d", path, len(record))
}
hash, err := nodepassword.Hasher.CreateHash(record[0])
if err != nil {
return nil, fmt.Errorf("failed to hash password for username '%s' in password file '%s': %v", record[1], path, err)
}
obj := &userPasswordInfo{
info: &user.DefaultInfo{Name: record[1], UID: record[2]},
hash: hash,
}
if len(record) >= 4 {
obj.info.Groups = strings.Split(record[3], ",")
}
recordNum++
if _, exist := users[obj.info.Name]; exist {
klog.Warningf("duplicate username '%s' has been found in password file '%s', record number '%d'", obj.info.Name, path, recordNum)
}
users[obj.info.Name] = obj
}
return &PasswordAuthenticator{users}, nil
}
View on GitHub (pinned to 6ba341e396)
When it happens
Trigger: Thrown at pkg/authenticator/passwordfile/passwordfile.go:70 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of k3s-io/k3s@6ba341e396 (2026-08-15).
Data as JSON: /api/errors/7d884ad28edb0e82.
Report an issue: GitHub.