Error while using mongorestore

I’m getting the error below while using the command
mongorestore --drop --gzip --uri "mongodb+srv://m220student:m220password@<my-uri>/test" data

error: read tcp 192.168.8.60:51126->34.199.153.48:27017: wsarecv: 
A connection attempt failed because the connected party did not
 properly respond after a period of time, or established connection 
failed because connected host has failed to respond.

I have not been able to pass this mongorestore stage because of this error and I believe it is because I have poor internet connection.

I’d be really glad if anyone could help. Thanks

try mongorestore --drop --gzip --/uri:"mongodb+srv://m220student:m220password@<my-uri>/test" data

Thank you very much. I have tried this and it was returning the error

error parsing command line options: unknown option 
"/uri:mongodb+srv://m220student:m220password@mflix-xirpo.mongodb.net/test"

From the root directory of the extracted file, enter the command below
Make sure to replace username with your username, password with your password and YOUR_CLUSTER_URI with yours in the string below.

mongorestore --drop --gzip --uri “mongodb+srv://username:password@YOUR_CLUSTER_URI/test” data

Thanks Ayo, but the suggestion you proposed was the way that I was running it and I was getting the error

error: read tcp 192.168.8.60:51126->34.199.153.48:27017: wsarecv: 
A connection attempt failed because the connected party did not
 properly respond after a period of time, or established connection 
failed because connected host has failed to respond

Did you allow your IP Address in Atlas Cluster? It appears it’s a connection issue and not a command line options parse error

Yes sir, I did.

I setup the IP whitelist options to allow from any IP address

you should try
`mongorestore --drop --gzip --/uri:“mongodb+srv://m220student:m220password@/test” data
not

"/uri:mongodb+srv://m220student:m220password@mflix-xirpo.mongodb.net/test"

There is no slash in from the uri. /uri: is wrong, --/uri: is also wrong.

The document of mongorestore is at https://docs.mongodb.com/manual/reference/program/mongorestore/

You should always verify official documentation when things are not working as you expect.

hi @Dominic_41302

Have you found the solution? I am also having the same problem!!!

Hi @david_mitesh,

Can you please let me know if you face the same issue after whitelisting the IP also?

Kanika

i did that…still not working!

Please share the command and the screenshot for the error.

Kanika

I have disabled by windows defender firewall and antivirus. But the issue was still not solved.

Then I went to do some search online and found a stackoverflow problem relating same.

In this solution it is mentioned that problem occured as his university’s network has not allowed him to access that( I hope this interpretation is right).
So, how to know whether the access is there or not without asking the network administrator of the college because that would be a troublesome task.

It seems like your network is blocking out the request. Please make sure you have antivirus/firewall OFF.

You can check if you have access or not by running the mongo connection command from your terminal / command line:

mongo mongodb+srv://m220student:m220password@mflix-lthow.mongodb.net

I am able to connect, if you see somewhat different, it means you cannot access the cluster.

If you still want to access the data without updating the firewall settings, then I would suggest import the data on your mongodb cluster on your local system.

Kanika