{"record":{"id":"cdd7f9c2fdea7934","repo":"juicedata/juicefs","slug":"dumpmeta-error-v-cdd7f9","errorCode":null,"errorMessage":"DumpMeta error: %v","messagePattern":"DumpMeta error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/redis.go","lineNumber":4952,"sourceCode":"\t\tif i != len(entries)-1 {\n\t\t\tbwWrite(\",\")\n\t\t}\n\t\tif showProgress != nil {\n\t\t\tshowProgress(0, 1)\n\t\t}\n\t}\n\tbwWrite(fmt.Sprintf(\"\\n%s}\\n%s}\", strings.Repeat(jsonIndent, depth+1), strings.Repeat(jsonIndent, depth)))\n\treturn nil\n}\n\nfunc (m *redisMeta) DumpMeta(w io.Writer, root Ino, threads int, keepSecret, fast, skipTrash bool) (err error) {\n\tdefer func() {\n\t\tif p := recover(); p != nil {\n\t\t\tdebug.PrintStack()\n\t\t\tif e, ok := p.(error); ok {\n\t\t\t\terr = e\n\t\t\t} else {\n\t\t\t\terr = errors.Errorf(\"DumpMeta error: %v\", p)\n\t\t\t}\n\t\t}\n\t}()\n\tctx := Background()\n\tvar lastChangelog int64\n\tif m.getFormat().ChangeLog {\n\t\tlastLog, err := m.rdb.Get(ctx, m.txnLastLog()).Int64()\n\t\tif err == nil {\n\t\t\tlastChangelog = lastLog\n\t\t}\n\t}\n\tzs, err := m.rdb.ZRangeWithScores(ctx, m.delfiles(), 0, -1).Result()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdels := make([]*DumpedDelFile, 0, len(zs))\n\tfor _, z := range zs {\n\t\tparts := strings.Split(z.Member.(string), \":\")","sourceCodeStart":4934,"sourceCodeEnd":4970,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/redis.go#L4934-L4970","documentation":"This message is produced in redisMeta.dump (DumpMeta) as a panic-recovery fallback: if dump panics with a non-error value, it is converted into err = errors.Errorf(\"DumpMeta error: %v\", p) and returned. Callers of DumpMeta therefore see this wrapped message whenever the dump implementation hits an unrecovered panic — a programming/invariant bug in the dump path rather than an ordinary operational failure.","triggerScenarios":"Running `juicefs dump` (or backup) against a Redis metadata engine when the dump goroutine panics (e.g. nil dereference on an unexpected metadata record shape, index-out-of-range while iterating dumped entries); the deferred recover in redisMeta.dump converts the panic into this returned error.","commonSituations":"Dumping a volume whose metadata contains records written by a newer incompatible client; corrupted metadata entries; genuine bugs in a specific JuiceFS version's dump code.","solutions":["Report the panic (with debug.PrintStack output, which is printed) to JuiceFS with the version and meta type; this path indicates a bug.","Capture the stack trace and check release notes for a newer version fixing dump panics; upgrade the client.","Work around by taking a Redis RDB/AOF backup instead of a JSON dump if dump is consistently panicking.","Verify metadata integrity (gc/repair) in case the panic stems from corrupt records."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// No caller-side validation prevents an internal panic; capture diagnostics:\nerr := juicefs.Dump(ctx, meta, w, &meta.DumpOption{KeepSecret: false})","typeGuard":null,"tryCatchPattern":"if err := juicefs.Dump(ctx, meta, f, opt); err != nil {\n    if strings.Contains(err.Error(), \"DumpMeta error\") {\n        logger.Errorf(\"dump panicked, save stack + version for bug report: %v\", err)\n        // fall back to engine-native backup (RDB/AOF, SQL dump)\n    }\n    return err\n}","preventionTips":["Upgrade JuiceFS before dumping if the installed version is known to have dump bugs.","Report panics with the printed stack trace and `juicefs --version` upstream.","Run `juicefs gc`/repair first when metadata corruption is suspected.","Maintain engine-native backups (Redis RDB/AOF) as a dump fallback."],"tags":["go","redis","dump","panic"],"backgroundTag":"internal-invariant-violation","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"}