Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-b still required even if metadata.broker.list in ~/.config/kafkacat.conf ? #213

Closed
datamove opened this issue Dec 5, 2019 · 6 comments
Closed

Comments

@datamove
Copy link

datamove commented Dec 5, 2019

Dear Developers,

I came across #85 that asked to have -X override -b, but I wonder, if I have metadata.broker.list property in ~/.config/kafkacat.conf or in $KAFKACAT_CONFIG, why is -b still required? Is it something fundamental or just doesn't work for me?

For reference, my config look like:

$ echo $KAFKACAT_CONFIG
metadata.broker.list=10.0.1.208:6667
$ cat ~/.config/kafkacat.conf 
bootstrap.servers=10.0.1.208:6667
metadata.broker.list=10.0.1.208:6667

Thanks in advance!

@edenhill
Copy link
Owner

edenhill commented Dec 5, 2019

That sounds like a bug, will look into it.

@edenhill
Copy link
Owner

edenhill commented Dec 5, 2019

As a workaround you can use kafkacat -b , .. (i.e., an empty list of brokers)

@edenhill
Copy link
Owner

edenhill commented May 28, 2020

Not reproducible:

$ ./kafkacat -L  -F kafkacat.config
% Reading configuration from file kafkacat.config
% ERROR: Failed to acquire metadata: Local: Broker transport failure

@mikaello
Copy link

mikaello commented Aug 3, 2020

I also got this issue. I am using kafkacat via docker (alias kafkacat='docker run -i edenhill/kafkacat:1.6.0'), and I guess that is the problem. Config file is not supported when running kafkacat trough docker? If that is correct, it would be a good idea to add that to the configuration section in the README.

D:~ # alias kafkacat='docker run -i edenhill/kafkacat:1.6.0'

D:~ # ll .config/kafkacat.conf
-rw-r--r-- 1 user user 225 aug.   3 15:01 .config/kafkacat.conf

D:~ # kafkacat -C -t $TEST_TOPIC -e -o -2 -F .config/kafkacat.conf
% ERROR: Failed to open .config/kafkacat.conf: No such file or directory

D:~ # kafkacat -C -t $TEST_TOPIC -e -o -2
Error: -b <broker,..> missing

D:~ # kafkacat -C -t $TEST_TOPIC -e -o -2 -b ,
%5|1596460317.093|CONFWARN|rdkafka#consumer-1| [thrd:app]: No `bootstrap.servers` configured: client will not be able to
 connect to Kafka cluster

@edenhill
Copy link
Owner

As for the "No such file or directory" problem: the docker container will not be able to access your outer host file system unless you map it through docker -v ...

@mikaello
Copy link

Thanks for the tip about -v. Here are a full example for others looking for the same (getting config file when running with docker):

docker run -it -v "$PWD"/kafkacat.conf:/root/.config/kafkacat.conf edenhill/kafkacat:1.6.0 -C -t <some_topic_of_broker_defined_in_config>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants