Ecwid / consul-api

Java client for Consul HTTP API
Apache License 2.0
416 stars 177 forks source link

OperationException #188

Closed pparthenhs closed 5 years ago

pparthenhs commented 5 years ago

In some cases, when I try to set KV using consulClient.setKVValue("key", value) . The consul library (1.4.0) throws the following Exception :

Exception in thread "main" OperationException{statusCode=500, statusMessage='Internal Server Error', statusContent='No known Consul servers'}
        at com.ecwid.consul.v1.kv.KeyValueConsulClient.setKVValue(KeyValueConsulClient.java:262)
        at com.ecwid.consul.v1.kv.KeyValueConsulClient.setKVValue(KeyValueConsulClient.java:245)
        at com.ecwid.consul.v1.kv.KeyValueConsulClient.setKVValue(KeyValueConsulClient.java:230)
        at com.ecwid.consul.v1.ConsulClient.setKVValue(ConsulClient.java:579)

But most of the time it works perfectly. Do you know why this is happing?

vgv commented 5 years ago

Hi,

This is server-side error from consul agent – "No known Consul servers". You should check and (probably) fix your consul cluster.

In our own production system we have such errors too. Usually it happens then consul agent can't connect to any consul server.

pparthenhs commented 5 years ago

Hello @vgv,

Thanks for your response and your details. How do you handle this problem?

I am thinking to restart the consul agent, and re-execute my Java code.