{"record":{"id":"5f58d78f96c10246","repo":"juicedata/juicefs","slug":"resolve-dir-s-s","errorCode":null,"errorMessage":"resolve dir %s: %s","messagePattern":"resolve dir (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/quota.go","lineNumber":594,"sourceCode":"\t\t\tq = m.groupQuotas[snap.qkey]\n\t\t}\n\t\tif q != nil {\n\t\t\tm.updateQuota(q, snap.quota.newSpace, snap.quota.newInodes)\n\t\t}\n\t}\n\tm.quotaMu.Unlock()\n\n}\n\nfunc (m *baseMeta) HandleQuota(ctx Context, cmd uint8, qkey string, qtype uint32, quotas map[string]*Quota, strict, repair bool, create bool) error {\n\tvar inode Ino\n\tvar dpath string\n\tvar key uint64\n\n\tif qtype == DirQuotaType && cmd != QuotaList {\n\t\tdpath = qkey\n\t\tif st := m.resolve(ctx, dpath, &inode, create); st != 0 {\n\t\t\treturn fmt.Errorf(\"resolve dir %s: %s\", dpath, st)\n\t\t}\n\t\tif inode.IsTrash() {\n\t\t\treturn errors.New(\"no quota for any trash directory\")\n\t\t}\n\t\tkey = uint64(inode)\n\t} else if (qtype == UserQuotaType || qtype == GroupQuotaType) && cmd != QuotaCheck {\n\t\tid, err := strconv.ParseUint(qkey, 10, 64)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"parse quota key %q: %s\", qkey, err)\n\t\t}\n\t\tkey = id\n\t}\n\n\tswitch cmd {\n\tcase QuotaSet:\n\t\treturn m.handleQuotaSet(ctx, qtype, key, dpath, quotas, strict)\n\tcase QuotaGet:\n\t\treturn m.handleQuotaGet(ctx, qtype, key, dpath, quotas)","sourceCodeStart":576,"sourceCodeEnd":612,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/quota.go#L576-L612","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Create the directory first: `juicefs mkdir <meta> /some/dir`, or add `--create` to quota set so it creates the path.","Verify the path with `juicefs info <meta> /some/dir` and correct typos.","Use the absolute in-volume path as seen by JuiceFS, not a local bind-mount-relative path.","Decode the returned status code to identify non-ENOENT resolve failures (e.g. permission issues)."],"exampleFix":"// before\njuicefs quota set sqlite3://m.db --path /data   # /data does not exist\n// after\njuicefs mkdir sqlite3://m.db /data\njuicefs quota set sqlite3://m.db --path /data --capacity 10G","handlingStrategy":"validation","validationCode":"juicefs info \"$META_URL\" \"$QUOTA_PATH\" >/dev/null || { echo \"path not found in volume\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create directories before setting dir quotas (or use --create).","Use absolute in-volume paths, verified with juicefs info.","Script quota setup to fail fast when the path check fails."],"tags":["quota","directory","path"],"backgroundTag":"resource-not-found","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}