Running Consul-agent as sidecar container

Hi Everyone,

I am running consul-agent as a sidecar container in my ECS Fargate cluster.

The command I am using in the docker image ‘consul’ is:

consul agent  -data-dir /consul/data -client=\"127.0.0.1\" -bind=\"{{ GetPrivateIP }}\" -config-file=encrypt.json -retry-join \"xx.xx.xx.xx\" -datacenter \"eu-west-1\""]

here, xx.xx.xx.xx is the private IP of my consul-master node.

The service and nodes both are registering to the consul-master as well but I am still getting the following error on the consul-agent container:

2021-04-27T08:13:22.806Z [ERROR] agent.client: RPC failed to server: method=Catalog.NodeServiceList server=xx.xx.xx.xx:8300 error="rpc error making call: rpc: can't find method Catalog.NodeServiceList"

I have researched about the error as well but cannot find anything helpful.

Can anyone please help me on this part?

1 Like

Hi @deependra97,

This error usually shows up when your client agent is running a newer version of Consul than the server version.

Ref: rpc error making call: rpc: can't find method Catalog.NodeServiceList · Issue #7347 · hashicorp/consul · GitHub

Could you confirm whether the above is true in your case?

1 Like

Sure. Thanks. I will check and let you know.

Hi @Ranjandas , yeah there was a version mismatch. It’s solved after I used the same version for consul-master and consul-agents.

Thank you so much for your help. Appreciated.

3 Likes