Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package trying to auth with sasl but none provided #167

Open
maikelmclauflin opened this issue Dec 9, 2020 · 2 comments
Open

package trying to auth with sasl but none provided #167

maikelmclauflin opened this issue Dec 9, 2020 · 2 comments

Comments

@maikelmclauflin
Copy link
Contributor

hi there, i am using version 10.0.0-alpha.0 to connect to a confluent cp-kafka image, and i seem to have configured my network correctly, but i am now getting this error trace below. It is a little odd because i am not passing any sasl configuration options so i was wondering if you had any thoughts on it.

eyeshade-consumer    | sentry 2020-12-09T05:44:43.344Z sentry TypeError: Cannot read property 'toUpperCase' of undefined
eyeshade-consumer    |     at SASLAuthenticator.authenticate (/usr/src/app/node_modules/kafkajs/src/broker/saslAuthenticator/index.js:33:54)
eyeshade-consumer    |     at Broker.connect (/usr/src/app/node_modules/kafkajs/src/broker/index.js:120:29)
eyeshade-consumer    |     at processTicksAndRejections (internal/process/task_queues.js:93:5)
eyeshade-consumer    |     at async /usr/src/app/node_modules/kafkajs/src/cluster/brokerPool.js:79:9
eyeshade-consumer    |     at async Cluster.connect (/usr/src/app/node_modules/kafkajs/src/cluster/index.js:104:5)
eyeshade-consumer    |     at async Object.connect (/usr/src/app/node_modules/kafkajs/src/consumer/index.js:110:5)
eyeshade-consumer    | From previous event:
eyeshade-consumer    |     at /usr/src/app/node_modules/sinek/dist/lib/kafkajs/JSConsumer.js:221:36
eyeshade-consumer    | From previous event:
eyeshade-consumer    |     at JSConsumer._connectInFlow (/usr/src/app/node_modules/sinek/dist/lib/kafkajs/JSConsumer.js:202:16)
eyeshade-consumer    |     at JSConsumer.connect (/usr/src/app/node_modules/sinek/dist/lib/kafkajs/JSConsumer.js:171:21)
eyeshade-consumer    |     at /usr/src/app/bat-utils/lib/runtime-kafka.js:136:22
eyeshade-consumer    |     at Array.map (<anonymous>)
eyeshade-consumer    |     at Kafka.consume (/usr/src/app/bat-utils/lib/runtime-kafka.js:133:29)
eyeshade-consumer    |     at Object.<anonymous> (/usr/src/app/eyeshade/consumer.js:35:15)
eyeshade-consumer    |     at Module._compile (internal/modules/cjs/loader.js:1063:30)
eyeshade-consumer    |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
eyeshade-consumer    |     at Module.load (internal/modules/cjs/loader.js:928:32)
eyeshade-consumer    |     at Function.Module._load (internal/modules/cjs/loader.js:769:14)
eyeshade-consumer    |     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
eyeshade-consumer    |     at internal/main/run_main_module.js:17:47

config: https://github.com/brave-intl/bat-ledger/blob/removed-old-code/config.js#L113
batch config: https://github.com/brave-intl/bat-ledger/blob/removed-old-code/bat-utils/lib/runtime-kafka.js#L9
docker-compose: https://github.com/brave-intl/bat-ledger/blob/removed-old-code/docker-compose.yml#L18

not sure if this is just a me issue or if i found a tiny case where things don't match.

@maikelmclauflin
Copy link
Contributor Author

does node-sinek simply not support the confluent kafka image?

@maikelmclauflin
Copy link
Contributor Author

maikelmclauflin commented Dec 9, 2020

I was able to get the following logs by cloning this repo, and running the following commands:

