gravitee-io / issues

Gravitee.io - API Platform - Issues
64 stars 26 forks source link

[gateway] Error when discovery service creates new endpoints #6727

Closed gianx89 closed 2 years ago

gianx89 commented 2 years ago

I use Consul Service Discovery. My conf is like this one:

image

image

On 3.12.5 consul service discovery works fine. But on 3.13.1 I get (getting also 503 on every call to my APIs):

14:52:27.219 [vert.x-eventloop-thread-0] [] INFO  i.g.d.consul.ConsulServiceDiscovery - Register a new service from Consul.io: id[companydata] name[companydata]
14:52:27.219 [vert.x-eventloop-thread-0] [] INFO  i.g.g.s.e.d.v.EndpointDiscoveryVerticle - Receiving a service discovery event id[consul:companydata] type[REGISTER]
14:52:27.220 [vert.x-eventloop-thread-0] [] ERROR i.g.g.c.e.l.i.EndpointGroupLifecycleManager - Unexpected error while creating endpoint connector
java.lang.IllegalArgumentException: argument "content" is null
    at com.fasterxml.jackson.databind.ObjectMapper._assertNotNull(ObjectMapper.java:4757)
    at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:3040)
    at io.gravitee.gateway.core.endpoint.lifecycle.impl.EndpointGroupLifecycleManager.getEndpointConfiguration(EndpointGroupLifecycleManager.java:267)
    at io.gravitee.gateway.core.endpoint.lifecycle.impl.EndpointGroupLifecycleManager.start(EndpointGroupLifecycleManager.java:157)
    at io.gravitee.gateway.core.endpoint.lifecycle.impl.EndpointGroupLifecycleManager.postAdd(EndpointGroupLifecycleManager.java:211)
    at io.gravitee.gateway.core.endpoint.lifecycle.impl.EndpointGroupLifecycleManager.postAdd(EndpointGroupLifecycleManager.java:50)
    at io.gravitee.common.util.ObservableSet.lambda$add$1(ObservableSet.java:82)
    at java.base/java.util.ArrayList.forEach(Unknown Source)
    at io.gravitee.common.util.ObservableSet.add(ObservableSet.java:82)
    at io.gravitee.gateway.services.endpoint.discovery.verticle.EndpointDiscoveryVerticle.lambda$startServiceDiscovery$1(EndpointDiscoveryVerticle.java:136)
    at io.gravitee.discovery.consul.ConsulServiceDiscovery.lambda$listen$0(ConsulServiceDiscovery.java:161)
    at io.vertx.ext.consul.impl.WatchImpl.sendSuccess(WatchImpl.java:219)
    at io.vertx.ext.consul.impl.WatchImpl.lambda$go$3(WatchImpl.java:184)
    at io.vertx.ext.consul.impl.WatchImpl.lambda$fetch$6(WatchImpl.java:199)
    at io.vertx.ext.consul.impl.WatchImpl$Service.lambda$wait$1(WatchImpl.java:95)
    at io.vertx.ext.consul.impl.ConsulClientImpl.lambda$reqOnContext$62(ConsulClientImpl.java:1328)
    at io.vertx.ext.web.client.impl.HttpContext.handleDispatchResponse(HttpContext.java:371)
    at io.vertx.ext.web.client.impl.HttpContext.execute(HttpContext.java:358)
    at io.vertx.ext.web.client.impl.HttpContext.next(HttpContext.java:336)
    at io.vertx.ext.web.client.impl.HttpContext.fire(HttpContext.java:303)
    at io.vertx.ext.web.client.impl.HttpContext.dispatchResponse(HttpContext.java:265)
    at io.vertx.ext.web.client.impl.HttpContext.lambda$null$8(HttpContext.java:520)
    at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)
    at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:63)
    at io.vertx.core.impl.EventLoopContext.lambda$runOnContext$0(EventLoopContext.java:38)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Unknown Source)

Switching back to 3.12.5 solves the issue.

I'm on docker using your official images,

Can you solve it? It's a blocking problem for us.

Thanks in advance

gianx89 commented 2 years ago

@brasseld @tcompiegne any news?

gianx89 commented 2 years ago

The same on 3.15.x

phiz71 commented 2 years ago

Hello @gianx89, sorry for the delay. I will try to reproduce your issue and fix it. But as the 3.13.x in no longer supported, the fix will be on the next 3.14.x (and also next 3.15.x, etc ...)

gianx89 commented 2 years ago

Hello @gianx89, sorry for the delay. I will try to reproduce your issue and fix it. But as the 3.13.x in no longer supported, the fix will be on the next 3.14.x (and also next 3.15.x, etc ...)

Hi, if I can help somehow I'm here. Thank you.

phiz71 commented 2 years ago

Hello @gianx89, sorry for the delay. I will try to reproduce your issue and fix it. But as the 3.13.x in no longer supported, the fix will be on the next 3.14.x (and also next 3.15.x, etc ...)

Hi, if I can help somehow I'm here. Thank you.

Thank you @gianx89 but it's ok. The fix has been validated and merged in 3.14.x. It will be released with the next 3.14.1.

RubenMMSantos commented 2 years ago

Verified ticket together with Dev, working as expected