I am not sure if this is a bug or a mistake in my configuration but I am facing the following error.

I try to connect my laravel app container to redis container in AWS ECS. I checked the connection between 2 containers is ok. (Specifically I run ecs exec to app container and run ping kvs from inside the container. The result was no packet loss. I also run nc -v kvs 6379 and the result was kvs [127.255.0.2] 6379 (?) open. *Plz note kvs is my service connect's redis server hostname) When I run php artisan migrate I got

In PhpRedisConnector.php line 87:
protocol error, got 'H' as reply type byte
[2023-04-20 13:26:33] testing.ERROR: protocol error, got 'H' as reply type byte
{"exception":"[object] (RedisException(code: 0): protocol error, got 'H' as reply type byte
atwork/backend/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:87)
[stacktrace]
#0 /work/backend/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php(87): Redis->auth()
…

In addition, I ecs exec to the app container and run redis-cli like the following.

redis-cli -h kvs(my redis hostname) -p 6379 -a "password" PING
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.

I/O error
Error: Protocol error, got "H" as reply type byte

Since connection between servers seems fine and 2 redis clients (phpredis and redis-cli) give me the same error, I come here and ask for help.

Related stackoverflow post

I am happy to provide additional info if necessary. Thanks!

Comment From: uvletter

you can try tcpdump to capture the packages, e.g. sudo tcpdump -nvvv port 6379