Skip to content

Can not connect with SASL_PLAINTEX and GSSAPI: kafka.future:Error processing callback #1259

Closed
@gm9794

Description

@gm9794

Hi,

following the #1255 and its fix provided in #1257, we can move a few steps ahead, but another error appears (see log below).

Thanks.

>>> 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
DEBUG:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667> Response 1: SaslHandShakeResponse_v0(error_code=0, enabled_mechanisms=['GSSAPI'])
DEBUG:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: canonical Servicename: kafka/[email protected]
ERROR:kafka.future:Error processing callback
Traceback (most recent call last):
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/future.py", line 79, in _call_backs
    f(value)
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 471, in _handle_sasl_handshake_response
    return self._try_authenticate_gssapi(future)
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/kafka/conn.py", line 541, in _try_authenticate_gssapi
    log.debug("%s: initiator name: %s", self, ctx_Context.initiator_name)
  File "/opt/continuum/anaconda3/lib/python3.6/site-packages/gssapi/_utils.py", line 64, in inquire_property
    raise AttributeError(msg)
AttributeError: Cannot read {0} from a security context whose establishment has not yet been started.
WARNING:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: No in-flight-requests to recv
WARNING:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: No in-flight-requests to recv
WARNING:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: No in-flight-requests to recv
WARNING:kafka.conn:<BrokerConnection node_id=bootstrap host=kafka1-lab.company.com/10.24.28.27 port=6667>: No in-flight-requests to recv

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