Support Questions

Find answers, ask questions, and share your expertise

Kafka unexpected handshake request error

avatar
Super Collaborator

My issue look identical to https://community.hortonworks.com/questions/90687/kafka-gssapi-error.html , but I already checked that the broker is listening to the port 6667. I would like to get the command line producer working.

/usr/hdp/2.5.3.0-37/kafka/bin/kafka-console-producer.sh --broker-list cgihdp0.localnet:6667 --topic TSTRECV --security-protocol SASL_PLAINTEXT

And i am getting this error (repeatedly):

[2017-12-10 18:31:52,979] WARN Unexpected error from cgihdp0.localnet/10.30.152.13; closing connection (org.apache.kafka.common.network.Selector)
org.apache.kafka.common.errors.IllegalSaslStateException: Unexpected handshake request with client mechanism GSSAPI, enabled mechanisms are [GSSAPI]<br>

Up to here it seems to be the same issue as the one I listed above, but there the solution was a different broker port, while in my config, the port really is 6667:

netstat -tulpn | grep 6667
tcp        0      0 10.30.152.13:6667           0.0.0.0:*                   LISTEN      32355/java 
2 REPLIES 2

avatar
Contributor

1. Try with PLAINTEXTSASL instead of SASL_PLAINTEXT

2. Do you have rangers as well? please retry after restarting ranger service if you have

avatar
Super Collaborator

1. I tried PLAINTEXTSASL, but the error is the same as when I use SASL_PLAINTEXT

2. Yes, Ranger is used as well. So I restarted Ranger and tried again (PLAINTEXTSASL and SASL_PLAINTEXT), but with no difference in the error message.

Now I tried out of curiosity PLAIN (results in a Java exception "No enum constant org.apache.kafka.common.protocol.SecurityProtocol.PLAIN") and then also PLAINTEXT, which results in a different error message:

[2017-12-11 00:23:18,240] WARN Error while fetching metadata with correlation id 0 : {TSTRECV=TOPIC_AUTHORIZATION_FAILED} (org.apache.kafka.clients.NetworkClient)