diff --git a/redis/asyncio/connection.py b/redis/asyncio/connection.py index e67dc5b207..2e2a2502c3 100644 --- a/redis/asyncio/connection.py +++ b/redis/asyncio/connection.py @@ -363,7 +363,11 @@ async def on_connect(self) -> None: self._parser.on_connect(self) if len(auth_args) == 1: auth_args = ["default", auth_args[0]] - await self.send_command("HELLO", self.protocol, "AUTH", *auth_args) + # avoid checking health here -- PING will fail if we try + # to check the health prior to the AUTH + await self.send_command( + "HELLO", self.protocol, "AUTH", *auth_args, check_health=False + ) response = await self.read_response() if response.get(b"proto") != int(self.protocol) and response.get( "proto" diff --git a/redis/connection.py b/redis/connection.py index ece17d752b..2391e74d2c 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -440,7 +440,11 @@ def on_connect(self): self._parser.on_connect(self) if len(auth_args) == 1: auth_args = ["default", auth_args[0]] - self.send_command("HELLO", self.protocol, "AUTH", *auth_args) + # avoid checking health here -- PING will fail if we try + # to check the health prior to the AUTH + self.send_command( + "HELLO", self.protocol, "AUTH", *auth_args, check_health=False + ) self.handshake_metadata = self.read_response() # if response.get(b"proto") != self.protocol and response.get( # "proto"