Connecting to MongoDB

Hi, While connecting to MongoDB host , we are facing with below error,
Failure while attempting to register source: Failure setting up new storage plugin configuration for config com.dremio.plugins.mongo.MongoStoragePluginConfig@8b2f655e.

Please assist.

Thanks
Nithya

@nithya sorry to hear that. It’d be great if you could share some more context to help us diagnose what’s going on.
Could share your server.log (under <dremio_path>/log in tarball installs) corresponding to this time? Also, a screenshot of your Mongo source configuration in Dremio would be useful.

Hi, I’m having a similar problem connecting to MongoDB 3.4.7 running on an AWS EC2 instance running Linux version 4.9.38-16.33.amzn1.x86_64. The java version is:

java version “1.7.0_141”
OpenJDK Runtime Environment (amzn-2.6.10.1.73.amzn1-x86_64 u141-b02)
OpenJDK 64-Bit Server VM (build 24.141-b02, mixed mode)

When configuring the MongoDB source, I receive this message:

Failure while attempting to register source: Failure setting up new storage plugin configuration for config com.dremio.plugins.mongo.MongoStoragePluginConfig@xxxxxx where xxxxxx changes slightly if you change the Hostname from 127.0.0.1 to the public IP assigned to this EC2 instance. Both Dremio and this MongoDB instance are running on the same EC2 instance. MongoDB is configured to use the default port 27017 and listen only on 127.0.0.1.

The Dremio server starts normally and I can define a PostgreSQL source w/o problems. When saving my MongoDB configuration while tailing server.out, I can see a Java stack trace with the following errors:

2017-10-10 16:00:01,101 [main] INFO com.dremio.dac.server.WebServer - Started on http://localhost:9047
2017-10-10 16:01:25,991 [qtp2007543079-138] INFO c.d.dac.resource.PutSourceResource - User Error Occurred [ErrorId: d3cf5046-cdf6-4a85-b99f-7305a5053bea]
com.dremio.common.exceptions.UserException: Failure while attempting to register source: Failure setting up new storage plugin configuration for config com.dremio.plugins.mongo.MongoStoragePluginConfig@2f7e34b4
at com.dremio.common.exceptions.UserException$Builder.build(UserException.java:648) ~[dremio-common-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
at com.dremio.dac.resource.PutSourceResource.putSource(PutSourceResource.java:93) [dremio-dac-backend-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_141]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_141]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_141]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_141]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [jersey-common-2.25.1.jar:na]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) [jersey-server-2.25.1.jar:na]
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) [jersey-container-servlet-core-2.25.1.jar:na]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) [jersey-container-servlet-core-2.25.1.jar:na]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) [jersey-container-servlet-core-2.25.1.jar:na]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) [jersey-container-servlet-core-2.25.1.jar:na]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) [jersey-container-servlet-core-2.25.1.jar:na]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) [jetty-servlet-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) [jetty-servlet-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83) [jetty-servlets-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:301) [jetty-servlets-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) [jetty-servlet-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) [jetty-servlet-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [jetty-servlet-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:95) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.Server.handle(Server.java:499) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258) [jetty-server-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) [jetty-io-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) [jetty-util-9.2.22.v20170606.jar:9.2.22.v20170606]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) [jetty-util-9.2.22.v20170606.jar:9.2.22.v20170606]
at java.lang.Thread.run(Thread.java:748) [na:1.7.0_141]
Caused by: com.dremio.common.exceptions.ExecutionSetupException: Failure setting up new storage plugin configuration for config com.dremio.plugins.mongo.MongoStoragePluginConfig@2f7e34b4
at com.dremio.exec.store.StoragePluginRegistryImpl.create(StoragePluginRegistryImpl.java:483) ~[dremio-sabot-kernel-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
at com.dremio.exec.store.StoragePluginRegistryImpl.createOrUpdate(StoragePluginRegistryImpl.java:290) ~[dremio-sabot-kernel-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
at com.dremio.dac.service.source.SourceService.registerSourceWithRuntime(SourceService.java:115) ~[dremio-dac-backend-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
at com.dremio.dac.resource.PutSourceResource.putSource(PutSourceResource.java:81) [dremio-dac-backend-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
… 46 common frames omitted
Caused by: java.lang.RuntimeException: Rule description ‘MongoScanRuleMONGO_Sample MongoDB’ is not valid
at org.apache.calcite.plan.RelOptRule.(RelOptRule.java:106) ~[calcite-core-1.12.0-201709220844320554-afcc87c.jar:1.12.0-201709220844320554-afcc87c]
at org.apache.calcite.plan.RelOptRule.(RelOptRule.java:88) ~[calcite-core-1.12.0-201709220844320554-afcc87c.jar:1.12.0-201709220844320554-afcc87c]
at com.dremio.plugins.mongo.planning.rules.MongoScanRule.(MongoScanRule.java:19) ~[dremio-extra-plugin-mongo-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
at com.dremio.plugins.mongo.planning.MongoConvention.(MongoConvention.java:44) ~[dremio-extra-plugin-mongo-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
at com.dremio.plugins.mongo.MongoStoragePlugin.(MongoStoragePlugin.java:136) ~[dremio-extra-plugin-mongo-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_141]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_141]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_141]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_141]
at com.dremio.exec.store.StoragePluginRegistryImpl.create(StoragePluginRegistryImpl.java:426) ~[dremio-sabot-kernel-1.2.1-201710030121530889-8e49316.jar:1.2.1-201710030121530889-8e49316]
… 49 common frames omitted

Attached is a screenshot of the MongoDB source configuration. I took all the defaults.

![Snip20171010_8|550x500]

Please let me know if you need any additional information. Thank you for your assistance.
Hugo

Hi Hugo,

Are you able to connect to the MongoDB database “Admin” directly (without Dremio) using username “blufton” and the password provided?

Thanks,
Balaji

Hi Balaji,
Yes, I am. I’ve been using this MongoDB instance for quite some time. Attached is a screenshot (w/o the password) showing where I logged in and listed the existing collections. The warnings not shown are just informing me that I’m not using the MongoDB WiredTiger engine.

Snip20171010_9

I can’t tell if the error is related to perhaps a) a mismatch between the Java driver for MongoDB shipped with Dremio and the MongoDB version 3.4.7 I’m running or b) an actual error writing the MongoDB configuration and not related to MongoDB itself.

Thanks for your reply, Let me try this on my lab and get back to you ASAP. BTW what version of Dremio are you on?

Community Edition. Build: 1.2.1-201710030121530889-8e49316

Hey @smitterh, could you try creating the Mongo source in Dremio without a space character in the name field (currently “Sample MongoDB”)?

Hi Hugo,

As @can had discovered, I was able to to reproduce the same error by giving a space in the Name, in your case “Sample MongoDB". Once I removed the space the source added successfully

Thanks,
@balaji.ramaswamy

Thank you so much! That indeed fixed the problem.