LangStream/langstream

Incorrect error message for authentication failure in Kafka

mukundha opened this issue · 1 comments

I used a wrong token when setting up Astra Streaming in secrets.yaml.
received this error message Authentication failed: password not specified

Ideally, the error message could have been Authentication failed: Invalid credentials 401 (or 403 in case of forbidden)

03:07:24.620 [main] INFO  a.l.k.r.KafkaTopicConnectionsRuntime -- AdminConfig: {security.protocol=SASL_SSL, sasl.mechanism=PLAIN, sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username='xx' password='token:AstraCS:xxx';, bootstrap.servers=kafka-gcp-uscentral1.streaming.datastax.com:9093, session.timeout.ms=45000}
03:07:25.194 [main] INFO  o.a.k.c.s.a.AbstractLogin -- Successfully logged in.
03:07:25.527 [main] INFO  a.l.k.r.KafkaTopicConnectionsRuntime -- Creating Kafka topic razorpay-log-topic
03:07:28.298 [kafka-admin-client-thread | adminclient-1] INFO  o.a.kafka.common.network.Selector -- [AdminClient clientId=adminclient-1] Failed authentication with kafka-gcp-uscentral1.streaming.datastax.com/104.198.199.121 (channelId=-1) (Authentication failed: password not specified)
03:07:28.329 [kafka-admin-client-thread | adminclient-1] ERROR o.apache.kafka.clients.NetworkClient -- [AdminClient clientId=adminclient-1] Connection to node -1 (kafka-gcp-uscentral1.streaming.datastax.com/104.198.199.121:9093) failed authentication due to: Authentication failed: password not specified
03:07:28.331 [kafka-admin-client-thread | adminclient-1] WARN  o.a.k.c.a.i.AdminMetadataManager -- [AdminClient clientId=adminclient-1] Metadata update failed due to authentication error
org.apache.kafka.common.errors.SaslAuthenticationException: Authentication failed: password not specified

This is a problem for Astra Streaming, I am not sure we can do much here in LangStream.
We can only report the error coming from the Kafka client