Connect failed to Cluster

Greetings,

I am trying to set up the connection.

I did all the steps on the server. however, on the client using the terminal on mac.
i go to the path …/bin.
run the command
mongo “mongodb+srv://mflix-mkdwh.mongodb.net/test” --username m220student

  • username: m220student
  • password: m220password

but I got the following error:
connecting to: mongodb+srv://mflix-mkdwh.mongodb.net/test
2019-08-25T15:10:22.218+0300 I NETWORK [thread1] Starting new replica set monitor for mflix-shard-0/mflix-shard-00-00-mkdwh.mongodb.net.:27017,mflix-shard-00-01-mkdwh.mongodb.net.:27017,mflix-shard-00-02-mkdwh.mongodb.net.:27017
2019-08-25T15:10:23.049+0300 E NETWORK [ReplicaSetMonitor-TaskExecutor-0] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
2019-08-25T15:10:23.052+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
2019-08-25T15:10:23.891+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
2019-08-25T15:10:23.891+0300 W NETWORK [thread1] Unable to reach primary for set mflix-shard-0
2019-08-25T15:10:23.891+0300 I NETWORK [thread1] Cannot reach any nodes for set mflix-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.

2019-08-25T15:10:37.246+0300 E QUERY [thread1] Error: connect failed to replica set mflix-shard-0/mflix-shard-00-00-mkdwh.mongodb.net.:27017,mflix-shard-00-01-mkdwh.mongodb.net.:27017,mflix-shard-00-02-mkdwh.mongodb.net.:27017 :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed

I make sure that the server is accessible from anywhere 0.0.0.0
what should I do?

Regards,

1 Like

Hi @Mohammed_Hassan_39496,

I am able to access the cluster from my system. Please make sure that you are also able to do so. If not, please check the firewall settings or try from your home network.

Kanika

thank you Kanika for confirming this.

I tried on different networks but not worked.

on my mac, I tried even to turn off the firewall but still, I get the same error.

at least now you confirm that the server config is correct.

Regards,
Mohammed

Please share the following information:

  • Screenshot of your terminal/command line screen when you run below command:

     mongo mongodb+srv://mflix-mkdwh.mongodb.net/test --username m220student --password m220password
    
  • Your .env file contents.

  • When you run db connection test.

Also, it would be great if you can try from your home system or network where firewall is not the issue.

Kanika

greetings,

here is the output from my terminal

Mohammeds-MacBook-Pro:bin mohammed-macbookPro$ mongo mongodb+srv://mflix-mkdwh.mongodb.net/test --username m220student --password m220password

MongoDB shell version v3.6.3

connecting to: mongodb+srv://mflix-mkdwh.mongodb.net/test

2019-08-27T18:20:33.118+0300 I NETWORK [thread1] Starting new replica set monitor for mflix-shard-0/mflix-shard-00-00-mkdwh.mongodb.net.:27017,mflix-shard-00-01-mkdwh.mongodb.net.:27017,mflix-shard-00-02-mkdwh.mongodb.net.:27017

2019-08-27T18:20:36.137+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:37.291+0300 E NETWORK [ReplicaSetMonitor-TaskExecutor-0] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:39.327+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:39.327+0300 W NETWORK [thread1] Unable to reach primary for set mflix-shard-0

2019-08-27T18:20:39.327+0300 I NETWORK [thread1] Cannot reach any nodes for set mflix-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.

2019-08-27T18:20:41.165+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:42.308+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:43.395+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:43.395+0300 W NETWORK [thread1] Unable to reach primary for set mflix-shard-0

2019-08-27T18:20:43.395+0300 I NETWORK [thread1] Cannot reach any nodes for set mflix-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.

2019-08-27T18:20:45.255+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:47.429+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:49.975+0300 E NETWORK [thread1] SSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

2019-08-27T18:20:49.975+0300 W NETWORK [thread1] Unable to reach primary for set mflix-shard-0

2019-08-27T18:20:49.975+0300 I NETWORK [thread1] Cannot reach any nodes for set mflix-shard-0. Please check network connectivity and the status of the set. This has happened for 3 checks in a row.

2019-08-27T18:20:49.985+0300 E QUERY [thread1] Error: connect failed to replica set mflix-shard-0/mflix-shard-00-00-mkdwh.mongodb.net.:27017,mflix-shard-00-01-mkdwh.mongodb.net.:27017,mflix-shard-00-02-mkdwh.mongodb.net.:27017 :

connect@src/mongo/shell/mongo.js:251:13

@(connect):1:6

exception: connect failed

Mohammeds-MacBook-Pro:bin mohammed-macbookPro$

here is the env

Mohammeds-MacBook-Pro:bin mohammed-macbookPro$ printenv

rvm_bin_path=/Users/mohammed-macbookPro/.rvm/bin

TERM_PROGRAM=Apple_Terminal

ANDROID_HOME=/usr/local/Cellar/android-sdk

GEM_HOME=/Users/mohammed-macbookPro/.rvm/gems/ruby-2.3.0

TERM=xterm-256color

SHELL=/bin/bash

IRBRC=/Users/mohammed-macbookPro/.rvm/rubies/ruby-2.3.0/.irbrc

TMPDIR=/var/folders/fg/wqv5vlvn5nv3w0t5lnmn_vfr0000gn/T/

Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.MBWF2BsFy6/Render

TERM_PROGRAM_VERSION=421.1

OLDPWD=/Users/mohammed-macbookPro/Development/mangodb/mongodb-osx-x86_64-4.0.11

MY_RUBY_HOME=/Users/mohammed-macbookPro/.rvm/rubies/ruby-2.3.0

TERM_SESSION_ID=ED8458AE-B892-4BA4-BA38-3A0D05945C94

USER=mohammed-macbookPro

_system_type=Darwin

rvm_path=/Users/mohammed-macbookPro/.rvm

SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.iIr9iAOAZs/Listeners

rvm_prefix=/Users/mohammed-macbookPro

PATH=/usr/local/Cellar/android-sdk/tools:/usr/local/Cellar/android-sdk/platform-tools:/Users/mohammed-macbookPro/.rvm/gems/ruby-2.3.0/bin:/Users/mohammed-macbookPro/.rvm/gems/ruby-2.3.0@global/bin:/Users/mohammed-macbookPro/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mohammed-macbookPro/.rvm/bin:/usr/local/mongodb/bin

PWD=/Users/mohammed-macbookPro/Development/mangodb/mongodb-osx-x86_64-4.0.11/bin

_system_arch=x86_64

XPC_FLAGS=0x0

_system_version=10.14

XPC_SERVICE_NAME=0

rvm_version=1.27.0 (latest)

HOME=/Users/mohammed-macbookPro

SHLVL=1

GEM_PATH=/Users/mohammed-macbookPro/.rvm/gems/ruby-2.3.0:/Users/mohammed-macbookPro/.rvm/gems/ruby-2.3.0@global

LC_CTYPE=UTF-8

MONGO_PATH=/usr/local/mongodb

RUBY_VERSION=ruby-2.3.0

_system_name=OSX

_=/usr/bin/printenv

Mohammeds-MacBook-Pro:bin mohammed-macbookPro$

Note that I am running it from home internet

Thanks for your support

Hi @Mohammed_Hassan_39496,

Please try after installing the latest version of MongoDB : https://www.mongodb.com/download-center/enterprise

Let me know if you still have this issue.

Kanika

Greetings Kanika,

Mohammeds-MacBook-Pro:bin mohammed-macbookPro$ mongo “mongodb+srv://mflix-mkdwh.mongodb.net/test” --username m220student

MongoDB shell version v4.2.0

Enter password:

connecting to: mongodb://mflix-shard-00-02-mkdwh.mongodb.net:27017,mflix-shard-00-00-mkdwh.mongodb.net:27017,mflix-shard-00-01-mkdwh.mongodb.net:27017/test?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=mflix-shard-0&ssl=true

2019-09-01T14:07:02.084+0300 I NETWORK [js] Starting new replica set monitor for mflix-shard-0/mflix-shard-00-02-mkdwh.mongodb.net:27017,mflix-shard-00-00-mkdwh.mongodb.net:27017,mflix-shard-00-01-mkdwh.mongodb.net:27017

2019-09-01T14:07:02.086+0300 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to mflix-shard-00-00-mkdwh.mongodb.net:27017

2019-09-01T14:07:02.086+0300 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to mflix-shard-00-01-mkdwh.mongodb.net:27017

2019-09-01T14:07:02.086+0300 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to mflix-shard-00-02-mkdwh.mongodb.net:27017

2019-09-01T14:07:03.576+0300 W NETWORK [ReplicaSetMonitor-TaskExecutor] DNS resolution while connecting to mflix-shard-00-02-mkdwh.mongodb.net:27017 took 1490ms

2019-09-01T14:07:04.246+0300 I NETWORK [ReplicaSetMonitor-TaskExecutor] Confirmed replica set for mflix-shard-0 is mflix-shard-0/mflix-shard-00-00-mkdwh.mongodb.net:27017,mflix-shard-00-01-mkdwh.mongodb.net:27017,mflix-shard-00-02-mkdwh.mongodb.net:27017

Implicit session: session { “id” : UUID(“cf6491a5-8081-444a-8bd3-7bdb53e8d547”) }

MongoDB server version: 4.0.12

WARNING: shell and server versions do not match

MongoDB Enterprise mflix-shard-0:PRIMARY>

==================

Thank you very much. it seems that the shell version was old.
I appreciate your help

1 Like