Uploaded image for project: 'Couchbase Elasticsearch Connector'
  1. Couchbase Elasticsearch Connector
  2. CBES-238

With Consul 1.10, "Cannot build Service, some of required attributes are not set [port]"

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.3.5
    • None
    • 1

    Description

      When registering itself with Consul, the connector uses port 0 to indicate it does not want to declare a port.

      Previous versions of Consul would return this 0 value in the service definition JSON, but Consul 1.10 omits the value if it is zero. This causes problems for the connector because the Consul client is uses expects the `port` value to be present.

      13:31:10.027 [OkHttp http://localhost:55503/...] ERROR com.orbitz.consul.cache.ConsulCache - Error getting response from consul for health.service "integrationTest-2", will retry in 10000 MILLISECONDS
      com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance of `com.orbitz.consul.model.health.ImmutableService`, problem: Cannot build Service, some of required attributes are not set [port]
       at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 642] (through reference chain: java.util.ArrayList[0]->com.orbitz.consul.model.health.ImmutableServiceHealth$Json["Service"])
      	at com.fasterxml.jackson.databind.exc.ValueInstantiationException.from(ValueInstantiationException.java:47) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:2047) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.wrapAsJsonMappingException(StdValueInstantiator.java:587) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.rewrapCtorProblem(StdValueInstantiator.java:610) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator._createUsingDelegate(StdValueInstantiator.java:647) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createUsingDelegate(StdValueInstantiator.java:306) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1397) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:351) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:184) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:214) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:186) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1398) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:351) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:184) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromArray(CollectionDeserializer.java:355) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:2051) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1459) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:32) ~[converter-jackson-2.5.0.jar:?]
      	at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23) ~[converter-jackson-2.5.0.jar:?]
      	at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:223) ~[retrofit-2.5.0.jar:?]
      	at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:121) [retrofit-2.5.0.jar:?]
      	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203) [okhttp-3.12.12.jar:?]
      	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) [okhttp-3.12.12.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) [?:?]
      Caused by: java.lang.IllegalStateException: Cannot build Service, some of required attributes are not set [port]
      	at com.orbitz.consul.model.health.ImmutableService$Builder.build(ImmutableService.java:798) ~[consul-client-1.3.3.jar:?]
      	at com.orbitz.consul.model.health.ImmutableService.fromJson(ImmutableService.java:505) ~[consul-client-1.3.3.jar:?]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
      	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
      	at com.fasterxml.jackson.databind.introspect.AnnotatedMethod.call1(AnnotatedMethod.java:109) ~[jackson-databind-2.13.0.jar:2.13.0]
      	at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator._createUsingDelegate(StdValueInstantiator.java:631) ~[jackson-databind-2.13.0.jar:2.13.0]
      	... 26 more
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            There are no comments yet on this issue.

            People

              david.nault David Nault
              david.nault David Nault
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty