Good afternoon Guys, I'm having a very strange problem here. I'm doing some MongoDB training and created a MongoDB Atlas Cluster on AWS through MongoDB site. The server is cluster0-shard-00-01.g1knc.mongodb.net, I can ping the server, I can access port 27107(where the server is), tested with curl and etc... but I can't connect to the server either through MongoDB shell or through MongoDB compass. Tried everything, I had a local MongoDB installed through Snap which was working fine. I removed the local server, changed my DNS configuration to google DNS servers, previously was pointed to Opendns, installed Oracle Java 11 Sdk and no success. There is no local server running now and problem persisted, so it was not any conflict with local Mongo installation. Now the curious thing, I have a dual boot with Windows 10. Everything is working fine on Windows. I can ping, use the ports and can connect very fast to the atlas Db with Mongo shell or Mongodb compass using the same string connection using the same lan, my home lan.
I asked for Mongo support but as I can connect through WIndows in the same machine, network problems(port blocked, wi-fi, router, firewall and etc..) were discarded. The Mongo shell is a simple executable cli application and don't have any extra configuration. So, My Mongo friends just said that if I can connect through WIndows in the same machine, there seems to be a configuration problem on my linux which they can't help. I'm running Kubuntu 20.04 focal fossa and that's the first problem I have w/ Kubuntu in years. The error is the following :
# mongo "mongodb+srv://cluster0.g1knc.mongodb.net/aula" --username <myusername which I know>
MongoDB shell version v4.4.4
Enter password: connecting to: mongodb://cluster0-shard-00-02.g1knc.mongodb.net:27017,cluster0-shard-00-01.g1knc.mongodb.net:27017,r>cluster0-shard-00-00.g1knc.mongodb.net:27017/aula?authSource=admin&compressors=disabled& ;gssapiServiceName=mongodb&replicaSet=atlas-26tdmh-shard-0&ssl=true
{"t":{"$date":"2021-04-13T20:37:53.510Z"},"s":"I", "c":"NETWORK", "id":4333208, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"RSM host selection timeout","attr":{"replicaSet":"atlas-26tdmh-shard-0","error":"FailedToSatisfyReadPreference: Could not find host matching read preference { mode: "nearest" } for set atlas-26tdmh-shard-0"}}
*** You have failed to connect to a MongoDB Atlas cluster.
Please ensure that your IP whitelist allows connections from your network.
Error: connect failed to replica set atlas-26tdmh-shard-0/cluster0-shard-00-02.g1knc.mongodb.net:27017,cluster0-shard-00-01.g1knc.mongodb.net:27017,cluster0-shard-00-00.g1knc.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
# ping cluster0-shard-00-01.g1knc.mongodb.net
PING ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125) 56(84) bytes of data.
64 bytes de ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125): icmp_seq=1 ttl=30 tempo=181 ms
64 bytes de ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125): icmp_seq=2 ttl=30 tempo=183 ms
64 bytes de ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125): icmp_seq=3 ttl=30 tempo=182 ms
64 bytes de ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125): icmp_seq=4 ttl=30 tempo=183 ms
//port 27017 test
# curl portquiz.net:27017
Port 27017 test successful!
Your IP: 177.4.236.233
# curl cluster0-shard-00-01.g1knc.mongodb.net:27017
curl: (52) Empty reply from server // look that it replied on port !
Any Ideas of what can be blocking this connection?
Tks..
I asked for Mongo support but as I can connect through WIndows in the same machine, network problems(port blocked, wi-fi, router, firewall and etc..) were discarded. The Mongo shell is a simple executable cli application and don't have any extra configuration. So, My Mongo friends just said that if I can connect through WIndows in the same machine, there seems to be a configuration problem on my linux which they can't help. I'm running Kubuntu 20.04 focal fossa and that's the first problem I have w/ Kubuntu in years. The error is the following :
# mongo "mongodb+srv://cluster0.g1knc.mongodb.net/aula" --username <myusername which I know>
MongoDB shell version v4.4.4
Enter password: connecting to: mongodb://cluster0-shard-00-02.g1knc.mongodb.net:27017,cluster0-shard-00-01.g1knc.mongodb.net:27017,r>cluster0-shard-00-00.g1knc.mongodb.net:27017/aula?authSource=admin&compressors=disabled& ;gssapiServiceName=mongodb&replicaSet=atlas-26tdmh-shard-0&ssl=true
{"t":{"$date":"2021-04-13T20:37:53.510Z"},"s":"I", "c":"NETWORK", "id":4333208, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"RSM host selection timeout","attr":{"replicaSet":"atlas-26tdmh-shard-0","error":"FailedToSatisfyReadPreference: Could not find host matching read preference { mode: "nearest" } for set atlas-26tdmh-shard-0"}}
*** You have failed to connect to a MongoDB Atlas cluster.
Please ensure that your IP whitelist allows connections from your network.
Error: connect failed to replica set atlas-26tdmh-shard-0/cluster0-shard-00-02.g1knc.mongodb.net:27017,cluster0-shard-00-01.g1knc.mongodb.net:27017,cluster0-shard-00-00.g1knc.mongodb.net:27017 :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
# ping cluster0-shard-00-01.g1knc.mongodb.net
PING ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125) 56(84) bytes of data.
64 bytes de ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125): icmp_seq=1 ttl=30 tempo=181 ms
64 bytes de ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125): icmp_seq=2 ttl=30 tempo=183 ms
64 bytes de ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125): icmp_seq=3 ttl=30 tempo=182 ms
64 bytes de ec2-34-233-245-125.compute-1.amazonaws.com (34.233.245.125): icmp_seq=4 ttl=30 tempo=183 ms
//port 27017 test
# curl portquiz.net:27017
Port 27017 test successful!
Your IP: 177.4.236.233
# curl cluster0-shard-00-01.g1knc.mongodb.net:27017
curl: (52) Empty reply from server // look that it replied on port !
Any Ideas of what can be blocking this connection?
Tks..
Comment