juicedata/juicefs · error

user(%s):group(%s) not found

Error message

user(%s):group(%s) not found

What it means

jfs.Chown resolves owner and group names to uid/gid via utils.LookupUser/LookupGroup on the machine running the client; if either lookup fails (-1), it returns 'user(%s):group(%s) not found'. The names must exist in the local user/group database (/etc/passwd, /etc/group, NSS).

Source

Thrown at cmd/object.go:379

	}
	// No mapping for Go's ModeTemporary (plan9 only).
	return
}

func (j *juiceFS) Chmod(key string, mode os.FileMode) error {
	f, err := j.jfs.Open(ctx, j.path(key), 0)
	if err != 0 {
		return err
	}
	defer f.Close(ctx)
	return toError(f.Chmod(ctx, uint16(syscallMode(mode))))
}

func (j *juiceFS) Chown(key string, owner, group string) error {
	uid := utils.LookupUser(owner)
	gid := utils.LookupGroup(group)
	if uid == -1 || gid == -1 {
		return fmt.Errorf("user(%s):group(%s) not found", owner, group)
	}
	f, err := j.jfs.Lopen(ctx, j.path(key), 0)
	if err != 0 {
		return err
	}
	defer f.Close(ctx)
	return toError(f.Chown(ctx, uint32(uid), uint32(gid)))
}

func (j *juiceFS) Symlink(oldName, newName string) error {
	p := j.path(newName)
	err := j.jfs.Symlink(ctx, oldName, p)
	if err == syscall.ENOENT {
		if err = j.jfs.MkdirAll(ctx, path.Dir(p), 0777, j.umask); err != 0 {
			return toError(err)
		}
		err = j.jfs.Symlink(ctx, oldName, p)
	}

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Create the missing user/group locally (useradd/groupadd) or add entries to /etc/passwd and /etc/group.
  2. Pass numeric-friendly or existing names understood by the host running JuiceFS.
  3. If in a container, ensure the user/group exists inside the container image.
  4. Check NSS/LDAP configuration so name lookups succeed.

Example fix

// before
store.Chown(key, "alice", "devs") // names unknown on this host
// after
err := store.Chown(key, "alice", "devs")
if err != nil && strings.Contains(err.Error(), "not found") {
    // fall back to current owner or create the accounts first
}
Defensive patterns

Strategy: validation

Validate before calling

if utils.LookupUser(owner) == -1 || utils.LookupGroup(group) == -1 {
    return fmt.Errorf("cannot chown: %s:%s unknown on this host", owner, group)
}

Try / catch

if err := store.Chown(key, owner, group); err != nil {
    log.Warnf("chown failed, keeping current ownership: %v", err)
}

Prevention

When it happens

Trigger: Chown(key, owner, group) where owner or group is not a valid local user/group name, e.g. owner from S3 canned ACL strings or IDs that don't map to local accounts.

Common situations: S3 gateway/sync carrying owner/group names from another machine's accounts; chown of objects copied from a different host with unknown uid/gid; containers lacking the user/group entries; LDAP/NSS not configured.

Understand the failure class

Background: "User not found", "Invalid user", and "does not exist": what missing-user lookup errors mean across Rocket.Chat, LiteLLM, Phabricator, rustfs, and pnpm — this error's family across 10 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/aaab97ff2a5f5e54. Report an issue: GitHub.