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

Error: Local: Host resolution failure #2171

Closed
4 of 5 tasks
Vijendra07Kulhade opened this issue Jan 1, 2019 · 7 comments
Closed
4 of 5 tasks

Error: Local: Host resolution failure #2171

Vijendra07Kulhade opened this issue Jan 1, 2019 · 7 comments

Comments

@Vijendra07Kulhade
Copy link

Vijendra07Kulhade commented Jan 1, 2019

Read the FAQ first: https://github.com/edenhill/librdkafka/wiki/FAQ

Description

I was working with node-rdkafka and observed this error. After further debugging the issue I found that error seems to appear from native library which node-rdkafka use i.e librdkafka.
After spending sometime on it we figured out that there is a limit on hostname size.
Which is set rdkafka_proto.h
#define RD_KAFKA_NODENAME_SIZE 128
This is trimming the host name and resulting the error.

How to reproduce

This error will come if broker host is big enough. Also this error still come if we try to give IPs as IPs will get resolved to the hostname. After changing NODENAME_SIZE. It worked.
#define RD_KAFKA_NODENAME_SIZE 256

Let me know if this fix can be incorporated in any of the release. Thanks

IMPORTANT: Always try to reproduce the issue on the latest released version (see https://github.com/edenhill/librdkafka/releases), if it can't be reproduced on the latest version the issue has been fixed.

Checklist

IMPORTANT: We will close issues where the checklist has not been completed.

Please provide the following information:

  • librdkafka version 2.5.1
  • Apache Kafka version: 0.10.2.0
  • librdkafka client configuration: var producer = new Kafka.Producer({ // 'debug' : 'all', 'client.id':'noderd-kafka', 'bootstrap.servers': 'lognlognhostname:9092', 'broker.version.fallback':'0.10.2.0', 'heartbeat.interval.ms':3000, 'compression.codec': 'none', 'request.required.acks':1, 'api.version.request':false, 'retry.backoff.ms': 200, 'message.send.max.retries': 10, 'socket.keepalive.enable': true, 'queue.buffering.max.messages': 10000, 'queue.buffering.max.ms': 1000, 'batch.num.messages': 10000, 'dr_cb': true },{ 'message.timeout.ms':300000, 'produce.offset.report':true, 'acks':1, 'offset.store.sync.interval.ms':10 });
  • Operating system: Mac Os Mojave
  • Provide logs ``
@edenhill
Copy link
Contributor

edenhill commented Jan 7, 2019

You're absolutely right, the max nodename/hostname size should be 256.
Do you care to submit a PR?

@Vijendra07Kulhade
Copy link
Author

Vijendra07Kulhade commented Jan 8, 2019

@edenhill Although its very small change, But I can submit the PR.
#2178

@rana13deb
Copy link

I am getting this error with the CPP version of librdkafka.
I have checked the RD_KAFKA_NODENAME_SIZE in rdkafka_proto.h and it is 256 as mentioned above.
Wondering if there is a different value that I should check for the CPP build.

@rana13deb
Copy link

I should add that this is not an issue I face all the time. 7/10 times everything works fine and Producers are created, but every now and then randomly I get this issue.

@edenhill
Copy link
Contributor

edenhill commented Dec 7, 2020

@rana13deb What error are you seeing?

@bhushan-patil-successive

@rana13deb did you find the solution ?
I am also facing similar problem like you, not that it is never connecting.

@chenjing1294
Copy link

@rana13deb did you find the solution ? I am also facing similar problem like you, not that it is never connecting.

If you comment out listeners = listener_name://ip:port, you should modify the client's hosts file and connect using hostname.

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

5 participants