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

Active connection to MongoDB required for fresh project based on Quarkus master, wasn't needed for 1.7.0.Final and prior #11736

Closed
rsvoboda opened this issue Aug 31, 2020 · 5 comments · Fixed by #11743
Assignees
Labels
Milestone

Comments

@rsvoboda
Copy link
Member

Active connection to MongoDB required for fresh project based on master, wasn't needed for 1.7.0.Final and prior.
Getting NPE from SmallRyeMetricsRecorder.registerMetrics(SmallRyeMetricsRecorder.java:217)

Reproducer:

mvn clean verify -pl 002-quarkus-all-extensions/ -Dquarkus.platform.version=1.7.0.Final -Dquarkus-plugin.version=1.7.0.Final passes

Stacktrace (commented out io.quarkus:quarkus-logging-json tependency in 002-quarkus-all-extensions/pom.xml):

2020-08-31 10:15:01,619 INFO  [org.mon.dri.cluster] (cluster-ClusterId{value='5f4cb1859520ed1f46c9241c', description='null'}-127.0.0.1:27017) Exception in monitor thread while connecting to server 127.0.0.1:27017: com.mongodb.MongoSocketOpenException: Exception opening socket
	at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:70)
	at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:143)
	at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:188)
	at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:144)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
	at java.base/java.net.Socket.connect(Socket.java:609)
	at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:78)
	at com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
	at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
	... 4 more

2020-08-31 10:15:01,629 INFO  [org.mon.dri.cluster] (cluster-ClusterId{value='5f4cb1859520ed1f46c9241d', description='null'}-127.0.0.1:27017) Exception in monitor thread while connecting to server 127.0.0.1:27017: com.mongodb.MongoSocketOpenException: Exception opening socket
	at com.mongodb.internal.connection.AsynchronousSocketChannelStream$OpenCompletionHandler.failed(AsynchronousSocketChannelStream.java:124)
	at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:129)
	at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:283)
	at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:198)
	at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.onEvent(UnixAsynchronousSocketChannelImpl.java:213)
	at java.base/sun.nio.ch.KQueuePort$EventHandlerTask.run(KQueuePort.java:312)
	at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.checkConnect(Native Method)
	at java.base/sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishConnect(UnixAsynchronousSocketChannelImpl.java:252)
	... 7 more

2020-08-31 10:15:01,677 ERROR [io.qua.application] (main) Failed to start application (with profile test): java.lang.NullPointerException
	at io.quarkus.smallrye.metrics.runtime.SmallRyeMetricsRecorder.registerMetrics(SmallRyeMetricsRecorder.java:217)
	at io.quarkus.deployment.steps.SmallRyeMetricsProcessor$registerRuntimeExtensionMetrics-632673255.deploy_0(SmallRyeMetricsProcessor$registerRuntimeExtensionMetrics-632673255.zig:74)
	at io.quarkus.deployment.steps.SmallRyeMetricsProcessor$registerRuntimeExtensionMetrics-632673255.deploy(SmallRyeMetricsProcessor$registerRuntimeExtensionMetrics-632673255.zig:40)
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:1035)
	at io.quarkus.runtime.Application.start(Application.java:90)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:212)
@quarkusbot
Copy link

/cc @loicmathieu, @evanchooly

@rsvoboda
Copy link
Member Author

@jmartisk fyi

@jmartisk
Copy link
Contributor

This doesn't look related to MongoDB, I can reproduce this with Neo4j instead (and it makes sense, because we've only recently added Neo4j metrics support). Your test suite seems to be importing Neo4j, so I think that's the culprit. Otherwise the nature of the issue stays the same.

@rsvoboda
Copy link
Member Author

Thanks @jmartisk for looking at this, just wanted to comment, that Quarkus based on b35c0bf worked fine, so the changes affecting this had to be merged last Friday.

@jmartisk
Copy link
Contributor

Yes, this was introduced via #11637
I've already submitted a PR to fix it: #11743

@gsmet gsmet added this to the 1.8.0.CR1 milestone Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants