You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to consume from a topic, hosted in another vpc in the same region, into my ec2 instace. All the permissions are correct and I can consume from the cli in ec2 but my aiokafka script is unable to do so.
Error
Running the consume gives me this error: aiokafka.errors.KafkaConnectionError: KafkaConnectionError: Connection at b-3.iam.mskclusterebuplatforms.58sqax.c5.kafka.eu-west-1.amazonaws.com:14003 closed
Traceback:
Starting consumer <aiokafka.consumer.consumer.AIOKafkaConsumer object at 0x7f0fb67af8d0>
Traceback (most recent call last):
File "/home/ec2-user/repos/anomaly-detection-service/.venv/lib/python3.11/site-packages/aiokafka/conn.py", line 384, in _on_read_task_error
read_task.result()
File "/home/ec2-user/repos/anomaly-detection-service/.venv/lib/python3.11/site-packages/aiokafka/conn.py", line 527, in _read
resp = await reader.readexactly(4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ec2-user/.pyenv/versions/3.11.0/lib/python3.11/asyncio/streams.py", line 726, in readexactly
raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 4 expected bytes
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ec2-user/repos/anomaly-detection-service/test.py", line 57, in <module>
asyncio.run(main())
File "/home/ec2-user/.pyenv/versions/3.11.0/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/home/ec2-user/.pyenv/versions/3.11.0/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ec2-user/.pyenv/versions/3.11.0/lib/python3.11/asyncio/base_events.py", line 650, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/ec2-user/repos/anomaly-detection-service/test.py", line 45, in main
await consumer.start()
File "/home/ec2-user/repos/anomaly-detection-service/.venv/lib/python3.11/site-packages/aiokafka/consumer/consumer.py", line 356, in start
await self._client.bootstrap()
File "/home/ec2-user/repos/anomaly-detection-service/.venv/lib/python3.11/site-packages/aiokafka/client.py", line 210, in bootstrap
bootstrap_conn = await create_conn(
^^^^^^^^^^^^^^^^^^
File "/home/ec2-user/repos/anomaly-detection-service/.venv/lib/python3.11/site-packages/aiokafka/conn.py", line 101, in create_conn
await conn.connect()
File "/home/ec2-user/repos/anomaly-detection-service/.venv/lib/python3.11/site-packages/aiokafka/conn.py", line 237, in connect
await self._do_sasl_handshake()
File "/home/ec2-user/repos/anomaly-detection-service/.venv/lib/python3.11/site-packages/aiokafka/conn.py", line 320, in _do_sasl_handshake
auth_bytes = await self._send_sasl_token(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ec2-user/repos/anomaly-detection-service/.venv/lib/python3.11/site-packages/aiokafka/util.py", line 41, in wait_for
return await fut
^^^^^^^^^
aiokafka.errors.KafkaConnectionError: KafkaConnectionError: Connection at b-3.iam.democluster.58sqax.c5.kafka.eu-west-1.amazonaws.com:14003 closed
Unclosed AIOKafkaConsumer
consumer: <aiokafka.consumer.consumer.AIOKafkaConsumer object at 0x7f0fb67af8d0>
The text was updated successfully, but these errors were encountered:
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
What I did
Consumer script:
Description
I wanted to consume from a topic, hosted in another vpc in the same region, into my ec2 instace. All the permissions are correct and I can consume from the cli in ec2 but my aiokafka script is unable to do so.
Error
Running the consume gives me this error:
aiokafka.errors.KafkaConnectionError: KafkaConnectionError: Connection at b-3.iam.mskclusterebuplatforms.58sqax.c5.kafka.eu-west-1.amazonaws.com:14003 closed
Traceback:
The text was updated successfully, but these errors were encountered: