I’m a beginner to Kafka and started learning Apache Kafka 101. I’m getting this error when I try to produce and consume messages in confluent cloud using command line.
"Error: failed to obtain topics from client: API key may not be provisioned yet"
Note:- I’ve created the API key and using the same before producing/consuming messages.
But from confluent cloud I’m able to consume and produce the messages under ENVIRONMENTS → DEFAULT → TOPICS → MESSAGES
Could anyone please help to resolve this issue?
Hi @ybyzek
Tried the steps but unfortunately it didn’t work.
I’m still getting the same error
confluent kafka topic consume --from-beginning poems
%3|1650429548.796|FAIL|Confluent-CLI_v2.8.1#consumer-1| [thrd:sasl_ssl://pkc-xrnwx.asia-south2.gcp.confluent.cloud:9092/boots]: sasl_ssl://pkc-xrnwx.asia-south2.gcp.confluent.cloud:9092/bootstrap: Failed to connect to broker at [ns-cloud-d2.googledomains.com]:9092: Network unreachable (after 335ms in state CONNECT)
Error: failed to obtain topics from client: API key may not be provisioned yet
hi @sasikanthb
just to be sure:
network is reachable? telnet to broker address works?
best
michael
Hi @mmuehlbeyer
Yes, network is reachable.
telnet pkc-xrnwx.asia-south2.gcp.confluent.cloud 9092
Trying 34.131.207.35...
Connected to pkc-xrnwx.asia-south2.gcp.confluent.cloud.
Escape character is ‘^]’.
I asked my network admin to open port :9092 then I could connect and did not get the “API key may not be provisioned yet” error.
i meet this questions too.
➜ ~ confluent kafka topic consume -b agent-event-dev-kafka-topic
%3|1661501392.442|FAIL|Confluent-CLI_v2.24.2#consumer-1| [thrd:sasl_ssl://pkc-pgq85.us-west-2.aws.confluent.cloud:9092/bootstr]: sasl_ssl://pkc-pgq85.us-west-2.aws.confluent.cloud:9092/bootstrap: SSL handshake failed: Disconnected: connecting to a PLAINTEXT broker listener? (after 85ms in state SSL_HANDSHAKE)
%3|1661501392.952|FAIL|Confluent-CLI_v2.24.2#consumer-1| [thrd:sasl_ssl://pkc-pgq85.us-west-2.aws.confluent.cloud:9092/bootstr]: sasl_ssl://pkc-pgq85.us-west-2.aws.confluent.cloud:9092/bootstrap: SSL handshake failed: Disconnected: connecting to a PLAINTEXT broker listener? (after 82ms in state SSL_HANDSHAKE, 1 identical error(s) suppressed)
Error: failed to obtain topics from client: API key may not be provisioned yet
hi, sasikanthb, how do you resolve this question
I am also facing the issue which @sasikanthb was facing. Can someone please help in resolving this issue
I am also facing this issue even after opening port 9092 in Windows Defender Firewall. How to make this one work?
confluent kafka topic consume --from-beginning poems
%3|1688563525.662|FAIL|Confluent-CLI_v3.20.0#consumer-1| [thrd:sasl_ssl://pkc-p11xm.us-east-1.aws.confluent.cloud:9092/bootstr]: sasl_ssl://pkc-p11xm.us-east-1.aws.confluent.cloud:9092/bootstrap: SASL authentication error: Authentication failed (after 5557ms in state AUTH_REQ)
Error: failed to obtain topics from client: API key may not be provisioned yet
Same error here (CLI version: v3.25.1). I can use the CLI to get the list of topics but not to read or write data into a topic (it produces the error). From a Python program, I can do it so, the API key and network connectivity are ok. The problem happens in Windows, in Linux all works ok.