2

I am using kafka-python to connect to Kafka Cluster using SASL

consumer = KafkaConsumer(bootstrap_servers=['fooserver1:9092', 'fooserver2:9092'], client_id='foo', api_version=(2,2,1), security_protocol='SASL_SSL', sasl_mechanism='SCRAM-SHA-512', sasl_plain_username='myusername', sasl_plain_password='password123')

However I am getting the following error while connecting:

<BrokerConnection node_id=bootstrap-0 host=fooserver1:9092 <authenticating> [IPv4 ('my.ip.ad.dress', 9092)]>: Error receiving reply from server
Traceback (most recent call last):    
File "/opt/python/kafka/conn.py", line 692, in _try_authenticate_scram(data_len,) = struct.unpack('>i', self._recv_bytes_blocking(4))
File "/opt/python/kafka/conn.py", line 616, in _recv_bytes_blocking raise ConnectionError('Connection reset during recv')
ConnectionError: Connection reset during recv

I have made sure that appropriate ports are open for establishing connections. I need help in resolving this error.

NinjaTurtle
  • 93
  • 1
  • 6

1 Answers1

0

This error may appear if you enter an incorrect username/password combination.

You could try verifying whether the username/password used when configuring the Kafka cluster is the same username/password you are using in kafka-python.

Appeltaart
  • 111
  • 4