{"record":{"id":"e555bcda3076530b","repo":"juicedata/juicefs","slug":"no-quota-for-inode-d-path-s","errorCode":null,"errorMessage":"no quota for inode %d path %s","messagePattern":"no quota for inode (.+?) path (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/quota.go","lineNumber":938,"sourceCode":"\t\t}\n\t}\n\treturn nil\n}\n\nfunc (m *baseMeta) handleQuotaCheck(ctx Context, qtype uint32, key uint64, dpath string, strict, repair bool, quotas map[string]*Quota) error {\n\tif qtype == UserQuotaType || qtype == GroupQuotaType {\n\t\treturn m.checkUGUsage(ctx, repair, quotas)\n\t}\n\treturn m.checkDirUsage(ctx, qtype, key, dpath, strict, repair, quotas)\n}\n\nfunc (m *baseMeta) checkDirUsage(ctx Context, qtype uint32, key uint64, dpath string, strict, repair bool, quotas map[string]*Quota) error {\n\tq, err := m.en.doGetQuota(ctx, qtype, key)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif q == nil {\n\t\treturn fmt.Errorf(\"no quota for inode %d path %s\", key, dpath)\n\t}\n\n\tvar sum Summary\n\tif st := m.GetSummary(ctx, Ino(key), &sum, true, strict); st != 0 {\n\t\treturn st\n\t}\n\n\tusedInodes := int64(sum.Dirs+sum.Files) - 1\n\tusedSpace := int64(sum.Size) - align4K(0) // quota ignore root dir\n\n\tif q.UsedInodes == usedInodes && q.UsedSpace == usedSpace {\n\t\tlogger.Infof(\"quota of %s is consistent\", dpath)\n\t\tquotas[dpath] = q\n\t\treturn nil\n\t}\n\n\tlogger.Warnf(\n\t\t\"%s: quota(%s, %s) != summary(%s, %s)\", dpath,","sourceCodeStart":920,"sourceCodeEnd":956,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/quota.go#L920-L956","documentation":"Raised by baseMeta.checkDirUsage (pkg/meta/quota.go:938) during `juicefs quota check` when doGetQuota returns no quota record for the given inode (directory quota key). It means the quota check was asked to verify a directory that has no quota set in the metadata engine. The check aborts for that path because there is nothing to compare usage against.","triggerScenarios":"Running `juicefs quota check <path>` (or the internal handleQuotaCheck path) for a directory inode whose dir-quota record was deleted concurrently (e.g. `juicefs quota remove`) or never existed, so doGetQuota returns (nil, nil).","commonSituations":"Quota removed by another admin while a check was running; typo in the path so it resolves to an un-quota'd directory; stale cached inode/path mapping after the quota was deleted; running check on a path with only a user/group quota but no directory quota.","solutions":["Verify the directory actually has a quota: run `juicefs quota list` or `juicefs quota get <path>`; if absent, set one with `juicefs quota set` before checking.","Re-run the check against the correct quota'd path (check for typos / wrong mount root).","If the quota was intentionally removed, ignore the error — check was started for a stale target.","Retry if removal raced with the check; run check again when no quota mutations are in flight."],"exampleFix":"// before: quota check on a dir without quota fails\n$ juicefs quota check /mnt/jfs/data\n// after: ensure the quota exists first\n$ juicefs quota set /mnt/jfs/data --capacity 100G\n$ juicefs quota check /mnt/jfs/data","handlingStrategy":"validation","validationCode":"// ensure a quota exists before running quota check\nq, err := meta.GetQuota(ctx, meta.DirQuotaType, uint64(ino))\nif err != nil { return err }\nif q == nil { return fmt.Errorf(\"no quota on inode %d; set one with `juicefs quota set` first\", ino) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `juicefs quota list` before check to confirm the target has a quota.","Avoid removing quotas concurrently with quota check runs.","Script quota checks to call `quota set` first when a quota is missing and expected."],"tags":["metadata","quota","resource-not-found"],"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"}