diff --git a/docs/root/intro/arch_overview/other_protocols/redis.rst b/docs/root/intro/arch_overview/other_protocols/redis.rst index f36443a5cb2e..c3890510653b 100644 --- a/docs/root/intro/arch_overview/other_protocols/redis.rst +++ b/docs/root/intro/arch_overview/other_protocols/redis.rst @@ -302,7 +302,7 @@ Envoy can also generate its own errors in response to the client. the connection." invalid request, "Command was rejected by the first stage of the command splitter due to datatype or length." - unsupported command, "The command was not recognized by Envoy and therefore cannot be serviced + ERR unknown command, "The command was not recognized by Envoy and therefore cannot be serviced because it cannot be hashed to a backend server." finished with n errors, "Fragmented commands which sum the response (e.g. DEL) will return the total number of errors received if any were received." diff --git a/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc b/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc index 86cc1c8f077c..c4bddd704f5e 100644 --- a/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc +++ b/source/extensions/filters/network/redis_proxy/command_splitter_impl.cc @@ -839,7 +839,8 @@ SplitRequestPtr InstanceImpl::makeRequest(Common::Redis::RespValuePtr&& request, if (handler == nullptr) { stats_.unsupported_command_.inc(); callbacks.onResponse(Common::Redis::Utility::makeError( - fmt::format("unsupported command '{}'", request->asArray()[0].asString()))); + fmt::format("ERR unknown command '{}', with args beginning with: {}", + request->asArray()[0].asString(), request->asArray()[1].asString()))); return nullptr; } diff --git a/test/extensions/filters/network/redis_proxy/command_splitter_impl_test.cc b/test/extensions/filters/network/redis_proxy/command_splitter_impl_test.cc index 2df14288c0fe..285da6ce3628 100644 --- a/test/extensions/filters/network/redis_proxy/command_splitter_impl_test.cc +++ b/test/extensions/filters/network/redis_proxy/command_splitter_impl_test.cc @@ -173,7 +173,7 @@ TEST_F(RedisCommandSplitterImplTest, InvalidRequestArrayNotStrings) { TEST_F(RedisCommandSplitterImplTest, UnsupportedCommand) { Common::Redis::RespValue response; response.type(Common::Redis::RespType::Error); - response.asString() = "unsupported command 'newcommand'"; + response.asString() = "ERR unknown command 'newcommand', with args beginning with: hello"; EXPECT_CALL(callbacks_, connectionAllowed()).WillOnce(Return(true)); EXPECT_CALL(callbacks_, onResponse_(PointeesEq(&response))); Common::Redis::RespValuePtr request{new Common::Redis::RespValue()};