kovidgoyal/kitty · warning

No user matching the UID: %#v found

Error message

No user matching the UID: %#v found

What it means

PwdEntryForUid looks up a user by UID in the parsed passwd database and returns this error when the UID key is absent. It means the lookup itself succeeded but no passwd record matches that numeric UID.

Source

Thrown at tools/utils/passwd.go:65

		return nil, err
	}
	return ParsePasswdDatabase(UnsafeBytesToString(raw)), nil
}

var passwd_err error
var passwd_database = sync.OnceValue(func() (ans map[string]PasswdEntry) {
	ans, passwd_err = ParsePasswdFile("/etc/passwd")
	return
})

func PwdEntryForUid(uid string) (ans PasswdEntry, err error) {
	pwd := passwd_database()
	if passwd_err != nil {
		return ans, passwd_err
	}
	ans, found := pwd[uid]
	if !found {
		return ans, fmt.Errorf("No user matching the UID: %#v found", uid)
	}
	return ans, nil
}

func parse_dscl_data(raw []byte) (ans map[string]PasswdEntry, err error) {
	var pd []any
	_, err = plist.Unmarshal(raw, &pd)
	if err != nil {
		return
	}
	ans = make(map[string]PasswdEntry, 256)
	for _, entry := range pd {
		if e, ok := entry.(map[string]any); ok {
			item := PasswdEntry{}
			for key, a := range e {
				array, ok := a.([]any)
				if !ok || len(array) == 0 || !strings.HasPrefix(key, "dsAttrTypeNative:") {
					continue

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Verify the UID actually exists: run `getent passwd <uid>` or `id <uid>`.
  2. If the user was deleted, restore it or chown the affected files to an existing user.
  3. In containers, ensure the user is created in the image or run with `--user <uid>:<gid>` only when /etc/passwd has the entry.
  4. Handle the error gracefully and fall back to displaying the raw numeric UID.

Example fix

// before
entry, err := utils.PwdEntryForUid(uid)
// after
entry, err := utils.PwdEntryForUid(uid)
if err != nil {
    name = strconv.FormatUint(uint64(uid), 10) // fall back to numeric owner
}
Defensive patterns

Strategy: fallback

Validate before calling

cmd := exec.Command("getent", "passwd", strconv.FormatUint(uint64(uid), 10))
if cmd.Run() != nil {
    // no record; plan to use numeric fallback
}

Try / catch

entry, err := utils.PwdEntryForUid(uid)
if err != nil {
    name = strconv.FormatUint(uint64(uid), 10)
    entry = utils.PasswdEntry{}
}

Prevention

When it happens

Trigger: Passing a UID that exists as an integer but has no passwd entry (e.g. a deleted user, a container with a numeric-only owner like UID 999999, or NFS/ID-mapped mounts with unmapped UIDs).

Common situations: Files owned by stale UIDs after user deletion, minimal Docker images without the user defined, or macOS DSCL lookups where the user is not local. Callers resolving file ownership get this error.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/49b2bab5edf67e11. Report an issue: GitHub.