{"record":{"id":"e282136b2162246d","repo":"juicedata/juicefs","slug":"get-s-err-w","errorCode":null,"errorMessage":"get %s err: %w","messagePattern":"get (.+?) err: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/redis_bak.go","lineNumber":329,"sourceCode":"\t}\n\n\tacls := make([]*pb.Acl, 0, len(vals))\n\tfor k, v := range vals {\n\t\tid, _ := strconv.ParseUint(k, 10, 32)\n\t\tacls = append(acls, &pb.Acl{\n\t\t\tId:   uint32(id),\n\t\t\tData: []byte(v),\n\t\t})\n\t}\n\treturn dumpResult(ctx, ch, &dumpedResult{msg: &pb.Batch{Acls: acls}})\n}\n\nfunc (m *redisMeta) dumpQuotas(ctx Context, quotas *[]*pb.Quota, qtype uint32) error {\n\tquotaMap := make(map[uint64]*pb.Quota)\n\tquotaKeys, _ := m.getQuotaKeys(qtype)\n\tvals, err := m.rdb.HGetAll(ctx, quotaKeys.usedInodesKey).Result()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"get %s err: %w\", quotaKeys.usedInodesKey, err)\n\t}\n\tfor k, v := range vals {\n\t\tid, err := strconv.ParseUint(k, 10, 64)\n\t\tif err != nil {\n\t\t\tlogger.Warnf(\"parse used inodes %d: %s: %v\", qtype, k, err)\n\t\t\tcontinue\n\t\t}\n\t\tusedInodes, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\tlogger.Warnf(\"invalid usedInodes for %d %s: %s\", qtype, k, v)\n\t\t\tcontinue\n\t\t}\n\n\t\tusedSpace, err := m.rdb.HGet(ctx, quotaKeys.usedSpaceKey, k).Int64()\n\t\tif err != nil && err != redis.Nil {\n\t\t\treturn err\n\t\t}\n","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/redis_bak.go#L311-L347","documentation":"Wrapped by dumpQuotas in redis_bak.go:329 when HGetAll on the quota type's usedInodesKey hash fails during a metadata dump. The Redis error is wrapped with the key name so the dump operation can report exactly which hash could not be read. Any Redis connectivity/cluster error on that hash triggers it, aborting the quota section of the dump.","triggerScenarios":"Running `juicefs dump` against a Redis metadata engine while HGetAll(<usedInodesKey>) returns an error — connection loss, MOVED/cluster misconfiguration, READONLY replica, or timeouts.","commonSituations":"Dumping while Redis is failing over; dump targeting a read-only replica; cluster client pointing at wrong slots; network interruption during a large dump.","solutions":["Read the wrapped Redis error: fix connectivity (address, password, network) and retry the dump.","If the target is a replica returning READONLY, dump from the primary.","For cluster errors (MOVED), ensure the client uses the cluster mode URL so slots are followed.","Increase timeouts or retry during load/traffic peaks; dump during a quieter window."],"exampleFix":"// before: dump against replica\njuicefs dump redis://replica:6379/1 out.json\n// after: dump against primary\njuicefs dump redis://primary:6379/1 out.json","handlingStrategy":"retry","validationCode":"// shell: verify Redis reachable and writable before dumping\nredis-cli -h primary -p 6379 ping || exit 1\nredis-cli -h primary -p 6379 info replication | grep role:master || echo \"warning: replica target\"","typeGuard":null,"tryCatchPattern":"if err := dumpMeta(...); err != nil {\n    if strings.Contains(err.Error(), \"get \") && strings.Contains(err.Error(), \"usedInodes\") {\n        // transient Redis failure: back off and retry the dump\n    }\n    return err\n}","preventionTips":["Dump from the primary, not a read-only replica.","Use the cluster-mode URL for Redis Cluster so MOVED errors are handled.","Schedule dumps during low-traffic windows and on a stable network.","Check the wrapped inner error — it names the exact Redis failure."],"tags":["redis","dump","quota","hgetall"],"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-14T00:17:10.932Z"}