Mongodump: Failed: error writing data for collection

When I run mongodump I get an error: Failed: error writing data for collection…
I tried advise to use --forceTableScan. However, the error continues.
I am at a total loss for getting this to work.

What is the associated error?Like unable to write to disk,host unreachable etc
Share the mongodump command
What is your mongodump version?

I’ve tried various options. For example:

mongodump --uri=“mongodb://username:password@:27017/?authSource=admin”
mongodump --uri=“mongodb://username:password@:27017/?authSource=admin” --forceTableScan

The version of mongodump is 100.6.0

The error is Failed: error writing data for collection ‘COLLECTION’ to disk: error writing to file: write dump/COLLECTION.bson: input/output error

What happens is that it writes for a while and then stops with this error.

I’ve checked the usual suspects such as disk space. I have plenty. I’ve checked the log file and nothing there to explain why mongodump stopped.

Appears to be os issue
Where is your dump dir located
What is your os? Try to give a different path than default dump dir with --out option

I am looking into the possibility that there is an issue with our network drive.


input/output error generally happens because of disk corruption.
If you do fsck to your disk, I think your problem will solve.