<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:54:49 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>[JAVA-1522] Replicaset Secondaries crashed on replica. The _id field cannot be changed from {_id: ObjectId(&apos;54419460e4b027b78ea3f929&apos;)} to {_id: null}</title>
                <link>https://jira.mongodb.org/browse/JAVA-1522</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;My both secondaries in the replica crashed with the following message:&lt;/p&gt;

&lt;p&gt;Looks like the replica is trying to change the ObjectId of an entity to null. How is that possible?&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;[repl writer worker 7] ERROR: writer worker caught exception:  :: caused by :: 16836 The _id field cannot be changed from {_id: ObjectId(&apos;54419460e4b027b78ea3f929&apos;)} to {_id: null}. on: { ts: Timestamp 1413583968000|9, h: -4495067277291860919, v: 2, op: &quot;i&quot;, ns: &quot;P_4b2f27df-97b7-4556-bbcf-08d0e153782a.statistics&quot;, o: { _id: ObjectId(&apos;54419460e4b027b78ea3f929&apos;), _acl: { owner: &quot;5441939fe4b027b78ea3f90e&quot;, mode: 0 }, mn: 0, uid: &quot;5441939fe4b027b78ea3f90e&quot;, ln: 0, hs: 9, d: &quot;20141017221248&quot;, rm: 1, ls: &quot;156&quot;, hv: &quot;1.3.3&quot;, c: {}, ms: 4, vn: 0, h: 1000, trs: 24, _id: null, om: [ &quot;544193c5e4b0e3604e126b29&quot; ], hsr: 24, dn: 0, hsm: 0 } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</description>
                <environment></environment>
        <key id="164327">JAVA-1522</key>
            <summary>Replicaset Secondaries crashed on replica. The _id field cannot be changed from {_id: ObjectId(&apos;54419460e4b027b78ea3f929&apos;)} to {_id: null}</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="5">Cannot Reproduce</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="axaubet">Alberto Xaubet</reporter>
                        <labels>
                    </labels>
                <created>Sat, 18 Oct 2014 07:54:50 +0000</created>
                <updated>Tue, 23 Jun 2015 02:28:27 +0000</updated>
                            <resolved>Tue, 23 Jun 2015 02:28:27 +0000</resolved>
                                                                    <component>Codecs</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="947682" author="jeff.yemin" created="Tue, 23 Jun 2015 02:28:27 +0000"  >&lt;p&gt;Closing as unreproducible, but please re-open if you have a reproducible test case.&lt;/p&gt;</comment>
                            <comment id="750365" author="jeff.yemin" created="Tue, 28 Oct 2014 14:37:01 +0000"  >&lt;p&gt;Hi Alberto, &lt;/p&gt;

&lt;p&gt;I moved this issue SERVER to JAVA since the problem is more related to the Java driver.&lt;/p&gt;

&lt;p&gt;Can you provide sample code showing the driver returning a Map instead of an ObjectId as the value of _id? &lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Jeff&lt;/p&gt;</comment>
                            <comment id="750333" author="axaubet" created="Tue, 28 Oct 2014 14:19:28 +0000"  >&lt;p&gt;After downgrading the java driver the problem is happening any more. &lt;/p&gt;

&lt;p&gt;the main difference i noticed between the drivers is that &lt;/p&gt;

&lt;p&gt;when retrieving the _id from BasicDBObject in driver version 2.9.3 i&apos;m getting a Map and in last driver i&apos;m getting a ObjectId.&lt;/p&gt;

&lt;p&gt;I haven&apos;t been able to test the problem again in a test environment is not easy to setup everything like production.&lt;/p&gt;</comment>
                            <comment id="748553" author="asya" created="Fri, 24 Oct 2014 17:24:43 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=axaubet&quot; class=&quot;user-hover&quot; rel=&quot;axaubet&quot;&gt;axaubet&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Just wanted to check in with you - have you seen the problem recur since you downgraded the driver?&lt;/p&gt;

&lt;p&gt;Also, did you ever get a chance to run the two queries in mongo shell on the primary of the affected replica set or set up a test environment with versions that triggered this occurrence?&lt;/p&gt;

&lt;p&gt;Asya&lt;/p&gt;
</comment>
                            <comment id="745146" author="asya" created="Mon, 20 Oct 2014 13:50:24 +0000"  >&lt;p&gt;Thank you &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=axaubet&quot; class=&quot;user-hover&quot; rel=&quot;axaubet&quot;&gt;axaubet&lt;/a&gt;, I will set this ticket  to waiting for user input till then, since I haven&apos;t been able to reproduce this locally.&lt;/p&gt;

&lt;p&gt;Even though you rolled back the driver, it would still help to get the results of queries I provided from one of the replica set members, if possible.&lt;/p&gt;

&lt;p&gt;Asya&lt;/p&gt;</comment>
                            <comment id="745091" author="axaubet" created="Mon, 20 Oct 2014 12:56:34 +0000"  >&lt;p&gt;As is production environment, i have rolled back the MongoDB driver to 2.9.3  (I&apos;m not sure if the problem comes from the new driver) . I don&apos;t expect the issue will happen again in production (we had this setup for a long time without problems). &lt;/p&gt;

&lt;p&gt;I&apos;m going to setup a new staging environment and try to reproduce this situation with more log lvl enabled.&lt;/p&gt;</comment>
                            <comment id="744840" author="asya" created="Sun, 19 Oct 2014 15:19:00 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=axaubet&quot; class=&quot;user-hover&quot; rel=&quot;axaubet&quot;&gt;axaubet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for the logs.  Would it be possible to give mongod  one primary and secondaries an option to increasing log level?   You can so do with:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.adminCommand({setParameter:1, logLevel:1})&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;This will put more details about what happens into the logs.&lt;/p&gt;

&lt;p&gt;In addition, could you run the following commands on the primary:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.getSiblingDB(&quot;P_4b2f27df-97b7-4556-bbcf-08d0e153782a&quot;).getCollection(&quot;statistics&quot;).findOne({_id:ObjectId(&apos;544331fbe4b040efd6b43231&apos;)})&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.getSiblingDB(&quot;local&quot;).getCollection(&quot;oplog.rs&quot;).find( {$or:[ { &quot;o&quot;: ObjectId(&apos;544331fbe4b040efd6b43231&apos;) },  { &quot;o2&quot;: ObjectId(&apos;544331fbe4b040efd6b43231&apos;) } ] })&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;I&apos;d like to see what the document looks like and what operations were performed on it that the format of oplog to the secondary would look this way.&lt;/p&gt;

&lt;p&gt;Asya&lt;/p&gt;</comment>
                            <comment id="744829" author="axaubet" created="Sun, 19 Oct 2014 10:27:40 +0000"  >&lt;p&gt;I&apos;m using Jongo to store entities so i cannot provide the java code that insert as it only stores a Basic entity using Jongo. Maybe the test is to use Jongo to try to update an entity setting and _id value to null.&lt;/p&gt;

&lt;p&gt;Jongo version was 1.1&lt;/p&gt;

&lt;p&gt;I have attached the logs of a different moment to the issue but  with the same error and crash.&lt;/p&gt;

&lt;p&gt;As you can see primary doesn&apos;t report any problem. But automatically the secondaries crashed due to this oplog operation that cannot be processed.&lt;/p&gt;</comment>
                            <comment id="744824" author="asya" created="Sun, 19 Oct 2014 08:22:32 +0000"  >&lt;p&gt;Also, could you provide the Java code snippet that inserts the document into &quot;P_4b2f27df-97b7-4556-bbcf-08d0e153782a.statistics&quot; collection?&lt;/p&gt;
</comment>
                            <comment id="744823" author="asya" created="Sun, 19 Oct 2014 08:20:12 +0000"  >&lt;p&gt;Could you attach or include a larger section of the log leading up to the error message?&lt;/p&gt;

&lt;p&gt;Does the primary have any error when the operation is run?&lt;/p&gt;</comment>
                            <comment id="744822" author="axaubet" created="Sun, 19 Oct 2014 06:09:19 +0000"  >&lt;p&gt;I have more information about this bug. Started happening after upgrading java driver to 2.12.4 before this version i was using 2.9.3&lt;/p&gt;</comment>
                            <comment id="744733" author="axaubet" created="Sat, 18 Oct 2014 08:26:49 +0000"  >&lt;p&gt;I have checked the related entity on the primary node and obviously the entity exist with an objected not null. If the code has tried this operation of setting a null on the _id i understand that this operation is going to fail in the primary and should never be passed to the replicas or at least replicas mongos process should not die.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="54880" name="primary_log.txt" size="4385" author="axaubet" created="Sun, 19 Oct 2014 10:29:05 +0000"/>
                            <attachment id="54879" name="secondary_log.txt" size="19212" author="axaubet" created="Sun, 19 Oct 2014 10:28:47 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hs36g7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>143376</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>