Akmal Zamel
Akmal Zamel

Reputation: 43

mongoimport socket was unexpectedly closed

I am using mongoimport to import json file to MongoDB Cloud Atlas but below command returned timeout error. What is wrong with my command?

mongoimport -u=foo -p=bar mongodb://clustersandbox-shard-00-01.wudsw.mongodb.net:27017 -d=foobar --type=json -c=users --drop --file=users.metadata.json

Error message:

2021-07-24T23:48:00.709+0800    error connecting to host: could not connect to server: server selection error: server selection timeout, current topology: { Type: Single, Servers: [{ Addr: clustersandbox-shard-00-01.wudsw.mongodb.net:27017, Type: Unknown, Last error: connection() error occured during connection handshake: connection(clustersandbox-shard-00-01.wudsw.mongodb.net:27017[-64]) socket was unexpectedly closed: EOF }, ] }

I have whitelisted my IP address.

Upvotes: 3

Views: 1142

Answers (1)

vicfan
vicfan

Reputation: 281

Maybe some error occors during restoring. For my case, I dumped data from MonogDB 4.2, and restore data into MongoDB 3.2, same error like yours. I used NumberDecimal data type in 4.2 (from 3.4), but MongoDB 3.2 does not support NumberDecimal. So the error occors. mongoimport socket was unexpectedly closed

Upvotes: 0

Related Questions