Sep 14 16:37:35 lb.example.net consul[19138]: 2022-09-14T16:37:35.132+0200 [ERROR] agent.rpcclient.health: subscribe call failed: err="rpc error: code = InvalidArgument desc = Key is required" failure_count=2160 key=www topic=ServiceHealth
Sep 14 16:37:35 lb.example.net consul[19138]: 2022-09-14T16:37:35.132+0200 [ERROR] agent.http: Request error: method=GET url=/v1/health/service/www?index=7028250&passing=1&stale=&wait=60000ms from=127.0.0.1:38948 error="rpc error: code = InvalidArgument desc = Key is required"
Do you guys have any idea why I’m seeing this? Did I miss something in my consul-template HAproxy template?
Thanks for your help.
Hey @drustan, thanks for asking.
It looks like this might have to do with the consul agent setting up a connection to the consul server via the streaming RPC API. Consul agent supports 2 methods for monitoring values in the consul servers. The first method is simple long polling which pulls the full data of the monitored value when an update occurs. The second is via a streaming RPC call that sends only the update-diff over a persistent stream. The second was added for performance on large clusters.
Some questions or things you could look at.
What version of consul?
Are the consul servers and consul agents the same version?
Are they both set up to use streaming?
Not 100% on that but it is my current best guess. Please ask any followup questions you might have and we can try to get to the bottom of this.
Thanks and good luck.
Thank you for your reply and the explanation about the existence of the two methods for monitoring values.
You asked me about the Consul version and I realized the agent was 1.13.1 and the servers were 1.12 so I upgraded and everything return to normal, it was that simple!
The error message wasn’t very clear but I sure should have checked that the versions matched first :-/
Have a great day!
Unfortunately the problem still there, but it comes out when upgrading in multi DC configuration from 1.10.12 to 1.14.7.
agent.rpcclient.health: subscribe call failed: err=“rpc error: code = InvalidArgument desc = Key is required” failure_count=20 key=kube-system-apiserver topic=ServiceHealth
This log caused by DNS query from one updated DC to another DC with previous version.
Example:
From server node 1.14.7 make query like
consul-metrics.service.11012_NOT_UPDATED_DC.consul - failing
From server node 1.10.12 make query like
consul-metrics.service.1147_UPDATED_DC.consul - resolving
Update all consul servers in all clusters solving the issue, but it’s impossible to update all at once. I made it in test environment, but i don’t have an idea how to update my personal production environment without problems.