Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] How can I connect to Redis server properly? #12090

Open
hiroaki2020 opened this issue Apr 21, 2023 · 1 comment
Open

[QUESTION] How can I connect to Redis server properly? #12090

hiroaki2020 opened this issue Apr 21, 2023 · 1 comment

Comments

@hiroaki2020
Copy link

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!

@hiroaki2020 hiroaki2020 changed the title [QUESTION] [QUESTION] How can I connect to Redis server properly? Apr 21, 2023
@uvletter
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants