Mongorestore error due to invalid BSONSize

I have a script that resets mongodb

mongodump --archive=$MONGODB_PATH --host $MONGODB_HOST --port $MONGODB_PORT --username $MONGODB_USER --password $MONGODB_PASS --db $MONGODB_NAME

but when I try to restore it with

mongorestore -d db_name backup/dump

failure:

Failed: dump_name: error restoring from backup/dump/dump_name: reading bson input: invalid BSONSize: -2120621459 bytes

I tried --batchSize=100, but this did not solve the problem for me.

What's going on here?

The solution was: mongorestore --archive=backup/dump

+6
source share

Source: https://habr.com/ru/post/1015930/


All Articles