Could not able to connect the hostname

Hi @BOBBILI_71717,

Please refer this great post by @Kanika and check if you have entered all the connection parameters correctly.

And also can you please try to connect from some other network, just to make sure it is not the firewall which is blocking your request.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

I’m not able to connect . Getting an error - MongoDB not running on the provided host and port

Hi @Aatmika_33599,

Please make sure you are not behind a firewall or using any VPN connection. Also, please make sure your port is not blocked by opening http://portquiz.net:27017/

I would also recommend you to try connecting from some other network such as your home network. However, if the issue still persists please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hey Hi!I am also facing the same problem and getting the same error message. My port is not blocked. Earlier, i was able to connect to the database but now i am unable to do so.

Hi @Rahul_14779,

Are you trying to connect from the same network or you are on a different network ?

If you are connecting from the same network then I will recommend you to do a fresh installation of Compass. If the issue still persists, please feel free to get back to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

initially I was on community edition and it was ok.
But now,after I installed the ent. version, Im facing the same problem in both app (windows 10 x64)
I tried to:
-remove both and purge AppData
-install only the non community edition
-install only the community

without no success,
but i can connect without no problem from another pc
At least pls help to combine data for the access url to db from shell (tried different combination but no way, ).
Hostname: cluster0-shard-00-00-jxeqq.mongodb.net
Username: m001-student
Password: m001-mongodb-basics
Replica Set Name: Cluster0-shard-0
Read Preference: Primary Preferred

Please check if any antivirus or firewall blocking your connection
Since it is working from another PC must be an issue specific to your other PC

Hi @Roman_Matkivskyy_95333,

It looks like a firewall issue as @Ramachandra_37567 mentioned or version related issue. Did you try connecting from mongo shell as well ?

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Thanks all,
now I’m under another network and it’s working; so it’s related to my home Network (but pinging the server, and testing the port 27017 from browser was all OK)

can not connect

Hi @Shah_02826,

Please confirm that port 27017 is not blocked by clicking http://portquiz.net:27017.

If successful, you will see a page load that indicates you can make outgoing requests on port 27017.

If a page does not load and your request eventually times out, outgoing traffic to port 27017 is probably blocked on your local network. If this is the case, please contact your IT department to see if there is a workaround or try to make the request from another location such as your home network.

If this is not the case then I would recommend you to check this great post by @Kanika on Compass related issues.

If the issue still persists, please feel free to get back to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

The page loaded successfully.

The page loaded successfully.


Shubham_Ranjan

      MongoDB Staff: Curriculum Support Engineer




    September 19

Hi @Shah_02826,

Please confirm that port 27017 is not blocked by clicking http://portquiz.net:27017.

If successful, you will see a page load that indicates you can make outgoing requests on port 27017.

If a page does not load and your request eventually times out, outgoing traffic to port 27017 is probably blocked on your local network. If this is the case, please contact your IT department to see if there is a workaround or try to make the request from another location such as your home network.

If this is not the case then I would recommend you to check this great post by @Kanika on Compass related issues.

If the issue still persists, please feel free to get back to us.

Thanks,

Shubham Ranjan

Curriculum Support Engineer


Visit Topic or reply to this email to respond.


In Reply To


Shah_02826

    September 19

can not connect [Capture]


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

IMG20190920092424.jpg

C:\Users\SMI>mongo “mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
2019-09-20T11:15:37.508+0500 W CONTROL [main] Option: ssl is deprecated. Please use tls instead.
MongoDB shell version v4.2.0
connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0
2019-09-20T11:15:37.753+0500 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-09-20T11:15:37.754+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-jxeqq.mongodb.net:27017
2019-09-20T11:15:37.754+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-09-20T11:15:37.755+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-jxeqq.mongodb.net:27017
2019-09-20T11:15:49.254+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-jxeqq.mongodb.net:27017
2019-09-20T11:15:57.755+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-09-20T11:15:57.755+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-jxeqq.mongodb.net:27017
2019-09-20T11:16:09.254+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-jxeqq.mongodb.net:27017
2019-09-20T11:16:17.755+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-09-20T11:16:17.760+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-jxeqq.mongodb.net:27017
2019-09-20T11:16:29.254+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-jxeqq.mongodb.net:27017
2019-09-20T11:16:37.756+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-jxeqq.mongodb.net:27017
2019-09-20T11:16:37.760+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-jxeqq.mongodb.net:27017
2019-09-20T11:16:40.771+0500 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set Cluster0-shard-0
2019-09-20T11:16:40.776+0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.

