{"record":{"id":"4cb34b36cadc3de2","repo":"juicedata/juicefs","slug":"getattr-inode-d-s","errorCode":null,"errorMessage":"getattr inode %d: %s","messagePattern":"getattr inode (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/base.go","lineNumber":2364,"sourceCode":"\t}\n}\n\nfunc (m *baseMeta) GetPaths(ctx Context, inode Ino) []string {\n\tif inode == RootInode {\n\t\treturn []string{\"/\"}\n\t}\n\n\tif inode == TrashInode {\n\t\treturn []string{\"/.trash\"}\n\t}\n\n\toutside := \"path not shown because it's outside of the mounted root\"\n\tgetDirPath := func(ino Ino) (string, error) {\n\t\tvar names []string\n\t\tvar attr Attr\n\t\tfor ino != RootInode && ino != m.root {\n\t\t\tif st := m.en.doGetAttr(ctx, ino, &attr); st != 0 {\n\t\t\t\treturn \"\", fmt.Errorf(\"getattr inode %d: %s\", ino, st)\n\t\t\t}\n\t\t\tif attr.Typ != TypeDirectory {\n\t\t\t\treturn \"\", fmt.Errorf(\"inode %d is not a directory\", ino)\n\t\t\t}\n\t\t\tvar entries []*Entry\n\t\t\tif st := m.en.doReaddir(ctx, attr.Parent, 0, &entries, -1); st != 0 {\n\t\t\t\treturn \"\", fmt.Errorf(\"readdir inode %d: %s\", ino, st)\n\t\t\t}\n\t\t\tvar name string\n\t\t\tfor _, e := range entries {\n\t\t\t\tif e.Inode == ino {\n\t\t\t\t\tname = string(e.Name)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif attr.Parent == RootInode && ino == TrashInode {\n\t\t\t\tname = TrashName\n\t\t\t}","sourceCodeStart":2346,"sourceCodeEnd":2382,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/base.go#L2346-L2382","documentation":"When resolving a directory path (e.g. for session info or subdir display), getDirPath walks parents via doGetAttr; if getattr on an inode fails, this error wraps the status code. It means an inode in the ancestor chain could not be stat'ed — typically a dangling or concurrently-deleted ancestor, or a metadata lookup error.","triggerScenarios":"An ancestor inode of m.root was deleted while building the path; metadata engine lookup failure returning a nonzero status for an internal inode; corrupted parent links.","commonSituations":"Deleting the mounted subdirectory while a client is running; metadata inconsistencies after failed loads; races during concurrent rm -rf of ancestor directories.","solutions":["Re-mount with a valid existing subdirectory path (--subdir) and avoid deleting mounted ancestors","Check metadata consistency (juicefs fsck) for dangling inodes/parent links","Investigate the underlying doGetAttr status from metadata engine logs"],"exampleFix":"// before: subdir deleted while mounted\njuicefs mount redis://meta /jfs --subdir /gone\n// after: use an existing subdir\njuicefs mount redis://meta /jfs --subdir /data","handlingStrategy":"try-catch","validationCode":"// before mounting with --subdir, verify the path exists:\n// juicefs info <meta-url> /data","typeGuard":null,"tryCatchPattern":"if _, err := buildDirPath(ctx, rootIno); err != nil { if strings.Contains(err.Error(), \"getattr inode\") { log.Warnf(\"ancestor missing; remount required: %v\", err) } }","preventionTips":["Never delete directories that are mount roots/subdirs of running clients","Run `juicefs fsck` after suspected metadata corruption","Use stable, dedicated paths as subdir mount points"],"tags":["metadata","filesystem","inode"],"backgroundTag":"entity-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"}