envoyproxy/envoy

Redis proxy custom_commands not allowed inside transactions

Open

#42094 opened on Nov 18, 2025

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C++ (27,997 stars) (5,373 forks)batch import
area/redisbughelp wanted

Description

Title: Redis proxy custom_commands not allowed inside transactions

Description: I have configured envoy to be a redis proxy in front of AWS Memory DB (valkey engine 7.3). i have added json.set to my custom commands list. When i execute json.set it is treated as a simple command. when i attempt to execute two json.set operations inside a transaction i get the error ...pipeline caused error: 'JSON.SET' command is not supported within transaction

according to the comment in the code here all 'simple' commands should be able to execute in a transaction and all 'custom commands' are supposed to be treated as 'simple' commands.

it appears that the command check here is missing a check to see if the command is in the custom commands list

Repro steps: requires docker runtime

run-envoy.sh

#!/bin/bash

docker run --rm -it \
-p 9901:9901 -p 6380:6380 \
-v $(pwd):/app \
envoyproxy/envoy:debug-dev \
envoy -c /app/envoy.yaml -l debug
% redis-cli -h localhost -p 6380
localhost:6380> multi
OK
localhost:6380(TX)> json.set somekey $ value
(error) 'json.set' command is not supported within transaction
localhost:6380(TX)> exit
%

Admin and Stats Output:

% curl localhost:9901/clusters
deny::observability_name::deny
deny::default_priority::max_connections::1024
deny::default_priority::max_pending_requests::1024
deny::default_priority::max_requests::1024
deny::default_priority::max_retries::3
deny::high_priority::max_connections::1024
deny::high_priority::max_pending_requests::1024
deny::high_priority::max_requests::1024
deny::high_priority::max_retries::3
deny::added_via_api::false

server_info.log

stats.log

Config:

minimal envoy.yaml for demonstrating issue

node:
  id: memorydb-gw-1
  cluster: memorydb-gw

static_resources:

  listeners:
  - name: redis_listener
    address:
      socket_address:
        address: 0.0.0.0
        port_value: 6380   # Port Envoy will listen on for Redis/Valkey clients
    filter_chains:
    - filters:
      - name: envoy.filters.network.redis_proxy
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.redis_proxy.v3.RedisProxy
          stat_prefix: derp
          settings:
            op_timeout: 5s
          prefix_routes:
            catch_all_route:
              cluster: deny # commands allowed to pass envoy will return a no upstream host error(normal)
          custom_commands:
            - json.set # my custom command that should be treated as a 'simple command'
  
  clusters:
  - name: deny
    connect_timeout: 1s
    type: STATIC
    load_assignment:
      cluster_name: deny
      endpoints: []


admin:
  address:
    socket_address: { address: 0.0.0.0, port_value: 9901 }

Logs: test.log

Call Stack: N/A - not crashing

Contributor guide