juicedata/juicefs · error
list sessions: %v
Error message
list sessions: %v
What it means
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.
Source
Thrown at pkg/meta/status.go:60
}
type Sections struct {
Setting *Format
Sessions []*Session
Stat *Statistic
}
// Status retrieves the status of the filesystem
func Status(ctx context.Context, m Meta, trash bool, sections *Sections) error {
format, err := m.Load(true)
if err != nil {
return fmt.Errorf("load setting: %v", err)
}
format.RemoveSecret()
sessions, err := m.ListSessions()
if err != nil {
return fmt.Errorf("list sessions: %v", err)
}
stat := &Statistic{}
var totalSpace uint64
if err = m.StatFS(Background(), RootInode, &totalSpace, &stat.AvailableSpace, &stat.UsedInodes, &stat.AvailableInodes); err != syscall.Errno(0) {
return fmt.Errorf("stat fs: %v", err)
}
stat.UsedSpace = totalSpace - stat.AvailableSpace
if trash {
progress := utils.NewProgress(false)
defer progress.Done()
trashFileSpinner := progress.AddDoubleSpinner("Trash Files")
pendingDeletedFileSpinner := progress.AddDoubleSpinner("Pending Deleted Files")
trashSlicesSpinner := progress.AddDoubleSpinner("Trash Slices")
pendingDeletedSlicesSpinner := progress.AddDoubleSpinner("Pending Deleted Slices")
err = m.ScanDeletedObject(
WrapContext(ctx),View on GitHub (pinned to c9a67b23e8)
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.
Defensive patterns
Strategy: retry
Validate before calling
redis-cli -u "$META_URL" PING || echo "backend down; fix before running status"
Try / catch
for i := 0; i < 3; i++ {
if err := execStatus(metaURL); err == nil { break }
if !strings.Contains(err.Error(), "list sessions") { log.Fatal(err) }
time.Sleep(2 * time.Second)
} Prevention
- Never hand-edit or partially restore backend session keys/tables
- Monitor metadata backend availability and failovers
- Restore metadata only from complete juicefs dump backups
When it happens
Trigger: 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.
Common situations: 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).
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- stat fs: %v
- changelog is not enabled, use `juicefs config %s --changelog
- clone failed: %v
- compact [%d:%s] error: %s
- database %s is used by volume %s
AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06).
Data as JSON: /api/errors/e05ed16f88b0aafa.
Report an issue: GitHub.