question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OperationException - 'Internal Server Error', rpc error: No cluster leader

See original GitHub issue

We are using Spring Cloud (Consul) for service discovery and the consul agent service (3 Node deployment) is deployed with other application service (10 Micro Services) on a AWS Stack.

Recently, we have started noticing intermittent RPC Error, which leads to Re-election of leader and following ERROR is raised from Spring Cloud library, and on monitoring we notice that the service discovery is working as expected and new leader is immeditely elected.

So basically, this ERROR is causing noise in our system.

We were thinking on following lines -

  1. Is there a way to only raise this ERROR if the cluster leader is not found by enabling some retry mechanism based on number of tries/ duration ?
  2. Any other ERROR which spring consul library would generate if the consul leader is actually not available ? so that we can suppress this ERROR/ raise it as a WARN.

Please suggest.

ERROR ip-XX-XX-XX-XXX | [pool-3-thread-1] org.springframework.cloud.consul.discovery.ConsulCatalogWatch         Error watching Consu
l CatalogServices
"com.ecwid.consul.v1.OperationException: OperationException(statusCode=500, statusMessage='Internal Server Error', statusContent='rpc error: rpc error: No cl
uster leader')
        at com.ecwid.consul.v1.catalog.CatalogConsulClient.getCatalogServices(CatalogConsulClient.java:122)
        at com.ecwid.consul.v1.catalog.CatalogConsulClient.getCatalogServices(CatalogConsulClient.java:108)
        at com.ecwid.consul.v1.ConsulClient.getCatalogServices(ConsulClient.java:320)
        at org.springframework.cloud.consul.discovery.ConsulCatalogWatch.catalogServicesWatch(ConsulCatalogWatch.java:65)
        at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
spencergibbcommented, Jan 16, 2018

Please learn how to properly format code and logs.

consul agent service (3 Node deployment)

This seems odd to me. Do you mean you have a 3 node consul server deployment? Are you pointing spring cloud consul at local agents or at the servers?

0reactions
spencergibbcommented, Dec 13, 2018

@gamefundas it’s our recommendation to not point consul clients at the server cluster but at a local agent. There is an open issue to reregister if the agent restarts.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - OperationException(statusCode=500, statusMessage ...
OperationException (statusCode=500, statusMessage='Internal Server Error', statusContent='rpc error making call: No cluster leader').
Read more >
No Cluster Leader when cluster node is down - Nomad
When I shut down node0 and then try to open UI on the node1 I get the error in my browser: The cluster...
Read more >
The Nomad service fails with error "No cluster leader" in EDC
This error occurs when you deploy Enterprise Data Catalog in containers such as Docker. When you re-deploy an image, the new image runs...
Read more >
Consul sporadic No Cluster Leader/rpc errors - Google Groups
Hello Consul peeps...we have a small installation (consul cluster with 5 servers and 15 nodes all in 1 VPC on AWS). About once...
Read more >
hashicorp-nomad/Lobby - Gitter
client: error updating allocations: error="rpc error: No cluster leader" ... @jrasell just copied over binary and restarted nomad.service.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found