<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:05:17 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-24065] TypeError: this._db._initExtraInfo is not a function</title>
                <link>https://jira.mongodb.org/browse/SERVER-24065</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When attempting to remove records by chaining the remove method to a find(&amp;lt;query&amp;gt;) method, we receive a stack trace:&lt;/p&gt;


&lt;p&gt;mongos&amp;gt; db.buggers.find({timestamp: {$type: 10}}).remove()&lt;/p&gt;

&lt;p&gt;2016-05-05T08:11:35.067-0700 E QUERY    &lt;span class=&quot;error&quot;&gt;&amp;#91;thread1&amp;#93;&lt;/span&gt; TypeError: this._db._initExtraInfo is not a function :&lt;br/&gt;
DBQuery.prototype.remove@/Users/toszter/.mongorc.js:444:5&lt;br/&gt;
@(shell):1:1&lt;/p&gt;</description>
                <environment></environment>
        <key id="284714">SERVER-24065</key>
            <summary>TypeError: this._db._initExtraInfo is not a function</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="kelsey.schubert@mongodb.com">Kelsey Schubert</assignee>
                                    <reporter username="toszter">Bartosz Solowiej</reporter>
                        <labels>
                    </labels>
                <created>Thu, 5 May 2016 15:36:56 +0000</created>
                <updated>Thu, 5 May 2016 23:51:47 +0000</updated>
                            <resolved>Thu, 5 May 2016 23:51:47 +0000</resolved>
                                    <version>3.2.5</version>
                    <version>3.2.6</version>
                                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="1257195" author="thomas.schubert" created="Thu, 5 May 2016 23:51:47 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=toszter&quot; class=&quot;user-hover&quot; rel=&quot;toszter&quot;&gt;toszter&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;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 &lt;a href=&quot;http://tylerbrock.github.io/mongo-hacker/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Mongo Hacker&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;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 &lt;a href=&quot;https://github.com/TylerBrock/mongo-hacker&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Mongo Hacker github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Thomas&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 5 May 2016 23:51:47 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 40 weeks, 6 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>kelsey.schubert@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 40 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>toszter</customfieldvalue>
            <customfieldvalue>kelsey.schubert@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrk8hz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsl4yv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;Fire up a DB that&apos;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).  &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;  Each of these are running MongoDB v3.2.5 with SSL configured and preferred on Ubuntu 14.04 LTS in Amazon EC2.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

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

&lt;p&gt;Homebrew 0.9.9 (git revision 6f80b; last commit 2016-05-04)&lt;br/&gt;
Homebrew/homebrew-core (git revision 0332; last commit 2016-05-04)&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Now, run this command:&lt;/p&gt;

&lt;p&gt;mongos&amp;gt; db.buggers.find({timestamp: {$type: 10}}).remove()&lt;/p&gt;

&lt;p&gt;You should see this error:&lt;/p&gt;

&lt;p&gt;2016-05-05T08:11:35.067-0700 E QUERY    &lt;span class=&quot;error&quot;&gt;&amp;#91;thread1&amp;#93;&lt;/span&gt; TypeError: this._db._initExtraInfo is not a function :&lt;br/&gt;
DBQuery.prototype.remove@/Users/toszter/.mongorc.js:444:5&lt;br/&gt;
@(shell):1:1&lt;/p&gt;

&lt;p&gt;Deeper examination reveals no check for _initExtraInfo, as you&apos;d expect:&lt;/p&gt;

&lt;p&gt;mongos&amp;gt; db.analytics.find({timestamp: {$type: 10}}).remove&lt;br/&gt;
function (){&lt;br/&gt;
    for ( var k in this._query ){&lt;br/&gt;
        if ( k == &quot;_id&quot; &amp;amp;&amp;amp; typeof( this._query&lt;span class=&quot;error&quot;&gt;&amp;#91;k&amp;#93;&lt;/span&gt; ) == &quot;undefined&quot; )&lt;/p&gt;
{
            throw &quot;can&apos;t have _id set to undefined in a remove expression&quot;;
        }
&lt;p&gt;    }&lt;/p&gt;

&lt;p&gt;    this._checkMulti();&lt;br/&gt;
    this._db._initExtraInfo();&lt;br/&gt;
    this._mongo.remove( this._ns , this._query , false );&lt;br/&gt;
    this._db._getExtraInfo(&quot;Removed&quot;);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Take note that invoking the command with query in this manner works fine:&lt;/p&gt;

&lt;p&gt;mongos&amp;gt; db.analytics.remove({timestamp: {$type: 10}})&lt;br/&gt;
Removed 26 record(s) in 350ms&lt;br/&gt;
WriteResult(&lt;/p&gt;
{
  &quot;nRemoved&quot;: 26
}
&lt;p&gt;)&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[kelsey.schubert@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrl91j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>