Comments (15)
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.
I received the same error because I didn't have TLS configuration set up. Just an FYI.
from xk6-kafka.
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.
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.
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.
I suppose this is resolved. Feel free to reopen it if the issue persists.
from xk6-kafka.
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.
@nirajkmr Can you elaborate with a working script that has your data removed?
from xk6-kafka.
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.
Hey @mkosta,
SASL authentication is already supported: https://github.com/mostafa/xk6-kafka/blob/main/scripts/test_sasl_auth.js.
from xk6-kafka.
@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.
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.
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.
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.
@mkosta Also, SASL/SCRAM won't work without TLS and you have TLS disabled: enableTls: false
.
from xk6-kafka.
Related Issues (20)
- How to skip control batch messages? HOT 1
- Multiple Kafka producers generated for each thread in high-concurrency test HOT 3
- Be able to update offset of kafka reader HOT 7
- Field with the name of the request in k6 stats HOT 6
- Error when consuming more messages that exist in topic HOT 7
- Creating Connection object failed on `EOF` HOT 1
- Adding support for K6 0.49.0 HOT 3
- Make docker image supports on arm HOT 8
- Incorrect reader/writer initialization in examples and description
- Wrong documentation for ReaderConfig.startOffset HOT 1
- RabbitMQ Compatibility HOT 1
- GoError: Failed to encode data, OriginalError: cannot decode textual record HOT 9
- Binary is not getting build. HOT 2
- Is there any guidance on how k6 works with complex AVRO schemas? HOT 1
- Error importing SCHEMA_TYPES enum when using index.d.ts. HOT 3
- Load test with Avro Schema that contains references throw an error HOT 2
- Reader.consume wont timeout HOT 1
- Getting tls: bad certificate error when try to write avro type message HOT 1
- Query : Avro with and without Schema Registry HOT 9
- How to come up the limit for reader.consume method? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xk6-kafka.