1

I have a very simple application with python and redis where python code sends numbers to the redis server using redis-py package. The application works perfectly while deployed on my local machine via docker compose.

The issue arises when I deploy the same application to AWS ECS cluster as an ECS service. AWS connects between ECS services using a method called "service connect".

For showing the error message easily, I will paste the screenshot of connecting via redis-cli from inside the python docker container instead of python tracebacks.

The error message is as follows:


error

I have checked the following:

  1. Ensured that port 6379 is open from python container

  2. Hostname "celeryredis" is running a redis server and the python container is able to access it.


telnet

ping

  1. Redis-server is not authenticated. But I have tried setting a password to the redis server and while connecting to it from the python code still raises the issue.

  2. I have also tried by explicitly setting the protocol via: r = redis.from_url("redis://celeryredis:6379/0")

  3. I have tried using awsvpc network mode in AWS and the issue persists.

  4. I have ensured that we are using tcp protocol.

  5. I have tried to use --loglevel as debug. But it does not show any connected clients.

  6. When connected from a python terminal, I am getting a 400 Bad request.


redis-py-error

I expect to get "OK" when I run ping() from the redis-cli

  • I'm facing the same issue. I think serviceconnect in ECS only supports HTTP/HTTPS traffic? I see conflicting documentation though – Mike Monteith Jul 18 '23 at 09:40

0 Answers0