juicedata/juicefs · error

resolve dir %s: %s

Error message

resolve dir %s: %s

What it means

juicefs quota (HandleQuota) could not resolve the given directory path to an inode: m.resolve returned a non-zero status code. The directory must exist (and be created only with --create if requested) before a dir quota can operate on it.

Source

Thrown at pkg/meta/quota.go:594

			q = m.groupQuotas[snap.qkey]
		}
		if q != nil {
			m.updateQuota(q, snap.quota.newSpace, snap.quota.newInodes)
		}
	}
	m.quotaMu.Unlock()

}

func (m *baseMeta) HandleQuota(ctx Context, cmd uint8, qkey string, qtype uint32, quotas map[string]*Quota, strict, repair bool, create bool) error {
	var inode Ino
	var dpath string
	var key uint64

	if qtype == DirQuotaType && cmd != QuotaList {
		dpath = qkey
		if st := m.resolve(ctx, dpath, &inode, create); st != 0 {
			return fmt.Errorf("resolve dir %s: %s", dpath, st)
		}
		if inode.IsTrash() {
			return errors.New("no quota for any trash directory")
		}
		key = uint64(inode)
	} else if (qtype == UserQuotaType || qtype == GroupQuotaType) && cmd != QuotaCheck {
		id, err := strconv.ParseUint(qkey, 10, 64)
		if err != nil {
			return fmt.Errorf("parse quota key %q: %s", qkey, err)
		}
		key = id
	}

	switch cmd {
	case QuotaSet:
		return m.handleQuotaSet(ctx, qtype, key, dpath, quotas, strict)
	case QuotaGet:
		return m.handleQuotaGet(ctx, qtype, key, dpath, quotas)

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Create the directory first: `juicefs mkdir <meta> /some/dir`, or add `--create` to quota set so it creates the path.
  2. Verify the path with `juicefs info <meta> /some/dir` and correct typos.
  3. Use the absolute in-volume path as seen by JuiceFS, not a local bind-mount-relative path.
  4. Decode the returned status code to identify non-ENOENT resolve failures (e.g. permission issues).

Example fix

// before
juicefs quota set sqlite3://m.db --path /data   # /data does not exist
// after
juicefs mkdir sqlite3://m.db /data
juicefs quota set sqlite3://m.db --path /data --capacity 10G
Defensive patterns

Strategy: validation

Validate before calling

juicefs info "$META_URL" "$QUOTA_PATH" >/dev/null || { echo "path not found in volume"; exit 1; }

Prevention

When it happens

Trigger: Running `juicefs quota set <meta> --path /some/dir` (or get/del) where the path does not exist in the filesystem, or the path is misspelled/relative when an absolute path is expected; resolve also fails on permission/status errors.

Common situations: Setting a quota before creating the directory; typo in the path; using a path that only exists on the client's local disk but not in the JuiceFS volume; trash directories (explicitly rejected).

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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