kubernetes/kops · error

error reading user file %q

Error message

error reading user file %q

What it means

Error "error reading user file %q" thrown in kubernetes/kops.

Source

Thrown at upup/pkg/fi/users.go:47

// Go has built-in user functionality, and group functionality is merged but not yet released
// TODO: Replace this file with e.g. user.LookupGroup once 42f07ff2679d38a03522db3ccd488f4cc230c8c2 lands in go 1.7

type User struct {
	Name    string
	Uid     int
	Gid     int
	Comment string
	Home    string
	Shell   string
}

func parseUsers() (map[string]*User, error) {
	users := make(map[string]*User)

	path := "/etc/passwd"
	b, err := os.ReadFile(path)
	if err != nil {
		return nil, fmt.Errorf("error reading user file %q", path)
	}
	for _, line := range strings.Split(string(b), "\n") {
		line = strings.TrimSpace(line)
		if line == "" {
			continue
		}
		tokens := strings.Split(line, ":")

		if len(tokens) < 7 {
			klog.Warningf("Ignoring malformed /etc/passwd line (too few tokens): %q\n", line)
			continue
		}

		uid, err := strconv.Atoi(tokens[2])
		if err != nil {
			klog.Warningf("Ignoring malformed /etc/passwd line (bad uid): %q", line)
			continue
		}

View on GitHub (pinned to 4c8573c808)

When it happens

Trigger: Thrown at upup/pkg/fi/users.go:47 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/da137386d4cde369. Report an issue: GitHub.