{"record":{"id":"e574baa19d4617b8","repo":"juicedata/juicefs","slug":"fetch-all-metadata-from-db-s","errorCode":null,"errorMessage":"Fetch all metadata from DB: %s","messagePattern":"Fetch all metadata from DB: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/sql.go","lineNumber":4945,"sourceCode":"\t}()\n\n\tprogress := utils.NewProgress(false)\n\tdefer progress.Done()\n\tvar tree, trash *DumpedEntry\n\troot = m.checkRoot(root)\n\treturn m.roTxn(Background(), func(s *xorm.Session) error {\n\t\tvar lastChangelog int64\n\t\tif m.getFormat().ChangeLog {\n\t\t\tvar maxLog changeLog\n\t\t\tif ok, _ := s.Desc(\"id\").Limit(1).Get(&maxLog); ok {\n\t\t\t\tlastChangelog = maxLog.Id\n\t\t\t}\n\t\t}\n\t\tif root == RootInode && fast {\n\t\t\tdefer func() { m.snap = nil }()\n\t\t\tbar := progress.AddCountBar(\"Snapshot keys\", 0)\n\t\t\tif err = m.makeSnap(s, bar); err != nil {\n\t\t\t\treturn fmt.Errorf(\"Fetch all metadata from DB: %s\", err)\n\t\t\t}\n\t\t\tbar.Done()\n\t\t\ttree = m.dumpEntryFast(root, TypeDirectory)\n\t\t\tif !skipTrash {\n\t\t\t\ttrash = m.dumpEntryFast(TrashInode, TypeDirectory)\n\t\t\t}\n\t\t} else {\n\t\t\ttree = &DumpedEntry{\n\t\t\t\tName: \"FSTree\",\n\t\t\t\tAttr: &DumpedAttr{\n\t\t\t\t\tInode: root,\n\t\t\t\t\tType:  typeToString(TypeDirectory),\n\t\t\t\t},\n\t\t\t}\n\t\t\tif err = m.dumpEntry(s, root, TypeDirectory, tree, nil); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif root == RootInode && !skipTrash {","sourceCodeStart":4927,"sourceCodeEnd":4963,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/sql.go#L4927-L4963","documentation":"Returned by dbMeta.DumpMeta in fast mode when makeSnap fails to snapshot all metadata keys from the database into memory. It wraps the underlying query error — connection issues, timeouts, or lock contention during the snapshot pass.","triggerScenarios":"Thrown at pkg/meta/sql.go:4945 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the dump during a lower-traffic window","Check DB connectivity and long-running transactions blocking the snapshot"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}