Giter VIP home page Giter VIP logo

Comments (15)

mkosta avatar mkosta commented on June 16, 2024 2

thanks for your help and extension! it actually worked this way. as i mentioned the issue was in import. other class was lazy initializing? new connect that was not used and was not given sasl config but was failing main test. hence connectLogger was not giving more info)

from xk6-kafka.

366-Pouyan avatar 366-Pouyan commented on June 16, 2024 1

I received the same error because I didn't have TLS configuration set up. Just an FYI.

from xk6-kafka.

mkosta avatar mkosta commented on June 16, 2024 1

thank you, Mostafa. i have seen these files. our kafka server requires jaas config.

when i test connection with performance tester.sh from kafka i can only send messages with saasl.jaas.config property provided in producer. same with offset explorer tool. it requires jaas config property.

in k6 i can create topic with my saslconfig, but when i need to produce messages i get eof error (i added sasl to Writer). i tried everything it seems. we use scram sha 512. on my local env same code sends messages just fine. but i have no sasl, no auth etc .

i will look at setting sasl on my local kafka and see when it will start failing))
i copied Writer from your examples, very simple, yet on Sasl scram sha 512 it throws eof errors :(

from xk6-kafka.

mkosta avatar mkosta commented on June 16, 2024 1

i tried logger, but output was not showing much. just error and code lines. i can attach output tomorrow. and i added tls conf after reading this thread, just set it to false.

from xk6-kafka.

mostafa avatar mostafa commented on June 16, 2024

Hey @arpitaso,

Please use code highlighting while posting your code here.

Also, set connectLogger to true, so we can see the internal logs of the Writer and Reader.

from xk6-kafka.

mostafa avatar mostafa commented on June 16, 2024

@arpitaso

I suppose this is resolved. Feel free to reopen it if the issue persists.

from xk6-kafka.

nirajkmr avatar nirajkmr commented on June 16, 2024

I'm encountering an identical error message. I'm utilizing a port forwarding mechanism to establish a connection with the Kafka broker located within a Kubernetes pod. In my specific scenario, I've introduced a consumer that reads from the same partition.

from xk6-kafka.

mostafa avatar mostafa commented on June 16, 2024

@nirajkmr Can you elaborate with a working script that has your data removed?

from xk6-kafka.

mkosta avatar mkosta commented on June 16, 2024

Mostafa, is it possible to provide JAAS config for sasl? i cant find it in sasl config. need something like sasl.jaas.config
thanks

from xk6-kafka.

mostafa avatar mostafa commented on June 16, 2024

Hey @mkosta,

SASL authentication is already supported: https://github.com/mostafa/xk6-kafka/blob/main/scripts/test_sasl_auth.js.

from xk6-kafka.

mostafa avatar mostafa commented on June 16, 2024

@mkosta Use connectLogger (bool) on the Writer to see what error you're getting from Kafka. Also, SASL config must be accompanied with TLS config to work properly.

from xk6-kafka.

mkosta avatar mkosta commented on June 16, 2024

that's what i am getting

ERRO[0019] Failed to get controller., OriginalError: EOF  error="Failed to get controller., OriginalError: EOF"
ERRO[0019] GoError: Failed to get controller., OriginalError: EOF
	at file:///home/kosta/Public/qa/k6/altenar/aip.tests.load/helpers/kafka.js:23:19(86)
	at go.k6.io/k6/js.(*requireImpl).require-fm (native)
const writer = new Writer({
    brokers: ["cut:9092"],
    topic: "kosta-settlement",
    autoCreateTopic: true,
    sasl: saslConfig,
    connectLogger: true,
    tls: tlsConfig
 const saslConfig = {
    username: "cut",
    password: "cut",
    // Possible values for the algorithm is:
    // NONE (default)
    // SASL_PLAIN
    // SASL_SCRAM_SHA256
    // SASL_SCRAM_SHA512
    // SASL_SSL (must enable TLS)
    // SASL_AWS_IAM (configurable via env or AWS IAM config files - no username/password needed)
    algorithm: SASL_SCRAM_SHA512,
  };
const tlsConfig = {
    enableTls: false,
    insecureSkipTlsVerify: false,
    minVersion: TLS_1_2,
   }

from xk6-kafka.

mkosta avatar mkosta commented on June 16, 2024

so i enabled locally sasl_plain text and getting same eof error on k6 side

that's what i see in kafka log

[2024-03-13 12:19:40,024] DEBUG Got ping response for session id: 0x10000384ac60007 after 0ms. (org.apache.zookeeper.ClientCnxn)
[2024-03-13 12:19:40,864] DEBUG Accepted connection from /127.0.0.1:53988 on /127.0.0.1:9092 and assigned it to processor 2, sendBufferSize [actual|requested]: [102400|102400] recvBufferSize [actual|requested]: [102400|102400] (kafka.network.DataPlaneAcceptor)
[2024-03-13 12:19:40,864] DEBUG Processor 2 listening to new connection from /127.0.0.1:53988 (kafka.network.Processor)
[2024-03-13 12:19:40,865] DEBUG Set SASL server state to HANDSHAKE_OR_VERSIONS_REQUEST during authentication (org.apache.kafka.common.security.authenticator.SaslServerAuthenticator)
[2024-03-13 12:19:40,865] DEBUG Set SASL server state to FAILED during authentication (org.apache.kafka.common.security.authenticator.SaslServerAuthenticator)
[2024-03-13 12:19:40,865] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /127.0.0.1 (channelId=127.0.0.1:9092-127.0.0.1:53988-0) (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)

i can write messages from kafka perf test with producer.properties

bootstrap.servers=localhost:9092
security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN

from xk6-kafka.

mkosta avatar mkosta commented on June 16, 2024

ok, i figured out eof issue) there was import of one of our helpers and it was actually failing somewehere down that file. so auth works without jaas. now onto context deadline issue)

from xk6-kafka.

mostafa avatar mostafa commented on June 16, 2024

@mkosta Also, SASL/SCRAM won't work without TLS and you have TLS disabled: enableTls: false.

from xk6-kafka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.