{"record":{"id":"e05ed16f88b0aafa","repo":"juicedata/juicefs","slug":"list-sessions-v","errorCode":null,"errorMessage":"list sessions: %v","messagePattern":"list sessions: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/status.go","lineNumber":60,"sourceCode":"}\n\ntype Sections struct {\n\tSetting  *Format\n\tSessions []*Session\n\tStat     *Statistic\n}\n\n// Status retrieves the status of the filesystem\nfunc Status(ctx context.Context, m Meta, trash bool, sections *Sections) error {\n\tformat, err := m.Load(true)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load setting: %v\", err)\n\t}\n\tformat.RemoveSecret()\n\n\tsessions, err := m.ListSessions()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"list sessions: %v\", err)\n\t}\n\n\tstat := &Statistic{}\n\tvar totalSpace uint64\n\tif err = m.StatFS(Background(), RootInode, &totalSpace, &stat.AvailableSpace, &stat.UsedInodes, &stat.AvailableInodes); err != syscall.Errno(0) {\n\t\treturn fmt.Errorf(\"stat fs: %v\", err)\n\t}\n\tstat.UsedSpace = totalSpace - stat.AvailableSpace\n\n\tif trash {\n\t\tprogress := utils.NewProgress(false)\n\t\tdefer progress.Done()\n\t\ttrashFileSpinner := progress.AddDoubleSpinner(\"Trash Files\")\n\t\tpendingDeletedFileSpinner := progress.AddDoubleSpinner(\"Pending Deleted Files\")\n\t\ttrashSlicesSpinner := progress.AddDoubleSpinner(\"Trash Slices\")\n\t\tpendingDeletedSlicesSpinner := progress.AddDoubleSpinner(\"Pending Deleted Slices\")\n\t\terr = m.ScanDeletedObject(\n\t\t\tWrapContext(ctx),","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/status.go#L42-L78","documentation":"After loading the format, `juicefs status` lists active client sessions from the metadata engine. If ListSessions fails (metadata backend error, corrupted session records, connectivity hiccup), Status aborts with this wrapped error.","triggerScenarios":"Running `juicefs status META-URL` when the engine's ListSessions implementation returns an error — e.g. Redis HGETALL on the sessions hash fails mid-scan, SQL session table is missing/corrupt, or the connection drops during listing.","commonSituations":"Metadata backend restarted or failed over while status was running; manually deleting session keys/rows from the backend leaving inconsistent records; schema drift after restoring a partial SQL backup (sessions table missing).","solutions":["Retry `juicefs status` — transient backend failures often resolve on their own.","Check backend health and latency (redis INFO, mysql SHOW PROCESSLIST) around the time of failure.","If a restored/partial metadata store is missing session structures, verify against a fresh `juicefs dump` of a healthy volume; restore fully rather than partially.","Upgrade JuiceFS if the inner error points to a parsing bug in a specific engine's session code."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"redis-cli -u \"$META_URL\" PING || echo \"backend down; fix before running status\"","typeGuard":null,"tryCatchPattern":"for i := 0; i < 3; i++ {\n    if err := execStatus(metaURL); err == nil { break }\n    if !strings.Contains(err.Error(), \"list sessions\") { log.Fatal(err) }\n    time.Sleep(2 * time.Second)\n}","preventionTips":["Never hand-edit or partially restore backend session keys/tables","Monitor metadata backend availability and failovers","Restore metadata only from complete juicefs dump backups"],"tags":["cli","metadata","sessions","redis","mysql"],"backgroundTag":"database-query-failed","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"}