mongorestore hangs indefinitely

seems like this is the correct behavior, although it's strange

qouting from docs

  To restore from the standard input, run mongorestore with the --archive option but omit the filename.

so the program was waiting for archive to be piped to standard input

so it can work like this

mongorestore --gzip --archive=./my-db.gz --drop -u admin --authenticationDatabase admin --verbose=5

or

mongorestore --gzip --archive --drop -u admin --authenticationDatabase admin --verbose=5 < my-db.gz

for me the damn thing got stuck at a percentage for around 5 mins then increased on its own. Not sure why :/ network activity was good, disk is also good. not sure how to debug this further.


I found the solution.

If I run the command with --archive ./my-db.gz, I get the deadlock. If I do --archive=./my-db.gz, it restores properly (i.e. the equals sign is required).

I'm running MacOSX High Sierra (10.13.2) with MongoDB installed from brew; version:

mongorestore version: r3.4.1
git version: 4a0fbf5245669b55915adf7547ac592223681fe1
Go version: go1.7.5
   os: darwin
   arch: amd64
   compiler: gc
OpenSSL version: OpenSSL 1.0.2k  26 Jan 2017