librdkafka
librdkafka copied to clipboard
Kafka + kerbos authentication +GSSAPI for node js application -> broker transport failure
Read the FAQ first: https://github.com/edenhill/librdkafka/wiki/FAQ
Do NOT create issues for questions, use the discussion forum: https://github.com/edenhill/librdkafka/discussions
Description
We are trying to use Kafka + kerbos authentication +GSSAPI for node js application for enterprise chat applictaion. We are getting below error . What could be the reason for this error , any help is highly appreciated . if you have any referennce for similar implemntaion , please share ...
broker transport failure.
It is working fine for JAVA client , failing from NODE JS Client.
this is our client configurations. const kafkaConsumer = new KafkaConsumer({ 'client.id': ['myserver', hostname()].join('-'), 'group.id': 'kf__write_test', 'rebalance_cb': true, 'metadata.broker.list': [servers], 'security.protocol': "sasl_ssl", 'sasl.mechanisms': 'GSSAPI', 'sasl.password': 'changeit', 'ssl.ca.location': path.resolve(__dirname, '../../cache/certs/...'), "sasl.kerberos.service.name": "", "sasl.kerberos.principal": ", "sasl.kerberos.keytab": path.resolve(__dirname, '../../cache/certs/..'), "sasl.kerberos.kinit.cmd": "%{sasl.kerberos.keytab}", "debug": "all" }, { 'auto.offset.reset': 'beginning', })
How to reproduce
Above is the configuration
IMPORTANT: Always try to reproduce the issue on the latest released version (see https://github.com/edenhill/librdkafka/releases), if it can't be reproduced on the latest version the issue has been fixed.
Checklist
IMPORTANT: We will close issues where the checklist has not been completed.
Please provide the following information:
- [x] librdkafka version (release number or git tag):
2.14.0
- [ ] Apache Kafka version: ``
- [x] librdkafka client configuration:
Mentioned above
- [ ] Operating system:
trying on my loacl macbook
- [ ] Provide logs (with
debug=..
as necessary) from librdkafka - [ ] Provide broker log excerpts
- [ ] Critical issue
Reproduce with "debug": "protocol,security,broker"
and provide the logs.
Please also specify the librdkafka version in use, with debugging enabled it will be emitted soon after the client instance is created.
protocol,security,broker
please see the error.

Please also specify the librdkafka version in use, with debugging enabled it will be emitted soon after the client instance is created.
"node-rdkafka": "^2.14.0",
Do you have sample client code for Kafka + kerbos authentication +GSSAPI for node js ? just want to make sure i was follwing the right configuration
"node-rdkafka": "^2.14.0",
That's the node-rdkafka version, not librdkafka version
Reproduce with "debug": "protocol,security,broker" and provide the logs.
"node-rdkafka": "^2.14.0",
That's the node-rdkafka version, not librdkafka version
1.9.2
Reproduce with "debug": "protocol,security,broker" and provide the logs.
320 timing command:install Completed in 41507ms
321 verbose stack Error: command failed
321 verbose stack at ChildProcess.gyp
failed with exit code: 1
332 error gyp ERR! stack at ChildProcess.onCpExit (/Users//APP/APP/chat-socket-server/node_modules/node-rdkafka/node_modules/node-gyp/lib/configure.js:259:16)
332 error gyp ERR! stack at ChildProcess.emit (node:events:390:28)
332 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
332 error gyp ERR! System Darwin 21.6.0
332 error gyp ERR! command "/Users//.nvm/versions/node/v16.10.0/bin/node" "/Users//APP/APP/chat-socket-server/node_modules/node-rdkafka/node_modules/.bin/node-gyp" "rebuild"
332 error gyp ERR! cwd /Users//APP/APP/chat-socket-server/node_modules/node-rdkafka
332 error gyp ERR! node -v v16.10.0
332 error gyp ERR! node-gyp -v v8.4.1
332 error gyp ERR! not ok
332 error Waiting for the debugger to disconnect...
333 verbose exit 1
Also , i am using node 16.10.0 .Please suggest the right node version also .
adding a note SASL with plain text is workign fine with node-rdkafka , SASL with GSSAPI is failing with broker transport failure
const kafkaConsumer = new KafkaConsumer({ 'client.id': ['myserver', hostname()].join('-'), 'group.id': 'kf_ts_sh_cvdshp_write_test', 'rebalance_cb': true, 'metadata.broker.list': '', 'security.protocol': "sasl_plaintext", 'sasl.mechanisms': 'PLAIN', 'sasl.password': ' 'sasl.username': '', "debug": "protocol,security,broker" }, { 'auto.offset.reset': 'beginning', })
@edenhill , any help is highly appreciated ?
Hello, were you able to solve this?