Skip to content

Can not connect with SASL_PLAINTEX and GSSAPI #1255

Closed
@gm9794

Description

@gm9794

I am trying to connect to Kafka in a Kerberized cluster. Java applications work fine, but using Python I came across an connection/authentication issue.
Environment:

  • Kafka 0.10.0.2.6
  • Kerberos 5 version 1.12.2 (MS AD server)
  • Python 3.6.1 |Anaconda 4.4.0 (64-bit)
  • kafka-python (1.3.6.dev0)
  • gssapi (1.2.2)
>>> consumer = KafkaConsumer('test1'
...                          ,bootstrap_servers=['kafka1-lab.company.com:6667']
...                          ,api_version=(0,10,0)
...                          ,group_id='python_client'
...                          ,security_protocol='SASL_PLAINTEXT'
...                          ,sasl_mechanism='GSSAPI')
DEBUG:kafka.metrics.metrics:Added sensor with name connections-closed
DEBUG:kafka.metrics.metrics:Added sensor with name connections-created
DEBUG:kafka.metrics.metrics:Added sensor with name select-time
DEBUG:kafka.metrics.metrics:Added sensor with name io-time
INFO:kafka.client:Bootstrapping cluster metadata from [('kafka1-lab.company.com', 6667, <AddressFamily.AF_UNSPEC: 0>)]
DEBUG:kafka.client:Attempting to bootstrap via node at kafka1-lab.company.com:6667
DEBUG:kafka.metrics.metrics:Added sensor with name bytes-sent-received
DEBUG:kafka.metrics.metrics:Added sensor with name bytes-sent
DEBUG:kafka.metrics.metrics:Added sensor with name bytes-received
DEBUG:kafka.metrics.metrics:Added sensor with name request-latency
DEBUG:kafka.metrics.metrics:Added sensor with name node-bootstrap.bytes-sent
DEBUG:kafka.metrics.metrics:Added sensor with name node-bootstrap.bytes-received
DEBUG:kafka.metrics.metrics:Added sensor with name node-bootstrap.latency
DEBUG:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/kafka1-lab.company.com port=6667>: creating new socket
DEBUG:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: setting socket option (6, 1, 1)
INFO:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: connecting to 10.24.28.27:6667
DEBUG:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: established TCP connection
DEBUG:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: initiating SASL authentication
DEBUG:kafka.protocol.parser:Sending request SaslHandShakeRequest_v0(mechanism='GSSAPI')
DEBUG:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667> Request 1: SaslHandShakeRequest_v0(mechanism='GSSAPI')
DEBUG:kafka.protocol.parser:Received correlation id: 1
DEBUG:kafka.protocol.parser:Processing response SaslHandShakeResponse_v0

At this step the program hangs.

Any idea what is wrong and how to fix the issue ?
Or how to debug it ?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions