Having issues running mongorestore on community operator database

We have two kubernetes clusters, one of which has been running the enterprise operator for some time, the other I’m building back out with the intention of using the community operator as our needs do not justify the enterprise one. I’m trying to restore a database archive taken from an existing rocketchat database replicaset (v4.2) to a new, empty db replicaset running 4.4.11/5.0.5 (I haven’t had success with either).

After deployment, I can mongosh into the cluster using the URIs provided by the secret created after the database replicaset is created. I have a user with the dbOwner and can successfully run e.g. a db.user.insert against it. However, when I try to restore my (~48gb) archive, which I have been able to successfully restore multiple times against my existing cluster, it simply hangs:

root@mongodb-maintenance-7dffdd9dbd-xl8kk:/# mongorestore --uri="mongodb://rocketchat:(password)@rocketchat-db-0.rocketchat-db-svc.mongodb.svc.cluster.local:27017,rocketchat-db-1.rocketchat-db-svc.mongodb.svc.cluster.local:27017,rocketchat-db-2.rocketchat-db-svc.mongodb.svc.cluster.local:27017/rocketchat?ssl=false" --drop --gzip --archive /tmp/backups/rocketchat.archive
2022-01-05T13:18:05.644-0800    The --db and --collection flags are deprecated for this use-case; please use --nsInclude instead, i.e. with --nsInclude=${DATABASE}.${COLLECTION}


It makes no difference if I use the standard connection string or the standardSrv one. I thought perhaps it was unpacking the archive before starting the restore (which would be different behavior than what I’m used to seeing, the restore starts right away on our existing cluster), but top in my maintenance pod shows zero activity from mongorestore, and I don’t see any new collections in the database or anything to suggest it’s running at all.

I’ve tried other variations of mongorestore as well, however they tend to throw an authentication or connection error:

sudo mongorestore --drop --host="(loadbalancer ip)" --username=rocketchat --authenticationDatabase="rocketchat" --db="rocketchat" --gzip --archive=rocketchat.archive
Enter password:

2022-01-05T21:42:55.770+0000    Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.

Any suggestions would be appreciated. I am using the latest mongo tools that were installed following instructions on this page. Happy to provide any other information that might help.

Naturally, stumbled on the solution moments after posting. For anyone who stumbles on this in the future, it’s the difference between:

--archive=rocketchat.archive
and
--archive rocketchat.archive

Where the former will read from the file, the latter is waiting for input from stdin. Fixing my command above to use --archive=/tmp/backups/rocketchat.archive worked.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.