rickfast / consul-client

Java Client for Consul HTTP API
Other
570 stars 241 forks source link

com.orbitz.consul.ConsulException: Consul cluster has no elected leader #457

Open windonis opened 2 years ago

windonis commented 2 years ago

Hi Everyone,

We have very huge consul cluster and some project needs consul-client-1.3.3 for cbes integration.

But we are getting error as below.

11:31:45.530 [OkHttp http://consul-api.external:8500/...] ERROR c.o.c.c.ConsulCache - Error getting response from consul for health.service "XXX_pod_name_XXX", will retry in 10000 MILLISECONDS
com.orbitz.consul.ConsulException: Consul cluster has no elected leader
    at com.orbitz.consul.cache.ConsulCache$1.onComplete(ConsulCache.java:159) [consul-client-1.3.3.jar:?]
    at com.orbitz.consul.util.Http$1.onResponse(Http.java:79) [consul-client-1.3.3.jar:?]
    at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:129) [retrofit-2.5.0.jar:?]
    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:206) [okhttp-3.12.1.jar:?]
    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) [okhttp-3.12.1.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
    at java.lang.Thread.run(Thread.java:829) [?:?]

I'm sure there is no problem with the consul cluster because the other 4000 clients are working fine. (In particular, there is no such thing as the absence of a leader.) Due to some problems we are not using a version greater than 1.3.3.

Do you have an opinion on this station ?

Best Regards

kazuare commented 2 years ago

Hi, I also get 'Consul cluster has no elected leader', despite both UI and statusClient.getLeader() stating that there is a leader. Turning off streaming fixed my issue. I suspect this is connected to https://github.com/rickfast/consul-client/pull/456 , but i dont have super-solid evidence

Yanghsuanming commented 2 years ago

Hi, I also get 'Consul cluster has no elected leader', despite both UI and statusClient.getLeader() stating that there is a leader. Turning off streaming fixed my issue. I suspect this is connected to #456 , but i dont have super-solid evidence

how to Turning off streaming ?

kazuare commented 2 years ago

Hi, I also get 'Consul cluster has no elected leader', despite both UI and statusClient.getLeader() stating that there is a leader. Turning off streaming fixed my issue. I suspect this is connected to #456 , but i dont have super-solid evidence

how to Turning off streaming ?

there is "use_streaming_backend" key in consul node configuration to control that