I've a Mongo database with the follow URI schema: mongodb://username:password@url1:port,url2:port/database?authSource=admin&ssl=true and I can't connect Metabase BI to my database.
The image below is how I'm setting up the database:
com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=url:port, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]
I've tried to see this solution here opened on Metabase Discussion but I didn't succeed cause I have no certificate and I usually connect to my database using 'sslAllowInvalidCertificates'. Furthermore, when I create a certificate as has taught on this link and now I'm getting the follow error:
"dbname":"com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=url:port, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketException: url}, caused by {java.net.UnknownHostException: url}}]"
Hi @vitoresende
I don’t run MongoDB, but since it’s saying Prematurely reached end of stream, I would think you would see the connection failing in your MongoDB log - do you see anything there?
UnknownHostException was due my network connection. But now, I’m getting the follow error:
“com.mongodb.MongoTimeoutException: Timed out after 3000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address:38796=sl-us-south-1-portal.22.dblayer.com, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target}, caused by {sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target}, caused by {sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target}}]”
I was answering the topic cause I've found this solution and I tried what j005u said there. And I've got the same error of before: "Prematurely reached end of stream". I've tried everything build manually and using Docker, but nothing is working