yarn
yarn run kafka:start
yarn test
➜  node-sinek git:(master) ✗ yarn run kafka:start
yarn run v1.22.10
$ ./kafka-setup/start.sh
Clearing existing Kafka SSL certs...
Generating new Kafka SSL certs in "/Users/michaelmclaughlin/Documents/brave-intl/node-sinek/certs" folder...

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore docker.kafka.server.keystore.jks -destkeystore docker.kafka.server.keystore.jks -deststoretype pkcs12".
Generating a 2048 bit RSA private key
......................................................+++
...+++
writing new private key to 'ca-key'
-----
Subject Attribute S has no known NID, skipped
Certificate was added to keystore
Certificate was added to keystore

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore docker.kafka.server.keystore.jks -destkeystore docker.kafka.server.keystore.jks -deststoretype pkcs12".
Signature ok
subject=/C=DE/ST=Cologne/L=Cologne/O=None/OU=None/CN=localhost
Getting CA Private Key
Certificate was added to keystore

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore docker.kafka.server.keystore.jks -destkeystore docker.kafka.server.keystore.jks -deststoretype pkcs12".
Certificate reply was installed in keystore

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore docker.kafka.server.keystore.jks -destkeystore docker.kafka.server.keystore.jks -deststoretype pkcs12".
Importing keystore docker.kafka.server.keystore.jks to docker.kafka.server.keystore.p12...
Entry for alias caroot successfully imported.
Entry for alias localhost successfully imported.
Import command completed:  2 entries successfully imported, 0 entries failed or cancelled
MAC verified OK
No stopped containers
Creating network "kafka-setup_default" with the default driver
Creating kafka-setup_zookeeper_1 ... done
Creating kafka-setup_kafka_1     ... done
✨  Done in 38.38s.
➜  node-sinek git:(master) ✗ yarn run test       
yarn run v1.22.10
$ _mocha --recursive --timeout 32500 --exit -R spec test/int
(node:84430) DeprecationWarning: Configuration via mocha.opts is DEPRECATED and will be removed from a future version of Mocha. Use RC files or package.json instead.
(Use `node --trace-deprecation ...` to show where the warning was created)


  Health UNIT
    ✓ should be healthy
    ✓ should be critical
    ✓ should be risky
    ✓ should be a warning
    ✓ should be no analytics
    ✓ should be disabled analytics
    ✓ should be not connected

  Javascript Client INT
{"level":"INFO","timestamp":"2020-12-09T16:10:09.845Z","logger":"kafkajs","message":"[Consumer] Starting","groupId":"n-test-group-js"}
{"level":"ERROR","timestamp":"2020-12-09T16:10:10.145Z","logger":"kafkajs","message":"[Connection] Response Metadata(key: 3, version: 5)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"There is no leader for this topic-partition as we are in the middle of a leadership election","correlationId":2,"size":65}
{"level":"ERROR","timestamp":"2020-12-09T16:10:10.253Z","logger":"kafkajs","message":"[Connection] Response Metadata(key: 3, version: 5)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"There is no leader for this topic-partition as we are in the middle of a leadership election","correlationId":3,"size":65}
{"level":"ERROR","timestamp":"2020-12-09T16:10:10.442Z","logger":"kafkajs","message":"[Connection] Response Metadata(key: 3, version: 5)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"There is no leader for this topic-partition as we are in the middle of a leadership election","correlationId":4,"size":65}
{"level":"ERROR","timestamp":"2020-12-09T16:10:10.661Z","logger":"kafkajs","message":"[Connection] Response Metadata(key: 3, version: 5)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"There is no leader for this topic-partition as we are in the middle of a leadership election","correlationId":5,"size":65}
{"level":"ERROR","timestamp":"2020-12-09T16:10:10.911Z","logger":"kafkajs","message":"[Connection] Response Metadata(key: 3, version: 5)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"There is no leader for this topic-partition as we are in the middle of a leadership election","correlationId":6,"size":65}
{"level":"ERROR","timestamp":"2020-12-09T16:10:11.306Z","logger":"kafkajs","message":"[Connection] Response Metadata(key: 3, version: 5)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"There is no leader for this topic-partition as we are in the middle of a leadership election","correlationId":7,"size":86}
{"level":"ERROR","timestamp":"2020-12-09T16:10:12.839Z","logger":"kafkajs","message":"[Connection] Response GroupCoordinator(key: 10, version: 1)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"The group coordinator is not available","correlationId":10,"size":22}
{"level":"ERROR","timestamp":"2020-12-09T16:10:13.169Z","logger":"kafkajs","message":"[Connection] Response GroupCoordinator(key: 10, version: 1)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"The group coordinator is not available","correlationId":11,"size":22}
{"level":"ERROR","timestamp":"2020-12-09T16:10:13.850Z","logger":"kafkajs","message":"[Connection] Response GroupCoordinator(key: 10, version: 1)","broker":"localhost:9092","clientId":"n-test-consumer-js","error":"The group coordinator is not available","correlationId":12,"size":22}
{"level":"INFO","timestamp":"2020-12-09T16:10:15.356Z","logger":"kafkajs","message":"[Runner] Consumer has joined the group","groupId":"n-test-group-js","memberId":"n-test-consumer-js-70f368ab-b1bc-4ba8-849b-7283c9ad342e","leaderId":"n-test-consumer-js-70f368ab-b1bc-4ba8-849b-7283c9ad342e","isLeader":true,"memberAssignment":{"n-test-topic":[0]},"groupProtocol":"RoundRobinAssigner","duration":2622}
Error: Failed to get metadata for topic n-test-topic, because: KafkaJSNumberOfRetriesExceeded: No brokers in the broker pool.
    at JSProducer.<anonymous> (/Users/michaelmclaughlin/Documents/brave-intl/node-sinek/src/lib/kafkajs/JSProducer.ts:674:28)
    at Generator.throw (<anonymous>)
    at rejected (/Users/michaelmclaughlin/Documents/brave-intl/node-sinek/src/lib/kafkajs/JSProducer.ts:6:65)
Error: defaultPartition set to 'auto', but was not able to resolve partition count for topicn-test-topic, please make sure the topic exists before starting the producer in auto mode.
    at JSProducer.<anonymous> (/Users/michaelmclaughlin/Documents/brave-intl/node-sinek/src/lib/kafkajs/JSProducer.ts:309:15)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/michaelmclaughlin/Documents/brave-intl/node-sinek/src/lib/kafkajs/JSProducer.ts:5:58)
    ✓ should be able to produce messages (7954ms)
    1) should be able to wait
    2) should have received first message
    3) should be able to consume messages


  8 passing (43s)
  3 failing

  1) Javascript Client INT
       should be able to wait:
     Error: Timeout of 32500ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/michaelmclaughlin/Documents/brave-intl/node-sinek/test/int/JSSinek.test.ts)
      at listOnTimeout (internal/timers.js:554:17)
      at processTimers (internal/timers.js:497:7)

  2) Javascript Client INT
       should have received first message:

      AssertionError [ERR_ASSERTION]: false == true
      + expected - actual

      -false
      +true
      
      at Context.<anonymous> (test/int/JSSinek.test.ts:90:12)
      at processImmediate (internal/timers.js:461:21)

  3) Javascript Client INT
       should be able to consume messages:
     AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert.ok(consumedMessages.length)

      at Context.<anonymous> (test/int/JSSinek.test.ts:95:12)
      at processImmediate (internal/timers.js:461:21)



error Command failed with exit code 3.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant