{"record":{"id":"53cace16eacba57a","repo":"juicedata/juicefs","slug":"load-meta-format","errorCode":null,"errorMessage":"load meta format","messagePattern":"load meta format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/base.go","lineNumber":2572,"sourceCode":"\t\t\tif needSyncVolumeStat && m.getFormat().TrashDays > 0 {\n\t\t\t\ttrashAttr := Attr{Typ: TypeDirectory}\n\t\t\t\tif st := m.walk(ctx, TrashInode, \"/.trash\", &trashAttr, func(_ Context, ino Ino, _ string, a *Attr) {\n\t\t\t\t\trecordStat(ino, a)\n\t\t\t\t}); st != 0 {\n\t\t\t\t\twalkError = true\n\t\t\t\t\tlogger.Errorf(\"Walk /.trash: %s\", st)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tnodes <- &node{inode, fpath, &attr}\n\t\t\tcount = 1\n\t\t}\n\t\tnodeBar.SetTotal(count)\n\t}()\n\n\tformat, err := m.Load(false)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"load meta format\")\n\t}\n\tif opt.SyncDirStat && !format.DirStats {\n\t\tlogger.Warn(\"dir stats is disabled, flag '--sync-dir-stat' will be ignored\")\n\t}\n\tvar lock sync.Mutex\n\tlistSlices := func(inode Ino, path string) {\n\t\tlock.Lock()\n\t\tif _, ok := opt.Slices[inode]; ok {\n\t\t\tlock.Unlock()\n\t\t\treturn\n\t\t}\n\t\topt.Slices[inode] = []Slice{}\n\t\tlock.Unlock()\n\t\trawSlices, st := m.en.doList(ctx, inode)\n\t\tif st != 0 {\n\t\t\tlogger.Errorf(\"dolist %s: %s\", path, st)\n\t\t\treturn\n\t\t}","sourceCodeStart":2554,"sourceCodeEnd":2590,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/base.go#L2554-L2590","documentation":"While loading metadata from the engine (m.Load inside a maintenance operation such as syncing slices), the stored volume format could not be read. The wrapped inner error carries the underlying cause from the metadata engine (connection failure, corrupted record, missing format).","triggerScenarios":"Calling maintenance commands that trigger m.loadFormat (e.g. juicefs gc, fsck, slice sync paths) when the metadata engine is unreachable, the format record was deleted/corrupted, or the metadata URL points to an empty/foreign database.","commonSituations":"Wrong metadata URL typo (pointing at an empty Redis DB), Redis flushed or format key deleted, network partition to the metadata engine, corrupted SQL row after partial restore from backup.","solutions":["Verify the metadata URL with 'juicefs status <meta-url>' — it should print the volume format","Check connectivity/auth to the metadata engine (redis-cli ping, mysql client connect)","If the format key was lost, restore metadata from the latest backup (juicefs dump output) or re-format only if data loss is acceptable","Inspect the wrapped inner error for the exact engine-side cause and fix accordingly"],"exampleFix":"// before (wrong db index, empty format)\njuicefs gc redis://127.0.0.1:6379/0\n// load meta format: ... not found\n// after (correct volume URL)\njuicefs gc redis://127.0.0.1:6379/1","handlingStrategy":"retry","validationCode":"// verify metadata is healthy before maintenance ops\nif err := exec.Command(\"juicefs\", \"status\", metaURL).Run(); err != nil {\n  // metadata unreachable or format missing; fix before running gc/dump\n}","typeGuard":null,"tryCatchPattern":"format, err := m.Load(false)\nif err != nil {\n  return errors.Wrap(err, \"load meta format\") // inspect wrapped cause; retry transient engine errors\n}","preventionTips":["Keep regular 'juicefs dump' backups so a lost format record can be restored","Validate the metadata URL before maintenance operations with 'juicefs status'","Monitor metadata engine connectivity (Redis ping / DB health checks)"],"tags":["metadata","redis","format","initialization"],"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-14T00:17:10.932Z"}