[SERVER-24065] TypeError: this._db._initExtraInfo is not a function Created: 05/May/16  Updated: 05/May/16  Resolved: 05/May/16

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.2.5, 3.2.6
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Bartosz Solowiej Assignee: Kelsey Schubert
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

Fire up a DB that's running a 4 node MongoDB cluster with 2 shards and a replication factor of 2 (with one additional arbiter per each replicaSet shard), 3 config servers, and four mongos processes (one per node). Each of these are running MongoDB v3.2.5 with SSL configured and preferred on Ubuntu 14.04 LTS in Amazon EC2.

Next, propagate at least 30 or so records into db.buggers that look similar to this (note the nulls for all but _id, stack_trace, and type.

{ "_id": ObjectId("5729855d716af211bd3d2086"), "stack_trace": "... 8 more", "firmware_version": null, "timestamp": null, "mac_address": null, "phone_app_version": null, "device_type": null, "os_version": null, "type": "Crash" }

Homebrew 0.9.9 (git revision 6f80b; last commit 2016-05-04)
Homebrew/homebrew-core (git revision 0332; last commit 2016-05-04)

Then, connect to your mongos shell using Mongo v3.2.6 that was installed using the homebrew version listed above on a 2012 Macbook Pro running OS10.10.5. The shell is also using the Mongo-Hacker v0.0.13 extension for better colorization, etc.

Now, run this command:

mongos> db.buggers.find({timestamp: {$type: 10}}).remove()

You should see this error:

2016-05-05T08:11:35.067-0700 E QUERY [thread1] TypeError: this._db._initExtraInfo is not a function :
DBQuery.prototype.remove@/Users/toszter/.mongorc.js:444:5
@(shell):1:1

Deeper examination reveals no check for _initExtraInfo, as you'd expect:

mongos> db.analytics.find({timestamp: {$type: 10}}).remove
function (){
for ( var k in this._query ){
if ( k == "_id" && typeof( this._query[k] ) == "undefined" )

{ throw "can't have _id set to undefined in a remove expression"; }

}

this._checkMulti();
this._db._initExtraInfo();
this._mongo.remove( this._ns , this._query , false );
this._db._getExtraInfo("Removed");
}

Take note that invoking the command with query in this manner works fine:

mongos> db.analytics.remove({timestamp: {$type: 10}})
Removed 26 record(s) in 350ms
WriteResult(

{ "nRemoved": 26 }

)

Participants:

 Description   

When attempting to remove records by chaining the remove method to a find(<query>) method, we receive a stack trace:

mongos> db.buggers.find({timestamp: {$type: 10}}).remove()

2016-05-05T08:11:35.067-0700 E QUERY [thread1] TypeError: this._db._initExtraInfo is not a function :
DBQuery.prototype.remove@/Users/toszter/.mongorc.js:444:5
@(shell):1:1



 Comments   
Comment by Kelsey Schubert [ 05/May/16 ]

Hi toszter,

Thank you for the detailed report. The JS error is originating from your mongorc.js file, which indicates that the issue you are observing is likely the result of using Mongo Hacker.

Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. Since MongoDB does not support Mongo Hacker, I would recommend raising an issue on the Mongo Hacker github.

Kind regards,
Thomas

Generated at Thu Feb 08 04:05:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.