go-redis/redis · error
not implemented
Error message
not implemented
What it means
JSONDebugMemory panics with 'not implemented'. The method exists as a placeholder on the Cmdable surface for JSON.DEBUG MEMORY but has no RESP parsing wired, so calling it always panics.
Source
Thrown at json.go:469
}
cmd := NewIntSliceCmd(ctx, args...)
_ = c(ctx, cmd)
return cmd
}
// JSONClear clears container values (arrays/objects) and sets numeric values to 0.
// For more information, see https://redis.io/commands/json.clear
func (c cmdable) JSONClear(ctx context.Context, key, path string) *IntCmd {
args := []interface{}{"JSON.CLEAR", key, path}
cmd := NewIntCmd(ctx, args...)
_ = c(ctx, cmd)
return cmd
}
// JSONDebugMemory reports a value's memory usage in bytes (unimplemented)
// For more information, see https://redis.io/commands/json.debug-memory
func (c cmdable) JSONDebugMemory(ctx context.Context, key, path string) *IntCmd {
panic("not implemented")
}
// JSONDel deletes a value.
// For more information, see https://redis.io/commands/json.del
func (c cmdable) JSONDel(ctx context.Context, key, path string) *IntCmd {
args := []interface{}{"JSON.DEL", key, path}
cmd := NewIntCmd(ctx, args...)
_ = c(ctx, cmd)
return cmd
}
// JSONForget deletes a value.
// For more information, see https://redis.io/commands/json.forget
func (c cmdable) JSONForget(ctx context.Context, key, path string) *IntCmd {
args := []interface{}{"JSON.FORGET", key, path}
cmd := NewIntCmd(ctx, args...)
_ = c(ctx, cmd)
return cmdView on GitHub (pinned to 36d97525cd)
Solutions
- Do not call JSONDebugMemory; it is not yet implemented in go-redis.
- Issue the raw command via client.Do(ctx, "JSON.DEBUG", "MEMORY", key, path) and parse the reply manually if you need it.
- File/track an upstream issue if you require first-class support.
Example fix
// before n := client.JSONDebugMemory(ctx, key, "$") // after res := client.Do(ctx, "JSON.DEBUG", "MEMORY", key, "$") bytes, _ := res.Int64()
Defensive patterns
Strategy: fallback
Validate before calling
// Avoid JSONDebugMemory. If memory info is required, use the raw command:
res := client.Do(ctx, "JSON.DEBUG", "MEMORY", key, path)
if err := res.Err(); err != nil { return err }
bytes, _ := res.Int64() Prevention
- Do not call client.JSONDebugMemory; check the method doc comment before use.
- Use client.Do for not-yet-implemented JSON subcommands.
- Track upstream support status before relying on placeholder methods.
When it happens
Trigger: Calling client.JSONDebugMemory(ctx, key, path) on any client type.
Common situations: Discovering the method via IDE autocomplete or a command catalogue and assuming it works, or migrating from a client that implemented JSON.DEBUG MEMORY.
Related errors
- redis: JSON.SET mode must be NX or XX
- not implemented
- redis: failed to create connection pool: %w
- redis: failed to create pubsub pool: %w
- redis: failed to create pipeline connection pool: %w
AI-assisted analysis of go-redis/redis@36d97525cd (2026-08-06).
Data as JSON: /data/errors/742f52ff93e0c116.json.
Report an issue: GitHub.