As part of the MongoDB World Hackathon, I’m trying to import more data into my cluster and I’m now experiencing this error which I didn’t have the first time I ran this import script
This issue is very similar to an earlier one but I’m having difficulty applying the solution there.
Perhaps more newbie-friendly instructions as to what I should do will help because I saw instructions concerning changing host name or port to replica set something, but I didn’t quite what exactly to do.
May be your network not supporting srv type string
Try longform of string(old style)
If you have Atlas account you can get full mongoimport command from command line tools
You may get sample command from our forum threads too
Hi @Fiewor_John - have you modified mongoimport.sh at all? I can only reproduce your error if I put double quotes around the $* at the end of that script, so it looks like "$*".
Thanks @Fiewor_John - I’ve just realised that I confused your error message with another
I agree with @Ramachandra_Tummala that this may be a limitation of your DNS server. Have you changed network since the last time things worked?
If the mongodb+srv URI doesn’t work, there is an alternative. I think the following should work for you (remember to put your password in the correct place )
Thanks Mark and @Ramachandra_Tummala . I actually tried this already after I observed that @Joe_Drumgoole had a /test in his blog post but it gave another weird error which I frankly didn’t want to bother anyone with again
But I’ll share it here and try again later cause I fear it has something to do with my network
I’m starting to think the network you’re on is quite restricted. Can you try pinging one of the nodes, like this
ping gdelt-shard-00-00.n1mbb.mongodb.net
If you get something like the following then you might be able to access the replica-set:
64 bytes from 40.67.234.22: icmp_seq=0 ttl=50 time=29.413 ms
64 bytes from 40.67.234.22: icmp_seq=1 ttl=50 time=29.855 ms
64 bytes from 40.67.234.22: icmp_seq=2 ttl=50 time=29.782 ms
64 bytes from 40.67.234.22: icmp_seq=3 ttl=50 time=29.692 ms
If you can, then try using mongosh directly to connect to the replicaset using your SRV connection string, and then the comma-separated connection string, and see what the results are.
If the ping times out then there’s a good chance you just can’t connect to MongoDB Atlas over the network you’re on.
Okay! I think it’s starting to look like @Joe_Drumgoole was right when we were talking about this issue this morning - I think there’s a bug in the script, but I can’t work out how to fix it exactly. Please change the last block of the script so it looks like the following, and paste in your connection string:
So. here’s the final connection string that worked: "mongodb://john:PASSWORD@gdelt-shard-00-00.n1mbb.mongodb.net:27017,gdelt-shard-00-01.n1mbb.mongodb.net:27017,gdelt-shard-00-02.n1mbb.mongodb.net:27017/DATABASE?ssl=true&authSource=admin&replicaSet=atlas-7o9d3y-shard-0"
And the link to the doc explaining the ssl part of mongoDB URI for anyone that might come across this later: