juicedata/juicefs · error
get %s err: %w
Error message
get %s err: %w
What it means
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.
Source
Thrown at pkg/meta/redis_bak.go:329
}
acls := make([]*pb.Acl, 0, len(vals))
for k, v := range vals {
id, _ := strconv.ParseUint(k, 10, 32)
acls = append(acls, &pb.Acl{
Id: uint32(id),
Data: []byte(v),
})
}
return dumpResult(ctx, ch, &dumpedResult{msg: &pb.Batch{Acls: acls}})
}
func (m *redisMeta) dumpQuotas(ctx Context, quotas *[]*pb.Quota, qtype uint32) error {
quotaMap := make(map[uint64]*pb.Quota)
quotaKeys, _ := m.getQuotaKeys(qtype)
vals, err := m.rdb.HGetAll(ctx, quotaKeys.usedInodesKey).Result()
if err != nil {
return fmt.Errorf("get %s err: %w", quotaKeys.usedInodesKey, err)
}
for k, v := range vals {
id, err := strconv.ParseUint(k, 10, 64)
if err != nil {
logger.Warnf("parse used inodes %d: %s: %v", qtype, k, err)
continue
}
usedInodes, err := strconv.ParseInt(v, 10, 64)
if err != nil {
logger.Warnf("invalid usedInodes for %d %s: %s", qtype, k, v)
continue
}
usedSpace, err := m.rdb.HGet(ctx, quotaKeys.usedSpaceKey, k).Int64()
if err != nil && err != redis.Nil {
return err
}
View on GitHub (pinned to c9a67b23e8)
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.
Example fix
// before: dump against replica juicefs dump redis://replica:6379/1 out.json // after: dump against primary juicefs dump redis://primary:6379/1 out.json
Defensive patterns
Strategy: retry
Validate before calling
// shell: verify Redis reachable and writable before dumping redis-cli -h primary -p 6379 ping || exit 1 redis-cli -h primary -p 6379 info replication | grep role:master || echo "warning: replica target"
Try / catch
if err := dumpMeta(...); err != nil {
if strings.Contains(err.Error(), "get ") && strings.Contains(err.Error(), "usedInodes") {
// transient Redis failure: back off and retry the dump
}
return err
} Prevention
- 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.
When it happens
Trigger: Running `juicefs dump` against a Redis metadata engine while HGetAll(<usedInodesKey>) returns an error — connection loss, MOVED/cluster misconfiguration, READONLY replica, or timeouts.
Common situations: Dumping while Redis is failing over; dump targeting a read-only replica; cluster client pointing at wrong slots; network interruption during a large dump.
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
- get dirDataLengthKey err: %w
- get dirUsedInodesKey err: %w
- get dirUsedSpaceKey err: %w
- load user/group quotas: %w
- unknown quota type: %d
AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06).
Data as JSON: /api/errors/e282136b2162246d.
Report an issue: GitHub.