Drop collection failed: Error code 12503

244 views
Skip to first unread message

Adam Fields

unread,
Apr 25, 2013, 2:33:40 PM4/25/13
to mongod...@googlegroups.com
I got this error when trying to drop a collection:

Thu Apr 25 18:27:07 uncaught exception: drop failed: {
"nIndexesWas" : 9,
"errmsg" : "exception: drop: dropIndexes for collection failed - consider trying repair cause: Invalid BSONObj size: 0 (0x00000000) first element: EOO",
"code" : 12503,
"ok" : 0
}

This is a lone master. Taking the db down to repair it is not really an option, and I am in the process of removing some collections so that it can become a replica set (this collection is quite large and won't fit on the second machine).

Is there any way to force the collection to drop?

Moacy Barros

unread,
Apr 25, 2013, 3:00:02 PM4/25/13
to mongod...@googlegroups.com
Hello Adam,

try to repair the database and try to drop it again: http://docs.mongodb.org/manual/reference/command/repairDatabase/

It seams to be some data corruption issue, as the message indicates.

Regards,
Moacy



--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
name     : "Moacy Barros", 
  title    : "Tech leader",
  company  : "LBIT",
  twitter  : "@moacybarros",
  linkedin : "MoacyBarros"
  skype    : "moacybarros",
  web      : ["www.moacybarros.com", "www.lbit.com"]
}

Adam Fields

unread,
Apr 25, 2013, 3:20:06 PM4/25/13
to mongod...@googlegroups.com

On Apr 25, 2013, at 3:00 PM, Moacy Barros <moacy...@gmail.com> wrote:

> Hello Adam,
>
> try to repair the database and try to drop it again: http://docs.mongodb.org/manual/reference/command/repairDatabase/
>
> It seams to be some data corruption issue, as the message indicates.
>

Thanks - that doesn't really help. Repairing the DB is likely to take days, and would require the db to be offline.

If I set up another machine as a replica, will it ignore this collection, or will it kill replication?

Moacy Barros

unread,
Apr 25, 2013, 8:29:25 PM4/25/13
to mongod...@googlegroups.com
Hello Adam,

I am not sure, I believe replication will fail, since it will try to build index data from same corrupted source.

Maybe you can try to rebuild collection index to try to repair it before try to drop the collection again: http://docs.mongodb.org/manual/tutorial/build-indexes-on-replica-sets/#index-building-replica-sets

db.collection.reIndex()

Another option is dump your collection, is it feasible for your scenario? Dump all collection except the one you need drop?



Sorry,
Moacy 

Moacy Barros

unread,
May 8, 2013, 8:00:30 AM5/8/13
to mongod...@googlegroups.com
Hello Adam,

how is it going? Can you confirm MongoDB version? Do you see any other assertion error message? Did you try to rebuild the collection index?

Please, let me know the current status, so I can try to looking for more options.

Regards,
Moacy
Reply all
Reply to author
Forward
Message has been deleted
0 new messages