question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MongoDB Atlas support

See original GitHub issue

System information:

  • Operating system (distribution) and version: macOS Mojave 10.14.4
  • DBeaver version: EE 6.0
  • Java version: built-in
  • Additional extensions: none

Connection specification:

  • Database name and version: MongoDB Atlas 3.6
  • Driver name: org.jkiss.jdbc.mongodb.mongodbDriver
  • Do you use tunnels or proxies (SSH, SOCKS, etc)? No

Describe the problem you’re observing:

I cannot connect to MongoDB Atlas in Replica Type. Robo3T connects successfully. The difference is the creation of a Self-Signed Certificate.

Steps to reproduce, if exist:

A MongoDB Cluster in Replica Type on Atlas.

Include any warning/errors/backtraces from the logs

2019-05-14 17:23:07.729 - Connect with 'mongo://XXXXX-shard-00-00-XXXXX:99999/test' (cql-16ab6f0ae4b-14738808ecc6faa1)
2019-05-14 17:23:12.821 - Connection failed (cql-16ab6f0ae4b-14738808ecc6faa1)
2019-05-14 17:23:12.824 - org.jkiss.dbeaver.model.exec.DBCException: Error connecting to Mongo instance [XXXXX-shard-00-00-XXXXX]
org.jkiss.dbeaver.model.exec.DBCException: Error connecting to Mongo instance [XXXXX-shard-00-00-XXXXX:99999]
	at com.dbeaver.ee.mongodb.exec.MongoExecutionContext.connect(MongoExecutionContext.java:85)
	at com.dbeaver.ee.mongodb.exec.MongoExecutionContext.connect(MongoExecutionContext.java:73)
	at com.dbeaver.ee.mongodb.model.MongoDataSource.<init>(MongoDataSource.java:99)
	at com.dbeaver.ee.mongodb.MongoDataSourceProvider.openDataSource(MongoDataSourceProvider.java:115)
	at org.jkiss.dbeaver.registry.DataSourceDescriptor.connect(DataSourceDescriptor.java:770)
	at org.jkiss.dbeaver.runtime.jobs.ConnectJob.run(ConnectJob.java:70)
	at org.jkiss.dbeaver.ui.dialogs.connection.ConnectionWizard$ConnectionTester.run(ConnectionWizard.java:232)
	at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:102)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.jkiss.dbeaver.DBException: Error connecting to Mongo instance [XXXXX-shard-00-00-XXXXX]
	at com.dbeaver.ee.mongodb.exec.MongoExecutionContext.reconnect(MongoExecutionContext.java:288)
	at com.dbeaver.ee.mongodb.exec.MongoExecutionContext.connect(MongoExecutionContext.java:82)
	... 8 more
Caused by: com.mongodb.MongoTimeoutException: Timed out after 5000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@2fe71625. Client view of cluster state is {type=REPLICA_SET, servers=[{address=XXXXX-shard-00-02-XXXXX:99999, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Exception receiving message}, caused by {java.net.SocketException: Connection reset}}, {address=XXXXX-shard-00-00-XXXXX:99999, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Exception receiving message}, caused by {java.net.SocketException: Connection reset}}, {address=XXXXX-shard-00-01-XXXXX:99999, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Exception receiving message}, caused by {java.net.SocketException: Connection reset}}]
	at com.mongodb.internal.connection.BaseCluster.createTimeoutException(BaseCluster.java:401)
	at com.mongodb.internal.connection.BaseCluster.selectServer(BaseCluster.java:120)
	at com.mongodb.internal.connection.MultiServerCluster.selectServer(MultiServerCluster.java:54)
	at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:138)
	at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:94)
	at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:249)
	at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:172)
	at com.mongodb.client.internal.MongoDatabaseImpl.executeCommand(MongoDatabaseImpl.java:182)
	at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:151)
	at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:146)
	at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:136)
	at com.dbeaver.ee.mongodb.exec.MongoExecutionContext.reconnect(MongoExecutionContext.java:285)
	... 9 more

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
serge-ridercommented, May 26, 2019

I made it to work with Atlas using self-signed SSL certificates. You can test this using Early Access version (https://dbeaver.com/files/ea)

  1. On Mongo settings page enter first host name from the list in Atlas URL (you can enter all host names but it is not needed).
  2. Set valid database name (test by default)
  3. Set Replica Set (from Atlas URL)
  4. Set proper user name/password and user Source database (usually admin)
  5. Use SCRAM-SHA-1 authentication mechanism
  6. Enable “Use self-signed certificate” on Network->SSL page (only if you don’t have proper certificate files!)

Required disclaimer: using self-signed certificates with Atlas is very non-secure approach (SSL itself makes very little sense in this case). I strongly recommend to use valid CA/server certificates.

image image

0reactions
uslsscommented, May 29, 2019

verified

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get Help with Atlas - MongoDB
MongoDB Atlas offers several packages to support your organization or project. Atlas includes a free Basic support plan, or you can upgrade to...
Read more >
MongoDB Atlas Support & Subscriptions
Atlas Support & Subscriptions ; End-to-end database support ; Initial Response Goals*, 2 hrs, 30 minutes, 15 minutes.
Read more >
FAQ: Support — MongoDB Atlas
How do I get support for my Atlas database deployments? ... Using the in-app chat or opening a support case, request support through...
Read more >
MongoDB Atlas Support & Subscriptions
MongoDB's consulting team can help you smoothly migrate your self-managed MongoDB deployment to Atlas and maximize your Atlas investment right from the start....
Read more >
MongoDB Support Policies
MongoDB Support Policies · MongoDB Cloud Services Support Policy · MongoDB Software Support Policy · MongoDB Legacy Support Policy · MongoDB Atlas for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found