[SERVER-7262] mongorestore on 2.2 fails with "Invalid ns" Created: 04/Oct/12  Updated: 15/Feb/13  Resolved: 09/Oct/12

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.2.0
Fix Version/s: None

Type: Bug Priority: Blocker - P1
Reporter: Derek Crudgington Assignee: Scott Hernandez (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File backup1.tar    
Issue Links:
Duplicate
duplicates SERVER-7160 Mongorestore doesn't auth against adm... Closed
Operating System: ALL
Participants:

 Description   

# mongodump -uuser -ppass --host 127.0.0.1 -o /backups/test1
connected to: 127.0.0.1
Thu Oct  4 20:06:42 all dbs
Thu Oct  4 20:06:42 DATABASE: admin      to /backups/test1/admin
Thu Oct  4 20:06:42     admin.system.users to /backups/test1/admin/system.users.bson
Thu Oct  4 20:06:42 doing snapshot query
Thu Oct  4 20:06:42              2 objects
Thu Oct  4 20:06:42     Metadata for admin.system.users to /backups/test1/admin/system.users.metadata.json
Thu Oct  4 20:06:42 DATABASE: test       to /backups/test1/test
# ls /backups/test1/
admin  test
# mongorestore -uuser -ppass /backups/test1/
 
connected to: 127.0.0.1
assertion: 13106 nextSafe(): { $err: "Invalid ns [.$cmd]", code: 16256 }



 Comments   
Comment by Scott Hernandez (Inactive) [ 09/Oct/12 ]

No, it will be in 2.2.1 RC1 (and is currently in the v2.2 nightly) since it was back-ported after RC0 went out.

This issue is a duplicate of -this one -, which has the fix : SERVER-7160

Comment by Derek Crudgington [ 09/Oct/12 ]

Thanks. Can you verify this is fixed in 2.2.1-rc0 ?

Comment by Scott Hernandez (Inactive) [ 09/Oct/12 ]

I can reproduce this and I believe it has already been fixed in master for the 2.2.1 release. It stems from no db being sent to authorize (nonce request). I will look for the orig server issue report and link it.

Here is a workaround for just the admin db:

mongorestore  -uuser -ppasswd -d admin ./backup1/admin

Server logs:

[initandlisten] connection accepted from 127.0.0.1:55291 #3 (2 connections now open)
[conn3] assertion 16256 Invalid ns [.$cmd] ns:.$cmd query:{ getnonce: 1 }
[conn3]  ntoskip:0 ntoreturn:1
[conn3] problem detected during query over .$cmd : { $err: "Invalid ns [.$cmd]", code: 16256 }
[conn3] end connection 127.0.0.1:55291 (1 connection now open)

Comment by Derek Crudgington [ 05/Oct/12 ]

If it helps I can give you login information to the server.

Comment by Derek Crudgington [ 04/Oct/12 ]

Hi,

Thanks for the quick response. This is the same instance, not restarted. I run the mongodump and then the restore right after. Everything is 2.2.0:

# mongodump --version
mongodump version 2.2.0
# mongo --version
MongoDB shell version: 2.2.0
# mongorestore --version
mongorestore version 2.2.0

I've attached the files from the backup in backup1.tar.

Comment by Scott Hernandez (Inactive) [ 04/Oct/12 ]

Can you attach the files from the backup please?

What version did you backup from? Is that the same instance running from the backup and restore (not restarted)?

Generated at Thu Feb 08 03:14:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.