*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

2019-09-20T11:16:40.778+0500 E QUERY [js] Error: connect failed to replica set Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2019-09-20T11:16:40.787+0500 F - [main] exception: connect failed
2019-09-20T11:16:40.787+0500 E - [main] exiting with code 1

Hi @Shah_02826,

Can you please make sure you are able to ping the cluster by executing the command mentioned below?

ping cluster0-shard-00-00-jxeqq.mongodb.net

Additionally, it could be your firewall/anti-virus that might be blocking the requests. So, I would recommend you to try to connect from some other network such as your home network.

If the issue still persists, please feel free to get back to us.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

ping cluster0-shard-00-00-jxeqq.mongodb.net
Ping request could not find host cluster0-shard-00-00-jxeqq.mongodb.net. Please check the name and try again.

Hi @Shah_02826,

As mentioned earlier, I would recommend you to try to connect from some other network. For some reason, your current network is blocking the outgoing requests.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

I tried with other network and Compass connected but shell gave following error.
Microsoft Windows [Version 10.0.17134.407]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\SMI>mongo “mongodb+srv://cluster0-wxsru.mongodb.net/test” --username m001-student --password m001-mongodb-basics
MongoDB shell version v4.2.0
connecting to: mongodb://cluster0-shard-00-02-wxsru.mongodb.net:27017,cluster0-shard-00-01-wxsru.mongodb.net:27017,cluster0-shard-00-00-wxsru.mongodb.net:27017/test?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true
2019-09-24T10:06:02.847+0500 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-02-wxsru.mongodb.net:27017,cluster0-shard-00-01-wxsru.mongodb.net:27017,cluster0-shard-00-00-wxsru.mongodb.net:27017
2019-09-24T10:06:02.848+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-00-wxsru.mongodb.net:27017
2019-09-24T10:06:02.849+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-02-wxsru.mongodb.net:27017
2019-09-24T10:06:02.849+0500 I CONNPOOL [ReplicaSetMonitor-TaskExecutor] Connecting to cluster0-shard-00-01-wxsru.mongodb.net:27017
2019-09-24T10:06:19.054+0500 E NETWORK [ReplicaSetMonitor-TaskExecutor] SSL peer certificate validation failed: (800B0109)A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
2019-09-24T10:06:19.061+0500 E NETWORK [ReplicaSetMonitor-TaskExecutor] SSL peer certificate validation failed: (800B0109)A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
2019-09-24T10:06:19.063+0500 W NETWORK [ReplicaSetMonitor-TaskExecutor] DNS resolution while connecting to cluster0-shard-00-01-wxsru.mongodb.net:27017 took 16213ms
2019-09-24T10:06:19.067+0500 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set Cluster0-shard-0
2019-09-24T10:06:19.067+0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.

*** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network.

2019-09-24T10:06:19.068+0500 E QUERY [js] Error: connect failed to replica set Cluster0-shard-0/cluster0-shard-00-02-wxsru.mongodb.net:27017,cluster0-shard-00-01-wxsru.mongodb.net:27017,cluster0-shard-00-00-wxsru.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2019-09-24T10:06:19.073+0500 F - [main] exception: connect failed
2019-09-24T10:06:19.075+0500 E - [main] exiting with code 1

Hi @Shah_02826,

I am able to connect to your cluster using the connection string that you have provided.

mongo "mongodb+srv://cluster0-wxsru.mongodb.net/test" --username m001-student --password m001-mongodb-basics

17%20PM

I think it is a network issue on your end as I mentioned earlier.

Can you please check if you are able to ping the cluster by running this command in your terminal ?

ping cluster0-shard-00-02-wxsru.mongodb.net

I would recommend you to contact your IT department to see if there is a workaround or try to make the request from another location such as your home network.

Thanks,
Shubham Ranjan
Curriculum Support Engineer