kantancoding / microservices-python

256 stars 157 forks source link

Pika IncompatibleProtocol Error #10

Closed onlyoneuche closed 1 year ago

onlyoneuche commented 1 year ago

Pika is unable to successfully spin up a BlockingConnection. I am suspecting it is expecting some SSL config, but that was not done in the lessons.

Traceback (most recent call last): File "/app/server.py", line 16, in <module> connection = pika.BlockingConnection(pika.ConnectionParameters("rabbitmq")) File "/usr/local/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 360, in __init__ self._impl = self._create_connection(parameters, _impl_class) File "/usr/local/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection raise self._reap_last_connection_workflow_error(error) pika.exceptions.IncompatibleProtocolError: StreamLostError: ('Transport indicated EOF',)

onlyoneuche commented 1 year ago

I was able to fix this by passing the container IP address instead of the container name.