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

Unable to connect to Mongo Atlas Cluster #6678

Closed
ayukidawe opened this issue Jan 10, 2018 · 72 comments

Comments

Projects
None yet
@ayukidawe
Copy link

commented Jan 10, 2018

I am unable to connect to Mongo Atlas Cluster ( Free Tier) using metabase docker container
You're on version v0.27.0.RC1
Built on 2017-11-17
Branch: release-0.27.0
Hash: 2c0ccb6

I can see the following error in the logs -
Jan 10 06:56:03 ERROR metabase.driver :: Failed to connect to database: com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=-shard-00-00-arulk.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoCommandException: Command failed with error 8000: 'no SNI name sent, make sure using a MongoDB 3.4+ driver/shell.' on server <-shard-00-00-arulk.mongodb.net:27017. The full response is { "ok" : 0, "errmsg" : "no SNI name sent, make sure using a MongoDB 3.4+ driver/shell.", "code" : 8000, "codeName" : "AtlasError" }}}]

I can connect to the cluster with shell, RoboMongo, Node.js application.
purposefully remove the actual server name to

@ayukidawe ayukidawe changed the title Unabe to connect to Mongo Atlas Cluster Unable to connect to Mongo Atlas Cluster Jan 10, 2018

@ayukidawe

This comment has been minimized.

Copy link
Author

commented Jan 11, 2018

I tried migrating from Free tier to a M10 and still facing the same issue/error.

@ayukidawe

This comment has been minimized.

Copy link
Author

commented Jan 12, 2018

I am able to connect on my local mongodb with SSL, however MongoDB Atlas logs are showing the following in the logs -
2018-01-12T04:00:26.369+0000 I NETWORK [thread1] connection accepted from 183.87.52.130:65485 #17146 (29 connections now open)
2018-01-12T04:00:26.370+0000 I - [conn17025] AssertionException handling request, closing client connection: 17189 The server is configured to only allow SSL connections
2018-01-12T04:00:26.370+0000 I - [conn17025] end connection 183.87.52.130:65485 (29 connections now open)

@silentachiever

This comment has been minimized.

Copy link

commented Feb 6, 2018

@ayukidawe I had this same issue for a month now. Since you are connecting to MongoAtlas, connect to your second or third node, anything other than the primary node. In your additional connection string, use readPreference=secondary&replicaSet=your_replSet_name&ssl=true.

Note that if you use read preference as primary or nearest, you will still experience issues.

@ayukidawe

This comment has been minimized.

Copy link
Author

commented Feb 7, 2018

I tried this, but still getting the same error -

Feb 07 08:13:58 ERROR metabase.driver :: Failed to connect to database: com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=secondary}. Client view of cluster state is {type=REPLICA_SET, servers=[{address=cluster0-shard-00-00-sx29x.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoCommandException: Command failed with error 8000: 'no SNI name sent, make sure using a MongoDB 3.4+ driver/shell.' on server cluster0-shard-00-00-sx29x.mongodb.net:27017. The full response is { "ok" : 0, "errmsg" : "no SNI name sent, make sure using a MongoDB 3.4+ driver/shell.", "code" : 8000, "codeName" : "AtlasError" }}}]
Feb 07 08:14:01 ERROR metabase.driver :: Failed to connect to database: com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=secondary}. Client view of cluster state is {type=REPLICA_SET, servers=[{address=cluster0-shard-00-00-sx29x.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]

Which version of Metabase are you using?

@silentachiever

This comment has been minimized.

Copy link

commented Feb 14, 2018

I am using Metabase v0.28.0 . Kindly confirm this is the same version you are using.

Also, it doesn't look like you specified the name of your replicaSet.

@ayukidawe

This comment has been minimized.

Copy link
Author

commented Feb 16, 2018

@ayukidawe

This comment has been minimized.

Copy link
Author

commented Feb 16, 2018

Screenshot for configuration.

image

@ayukidawe

This comment has been minimized.

Copy link
Author

commented Feb 16, 2018

I gave authentication database as "admin". Even if i remove it , i get same error.
I tried connecting to "test", "admin" or a custom database. But got same error.
I am able to connect to all db's from RoboMongo.
I have enabled access to everywhere from Atlas - security

IP Address Comment Status Actions
0.0.0.0/0 (includes your current IP address)   Active
@jontsai

This comment has been minimized.

Copy link

commented Feb 16, 2018

I am experiencing the same issue. I can connect with MongoDB Compass, but can't seem to connect with Metabase

@thedavidprice

This comment has been minimized.

Copy link

commented Feb 16, 2018

False Negative "Connection Error" Status

Atlas Mongodb@3.6.2
Metabase@0.28.1

Having similar issues on the database setup page, e.g. on "save db", trigger connection setting error message com.mongodb.MongoTimeoutException: Timed out after 3000 ms.... However, my database is correctly connected and I'm running queries successfully on dashboard, pulse, etc.

I'm using similar Metabase config as @silentachiever

Since you are connecting to MongoAtlas, connect to your second or third node, anything other than the primary node. In your additional connection string, use readPreference=secondary&replicaSet=your_replSet_name&ssl=true.

Background:
I have been using Atlas (mongo@3.4) + Metabase@0.26 successfully for over a year. Yesterday upgraded Atlas to mongo@3.6, which broke my Metabase connection. Saw that I needed to upgrade to >0.27 so just upgraded to 0.28.1. Then started seeing error messages. Tried different settings and confirmed IP whitelist ok, however nothing seemed to resolve error message. But when I checked my dashboard I was viewing results despite connection error message.

Hope this helps.

@jontsai

This comment has been minimized.

Copy link

commented Feb 17, 2018

Hi @thedavidprice It's still not working for me for a new M0 instance. Do you know if it's picking up new data for you, or perhaps just cached data from before?

I wrote to MongoDB Atlas team, and this is what they said:

Hi Jonathan,

I tested connecting Metabase to a Free Tier Altas M0 instance, it timed out as the same result as you have mentioned. It looks like it is due to the nature of Free Tier M0 instance being a shared instance and Metabase is incompatible with Atlas Free Tier M0 instance. This is also correlate with Metabase is using the driver which is [not version 3.4 compatible|https://github.com/metabase/metabase/blob/ca3ac52646f62a6d4213da8b8bf1c5686a95ec87/project.clj#L53]. This is particularly important in MongoDB Atlas M0 which uses a proxy layer for the connections.

To summarise, in order to use Metabase with MongoDB Atlas, you can choose to use M10+ instances or wait for Metabase to release the latest version which will be 3.4 compatible. Note that MongoDB 3.4 clusters may not be fully compatible with Metabase till they have the 3.4 compatible release of Metabase is available.

Please let me know if you have any questions.

Best,

@jontsai

This comment has been minimized.

Copy link

commented Feb 17, 2018

Upgraded to M10, and works for me, now. Most likely this is happening because of the proxy layer for connections in M0. So, yeah, seems to be a bug with Metabase or its driver.

cc @ayukidawe

@jontsai

This comment has been minimized.

Copy link

commented Feb 19, 2018

Update from MongoDB

Hi Jonathan,

Great to know that you were able to connect to Metabase after upgrading to an M10 cluster.

The reason for Metabase being unable to make connection to M0 Free Tier or M2/M5 Altas cluster is due to the fact that they are a shared cluster; running on a shared environment. However, Metabase does not have an updated version of the Java driver to support proxy layer connections, more specifically to support the [SNI|https://tools.ietf.org/html/rfc6066#section-3] TLS extension to make the connection to your shared instance.

I hope this helps answer your question, please feel free to let me know should you have additional questions.

@thedavidprice

This comment has been minimized.

Copy link

commented Feb 19, 2018

@jontsai Ah, to confirm I am indeed using the M10 tier and do not have experience connecting Metabase with a lower Atlas tier.

@aviggiano

This comment has been minimized.

Copy link

commented Mar 5, 2018

Any plans on updating the mongodb driver to fix this issue?

@BoLaMN

This comment has been minimized.

Copy link

commented May 11, 2018

Hey Guys,

I dug into this issue and thought id share my findings.

Atlas Connection Prerequisites

  • Clients must have support for TLS/SSL to connect to an Atlas cluster.
  • Clients must have support for the SNI TLS extension to connect to an Atlas M0 Free Tier or M2/M5 shared starter cluster.

SNI support requires both Java 8 or newer and the 3.6.3 Java driver.

monger version 3.1.0 (latest published which was released 17 Sep 2016) uses the mongodb-driver 3.3.0, the latest head 3.2.0-snapshot uses the mongodb-driver 3.6.0-beta2

I've managed to compiled it with the mongodb-driver updated to 3.6.3 and have deployed it to clojars ([org.clojars.bolamn/monger "3.2.0-SNAPSHOT"])

I've also deployed a docker version of metabase 0.29.2 with the monger dependancies updated (bolamn/metabase-atlas) which should hopefully support Atlas M0 Free Tier or M2/M5 shared starter clusters.

I'm currently testing it at the moment, will report back with my results later.

@sir-gon

This comment has been minimized.

Copy link

commented Jun 15, 2018

Any news with this issue?
Has anyone tested if this also happens in a dedicated instance of Mongo Atlas?

@thedavidprice

This comment has been minimized.

Copy link

commented Jun 15, 2018

@BoLaMN wondering if you had success and, if so, if it would be possible to submit a PR into metabase master?

@sir-gon it seems most of the issues related to free tiers and “shared” plans. My best guess is that you’re in the clear with a dedicated Atlas instance. I’ve continued to use M10 with no problem running latest metabase.

@BoLaMN

This comment has been minimized.

Copy link

commented Jul 18, 2018

update time 2

my version of monger successfully worked with atlas, two considerations are

setting ssl=true in the additional options isnt used (eg ssl=true&replicaSet=rs-shard-0&readPreference=secondary) instead it uses the ssl option defined on create as theres a ssl toggle

creating a new database entry and setting the toggle upon create or manually editing the postgres database to set ssl to true should solve alot of peoples issues

moving forward that ssl toggle should be added to the update screen

ive attached the beanstalk setup files pointing at docker pull bolamn/metabase-head:0.30-snap-debug
https://hub.docker.com/r/bolamn/metabase-head/tags/

cheers

metabase-atlas-0.30.zip

@thedavidprice

This comment has been minimized.

Copy link

commented Jul 24, 2018

@BoLaMN Thanks for passing this along! I'll take a look at implementing what you've done as well.

@sir-gon

This comment has been minimized.

Copy link

commented Aug 9, 2018

@BoLaMN could you provide pls a sample of your mongodb atlas parameters? I'm not sure how to pass host and extra parameters

@NoCodeIsCool

This comment has been minimized.

Copy link

commented Aug 16, 2018

@BoLaMN any ideas here, please. Set up Metabase on elastic beanstalk - tried connecting the free M0 Atlas version (didn't work for obvious reasons). Upgraded the Metabase Elastic Beanstalk version to 3.0. Tried a dedicated Mongo instance - same. Came back to Atlas - upgraded to M10. Same error. Followed this thread. We are reading the secondary cluster with the right settings (readPreference=secondary&replicaSet=cluster0-shard-00-01-xxxxx&ssl=true). Same error. I am not a developer - but trying to set up a serverless environment as far as possible - so simple instructions please.
Do we set up a new beanstalk instance with this your Zip file? Does this apply the fix to Metabase?

@BoLaMN

This comment has been minimized.

Copy link

commented Aug 16, 2018

My zip points to a modified version of metabase with a the latest head of monger compiled with mongodb-driver 3.8.0 for support for the free atlas cluster.

using &ssl=true is ignored on updates and has to be done on create only, use devtools and have a look at the response back for the database and under details.ssl it has to be true

@NoCodeIsCool

This comment has been minimized.

Copy link

commented Aug 16, 2018

Thanks @BoLaMN Not sure where you are (still finding my way around the environment - not a techie).
Is devtools in Atlas or Beanstalk?
Looking for idiot proof instructions if you can (don't overestimate the skills level of the idiot)

I upgraded to M10 to get the BI connector enabled - assumed this is how Metabase connects to Atlas. I have enabled the BI Connector - it's not that cheap. Does Metabase use this or bypass it? if it works? If it doesn't use it i will disable it

@NoCodeIsCool

This comment has been minimized.

Copy link

commented Aug 16, 2018

Still trying options - not sure this helps. If i am on M10 does the ssl=true setting still need fixing?

com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=secondary}. Client view of cluster state is {type=REPLICA_SET, servers=[{address=cluster0-shard-00-01-umkz9.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]

@NoCodeIsCool

This comment has been minimized.

Copy link

commented Aug 16, 2018

OK - we finally managed a Metabase connection. Moved away from Atlas and and got Metabase to connect to an Ubuntu instance of Mongo...

@michaelklishin

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2018

Monger 3.5.0 has been released.

@gitmrlu

This comment has been minimized.

Copy link

commented Dec 16, 2018

@herrsorgenfrei have you been able to to connect to your your 4.0.4 M10 Atlas cluster? I am trying to do the same.

@herrsorgenfrei

This comment has been minimized.

Copy link

commented Dec 16, 2018

@gitmrlu No, it was not possible. If you have any ideas, let me know.
I didn't buy the mongodb Atlas "BI Connector"-module.

@vjfloyd

This comment has been minimized.

Copy link

commented Jan 8, 2019

I had the same problem and got the same error , this works for me :
Go to Cluster configuration, in the Security tab then add a new rule 0.0.0.0/0

@tomohiro-n

This comment has been minimized.

Copy link

commented Apr 16, 2019

I am also facing this issue. I tried both Mongo 3.6 and 4.0. For 4.0, tried both M0 and M10.
The errors are almost same as other people here:

  • My connection string option: readPreference=secondary&ssl=true&replicaSet=<My Replica Set>&authSource=admin.
  • Log on Atlas: [conn301] Error receiving request from client: SSLHandshakeFailed: The server is configured to only allow SSL connections. Ending connection from <My Metabase Instance IP>
  • Error on Metabase: com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@381b8f66. Client view of cluster state is {type=REPLICA_SET, servers=[{address=<My Shard Host And Port>, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]

@camsaul @thedavidprice
I suppose we need to reopen this issue.
I read through this issue and I felt that actually almost none of those using MongoDB Atlas resolved this issue, although some people using compose.io got this resolved.

@BoLaMN

This comment has been minimized.

Copy link

commented Apr 16, 2019

@tomohiro-n did u read my comments regarding using ssl=true in the connectionstring?

#6678 (comment)

@tomohiro-n

This comment has been minimized.

Copy link

commented Apr 16, 2019

@BoLaMN Thanks for the comment! I did, but I was not sure about as theres a ssl toggle . I'm using the latest Metabase version v0.32.4 but I cannot find the SSL toggle easily. Could you please clarify where the toggle is?
The below is what I see (I cleared my input though):

Screen Shot 2019-04-17 at 2 14 15

@thedavidprice

This comment has been minimized.

Copy link

commented Apr 16, 2019

@tomohiro-n

I can confirm mongo is working fine for mongodb v4, metabase 0.32, and both paid and free Tiers on Atlas.

Have you checked the Atlas /Security/Whitelist and added IPs?

For Additional Mongo connection string options, try:
ssl=true&replicaSet=<your_db>-shard-0

Note: This string is found via the Atlas Connection settings for your db.

@tomohiro-n

This comment has been minimized.

Copy link

commented Apr 17, 2019

@thedavidprice

Thanks.
So you are saying now ssl=true isn't ignored? I understood you can confirm it's working fine but there seems to be many people stuck at the same point.

My IP whitelist is good. And the for the connection string, I tried ssl=true&replicaSet=<your_db>-shard-0 too but the same error (Actually <your_db>-shard-0 was what I meant by <My Replica Set> in my previous comment).
I tried the same host, port user, pass, options from other sources such as Redash, Mongo Shell, my NodeJS sever, etc and all of them can connect to this database. Thus I'm sure I set IP whitelist and options correctly.
Both my Metabase instance and my MongoDB Atlas cluster are located on GCP but I also tried running Metabase locally via Docker. This also resulted in the same error.

Any other advices would be appreciated. I already spent 4+ hours on this so I temporarily need to move away from Metabase for this mongo but will come back as soon as I can find a potential solution.

@BoLaMN

This comment has been minimized.

Copy link

commented Apr 17, 2019

in devtools what does your database entry return eg. https://cldup.com/DrONZRyhIS.jpg

@BoLaMN

This comment has been minimized.

Copy link

commented Apr 17, 2019

Also

still uses sslEnabled function at the end so if ssl is false it’ll override the connection string

@tomohiro-n

This comment has been minimized.

Copy link

commented Apr 17, 2019

@BoLaMN Thanks! I think I got what you mean.

At /setup, two POST /api/setup/validate requests are issued:

  1. First one is with details.details.ssl: true. Response is {"errors":{"dbname":"com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=<Host and Port>, type=UNKNOWN, state=CONNECTING}]"}}
  2. Second one is with details.details.ssl: false. Response is {"errors":{"dbname":"com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=<Host and Port>, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]"}}.

After the setup, we can also try to add the database at /admin/databases/create, and the request is POST /api/database. It doesn't have ssl property in the details object as opposed to the /setup screen. Of course it does have details.additional-options: "ssl=true&replica...." though.

So the next question would be, "Even if the ssl=true in details.additional-options is ignored, why does the first request with detail.detail.ssl: true tend to cause a timeout?". It does not happen from other tools or servers to the same MongoDB cluster.

@BoLaMN

This comment has been minimized.

Copy link

commented Apr 17, 2019

also try ssl=true&replicaSet=<name>-shard-0&readPreference=secondary
and
<name>-shard-00-02-abcde.mongodb.net as the host
with
Authentication Database: admin

@websirnik

This comment has been minimized.

Copy link

commented Apr 17, 2019

I'm also experiencing issues connecting to Atlas at the moment. I'm running Metabase v0.32.3.
In Atlas, all IPs are whitelisted.

Metabase query string is set to:

ssl=true&replicaSet=<name>-shard-0&readPreference=secondary

When I set host to cluster URL I get this exception

exception={com.mongodb.MongoSocketException: xxxxxx.mongodb.net}, caused by {java.net.UnknownHostException: xxxxxx.mongodb.net}

When I set host to replicaSet URL I get his exception:

exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}
@wowi42

This comment has been minimized.

Copy link

commented Apr 17, 2019

Hi,

same issue here:

host:
xxx-xxx.mongodb.net

database name:
xxx

port: 
27017

Database username:
xxx

Database password:
xxx

Authentication Database:
admin

Additional Mongo connection string options:
ssl=true&replicaSet=xxx-shard-0&authSource=admin

MongoDB 3.4
Metabase 0.32.4

@tomohiro-n

This comment has been minimized.

Copy link

commented Apr 17, 2019

@BoLaMN

also try ssl=true&replicaSet=-shard-0&readPreference=secondary
and
-shard-00-02-abcde.mongodb.net as the host
with
Authentication Database: admin

I have already tried these but no luck...

@tomohiro-n

This comment has been minimized.

Copy link

commented Apr 17, 2019

Finally I have a positive update.

At /setup, I got another error, {"errors":{"dbname":"Connection to '<instance host and port>' successful, but could not connect to DB."}} with the following parameters.

  • User and password: the pair which has read-only access to all collections for the specified database
  • Auth Database: admin
  • additional connection string options: ssl=true&replicaSet=<cluster name>-shard-0&readPreference=secondary

And then when I changed the user&pass to the one which has read-write access to the database, I passed the validation.

Here's the settings at Atlas. Top one passed and second one failed.
Screen Shot 2019-04-17 at 21 12 13

Questions and other facts:

  1. Does the order of the parameters specified in connection string options matter? (If yes, it needs to be fixed)
  2. Why does this need more than read access to the database? ( I used the read-only user in Redash and some other products and succeeded to add the one (and it has to...) )
  3. Even with same settings using read-write user, I couldn't add at /admin/databases/create. It needs to be fixed as we cannot add second or more databases.

Recommended workarounds regarding the issue that we cannot change the settings or add a new entry later at /admin/databases/create are also appreciated.

@BoLaMN

This comment has been minimized.

Copy link

commented Apr 17, 2019

@tomohiro-n im running v0.32.0-snapshot, built on 2018-11-26, branch mongo-atlas, hash 2f76ebe and have 3 databases that were setup via the ui so something changed between then and now

as for the other questions im not able to answer as i dont know clojure nor do i know the codebase that well, might be worth raising a pull request if you wish too as this ones closed.

anyway ill be unwatching this thread from now as i think theres enough to get by, thou i do agree its not the most user friendly setup for mongo atm.

@sofather

This comment has been minimized.

Copy link

commented Apr 18, 2019

Using the old style connection 2.~ worked for me.

This really strange I already have an app deployed and working with the new connection way

@arasmussen

This comment has been minimized.

Copy link

commented Apr 24, 2019

I've also burned several hours on this issue, and still haven't been able to get Metabase to successfully connect to my MongoDB Atlas 4.0 database.

For the host, I've tried using the cluster (xxx-xxx.mongodb.net) and each of the shards (xxx-shard-00-0x-xxx.mongodb.net).

For the user, I've tried giving them read only, read+write, and admin access.

My authentication database is set to admin. My connection string is ssl=true&replicaSet=xxx-shard-0&readPreference=secondary.

It seems that no matter what I do, I get the following connection timeout error:

com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=xxx-shard-00-0x-xxx.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]

Connecting to my DB with the following command line works:

mongo "mongodb+srv://xxx-xxx.mongodb.net/xxx" --username xxx -pxxx

If anyone has had success connecting Metabase to a MongoDB Atlas 4.0 cluster, please post your full configuration.

I'm on Metabase 0.32.5, which is the current latest version.

@harunsmrkovic

This comment has been minimized.

Copy link

commented Apr 26, 2019

This seems to be an issue with Metabase UI. I've just managed to add a new Mongo Atlas instance by connecting directly into the Postgres where my Metabase Config is stored, and added a new database row manually! 🎉

Example of how a details field in the record looks like:

{"additional-options":"retryWrites=true","ssl":true,"authdb":"admin","port":27017,"dbname":"test","host":"xxxxx-shard-00-00-rerjf.mongodb.net", "tunnel-port":22,"pass":"..........","user":"someUser"} 

Then I just went to Admin > Databases > Instances > Sync schema & field values, and voila 👌

@arasmussen

This comment has been minimized.

Copy link

commented Apr 26, 2019

connecting directly into the Postgres where my Metabase Config is stored

Is there documentation somewhere on how to do this? Can't find it.

@harunsmrkovic

This comment has been minimized.

Copy link

commented Apr 26, 2019

connecting directly into the Postgres where my Metabase Config is stored

Is there documentation somewhere on how to do this? Can't find it.

Sorry, I did not find any documentation about this. My Metabase instance is configured to store stuff into a Postgres db, so what I did is just psql into the Postgres instance, and updated metabase_database.

@thedavidprice

This comment has been minimized.

Copy link

commented Apr 26, 2019

Since this is a closed thread originally started over a year ago, I’d recommend someone currently experiencing issues open a new Issue with details. I am not having any difficulty with connection. But clearly something seems to have spiked for new install with current metabase version. Doubtful these new comments are visable to Metabase dev team.

If you do create an issue, please comment here with link/ID.

@arasmussen

This comment has been minimized.

Copy link

commented Apr 29, 2019

Hi all, as @thedavidprice suggested, I've opened a new issue describing this problem: #9867

If you're still experiencing problems connecting Metabase to a MongoDB Atlas 4.0 cluster, I'd recommend giving that one a 👍

@SarasArya

This comment has been minimized.

Copy link

commented May 10, 2019

Whoever is not able to do it.
Go to MongoDB Atlas.

  1. There is an option called connect. Once you click on it a pop up arrives.
  2. Choose the option called Connect Your Application
  3. In the Node.js Options You will see different versions of driver. Choose 2.2.12 or later
  4. You will get a connection string like this.
    mongodb://admin:<password>@your-proj-shard-00-00-xxxxx.mongodb.net:27017,your-proj-shard-00-01-xxxxx.mongodb.net:27017,your-proj-shard-00-02-xxxxx.mongodb.net:27017/test?ssl=true&replicaSet=your-proj-shard-0&authSource=admin&retryWrites=true

Now in your metabase for mac app
Host: your-proj-shard-00-00-xxxxx.mongodb.net
Database: test
Port: 27017
Database Username: admin
Database Password: your_password
Database Options: ssl=true&replicaSet= your-proj-shard-0&authSource=admin&retryWrites=true

Metabase tries to change case. Every option is case sensitive so please take care of that.
I was using Metabase for mac app 0.32.5.0
If there are any more versions you need let me know. If you are constantly getting that Server Encountered Error. I suggest you download the docker image that @BoLaMN created and run it and check docker logs of that.
That new mongod+srv URL doesn't work. Don't waste time there.

@arasmussen

This comment has been minimized.

Copy link

commented May 10, 2019

@SarasArya I tried exactly that, and it doesn't work for me.

com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate$1@769e44b0. Client view of cluster state is {type=REPLICA_SET, servers=[{address=MYPROJ-shard-00-00-XXX.mongodb.net:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.