Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on startup #17

Closed
japhar81 opened this issue Dec 31, 2019 · 4 comments
Closed

NullPointerException on startup #17

japhar81 opened this issue Dec 31, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@japhar81
Copy link

Consul 1.6.2 is running in docker on localhost at port 8500, using all the defaults. I bootstrap per the docs;

    ConsulClusterManager consulClusterManager = new ConsulClusterManager();
    options.setClusterManager(consulClusterManager);

The cluster manager dies with a NPE;

[ERROR] i.v.c.i.ContextImpl - Unhandled exception
java.lang.NullPointerException: null
        at io.vertx.spi.cluster.consul.ConsulClusterManager.entryUpdated(ConsulClusterManager.java:478)
        at io.vertx.spi.cluster.consul.impl.ConsulMapListener.lambda$kvWatchHandler$0(ConsulMapListener.java:89)
        at io.vertx.ext.consul.impl.WatchImpl.sendSuccess(WatchImpl.java:213)
        at io.vertx.ext.consul.impl.WatchImpl.lambda$go$3(WatchImpl.java:183)
        at io.vertx.ext.consul.impl.WatchImpl.lambda$fetch$5(WatchImpl.java:198)
        at io.vertx.ext.consul.impl.WatchImpl$KeyPrefix.lambda$wait$1(WatchImpl.java:62)
        at io.vertx.ext.consul.impl.ConsulClientImpl.lambda$reqOnContext$61(ConsulClientImpl.java:731)
        at io.vertx.ext.web.client.impl.HttpContext.handleDispatchResponse(HttpContext.java:308)
        at io.vertx.ext.web.client.impl.HttpContext.execute(HttpContext.java:295)
        at io.vertx.ext.web.client.impl.HttpContext.next(HttpContext.java:270)
        at io.vertx.ext.web.client.impl.predicate.PredicateInterceptor.handle(PredicateInterceptor.java:69)
        at io.vertx.ext.web.client.impl.predicate.PredicateInterceptor.handle(PredicateInterceptor.java:32)
        at io.vertx.ext.web.client.impl.HttpContext.next(HttpContext.java:267)
        at io.vertx.ext.web.client.impl.HttpContext.fire(HttpContext.java:277)
        at io.vertx.ext.web.client.impl.HttpContext.dispatchResponse(HttpContext.java:238)
        at io.vertx.ext.web.client.impl.HttpContext.lambda$null$2(HttpContext.java:367)
        at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369)
        at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
        at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)
        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(Thread.java:834)
@romalev romalev self-assigned this Dec 31, 2019
@romalev romalev added the bug Something isn't working label Dec 31, 2019
@romalev
Copy link
Member

romalev commented Dec 31, 2019

Ouch! This doesn't look good 👎I'll have a look at it as soon as I can.

@japhar81
Copy link
Author

@romalev I found my issue -- the default of InetAddress.getLocalHost().getHostAddress() returns 127.0.0.1. Since my consul is in docker, consul was trying to hit 127.0.0.1:64146, which was looping back to the container. Configuring it with my real host IP solved the NPE, but I would suggest a better default and perhaps more reasonable logging to clearly indicate that's the issue somehow?

@romalev
Copy link
Member

romalev commented Jan 4, 2020

@japhar81, that happened to me once :) I am completely agree with you - logging has to be improved in this area. I honestly don't have many feedbacks on given cluster management implementation so feel free to share yours. Also feel free to contribute :)

@romalev
Copy link
Member

romalev commented Jan 4, 2020

@japhar81, I am getting this closed. I've opened #18 instead.

@romalev romalev closed this as completed Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants