Error while running kafka topic produce

Hi,
I am following this page to explore kafka.
Confluent CLI Overview | Confluent Documentation

I was able to create cluster and topic. Now I want to get something into the topic named “orders”. When I give the following command on CLI I get the next error

confluent kafka topic produce orders --api-key XXXXXXXXXXXXXX --api-secret /ahjkbskskjbgskkskjhksjhkjhsjkhskh

Error: failed to create producer: failed to get configuration map: decryptbytes: procdecryptdata: The parameter is incorrect.

api-key and api-secret are correctly defined.

Can anyone please advise.

Are you on Windows? What version of the CLI do you have? It looks like you’re running into this bug.

Still the same error over here in Confluent-CLI version 3.58.0:

Version:     v3.58.0
Git Ref:     c24331730
Build Date:  2024-04-19T04:09:58Z
Go Version:  go1.21.7 X:boringcrypto (windows/amd64)
Development: false

i’m following this tutorial Tutorial: Use Confluent CLI with Confluent Cloud | Confluent Documentation over cmder on windows 11

1.- Run the following command to create a new Kafka topic demo-topic-1 OK

λ confluent kafka topic create demo-topic-1 --environment XXXXX --cluster XXXXXXXX
Created topic "demo-topic-1".

2.- Start producing to this topic demo-topic-1 by running the following command NOK

λ confluent kafka topic produce demo-topic-1 --api-key XXXXXXXX --api-secret XXXXXXXXFlXMgkX --XXXXXXXX --cluster XXXXXXXX
Error: failed to create producer: failed to get configuration map: decryptbytes: procdecryptdata: The parameter is incorrect.

Maybe the issue decryptbytes: procdecryptdata: The parameter is incorrect when consuming using api keys in the command · Issue #2412 · confluentinc/cli · GitHub is not resolved yet?

Regards

@dgonzalezc try upgrading to the latest version of the CLI. The fix went into version 4.13.2 (release notes).

thanks @dtroiano for your comments.

when trying to update only shows me 3.65.0 version:

λ confluent update
Checking for updates...
New version of confluent is available
Current Version: v3.58.0
Latest Version:  v3.65.0

Do you want to download and install this update? (y/n): y
Downloading confluent version 3.65.0...
Done. Downloaded 60.82 MB in 6 seconds. (10.68 MB/s)

so i updated and trying again:

λ confluent update
Checking for updates...
The only available update is a major version update. Use `confluent update --major` to accept the update.

apparently version 4.13.2 is not available from command line but is available in Release v4.27.1 · confluentinc/cli · GitHub so when trying with the new version it works!!!

Produce example

λ confluent kafka topic produce demo-topic-1 --api-key XXXXXXXX --api-secret XXXXXXXX --environment XXXXXXXX --cluster XXXXXXXX
Starting Kafka Producer. Use Ctrl-C to exit.
%6|1748636209.116|GETSUBSCRIPTIONS|Confluent-CLI_v4.27.1#producer-1| [thrd:main]: Telemetry client instance id changed from AAAAAAAAAAAAAAAAAAAAAA to rKKb6VQsQnWhVz75gMn2bw
{"value": {"type": "JSON", "data": "Hello World!"}}
{"value": {"type": "JSON", "data": "Hello World!"}}
{"value": {"type": "JSON", "data": "Hello World!"}}
{"value": {"type": "JSON", "data": "Hello World!"}}
{"value": {"type": "JSON", "data": "Hello World!"}}
{"value": {"type": "JSON", "data": "Hello World!"}}

Consume Example

λ confluent kafka topic consume demo-topic-1 --api-key XXXXXXXX --api-secret XXXXXXXX --environment XXXXXXXX --cluster XXXXXXXX
%6|1748636703.248|GETSUBSCRIPTIONS|Confluent-CLI_v4.27.1#consumer-1| [thrd:main]: Telemetry client instance id changed from AAAAAAAAAAAAAAAAAAAAAA to Gbwz5TldRnCViKI86p4fsQ
Starting Kafka Consumer. Use Ctrl-C to exit.
"Hello World!"
"Hello World!"
"Hello World!"

Thanks for the help!!!

Glad to hear it’s working!

The CLI update issue is a bit confusing. It only updates to the latest minor version by default and AFAIK there isn’t a way via CLI to update to a specific version. I believe if you had run confluent update --major it would have updated to the current latest v4.27.1 via CLI.