<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:38:44 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>[GODRIVER-2489] Return error if createPipelineOptionsDoc failed in executeOperation</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2489</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;

&lt;p&gt;ChangeStream::createPipelineOptionsDoc() may return nil and set cs.err if failed.&lt;/p&gt;

&lt;p&gt;But the caller ChangeStream::executeOperation() does not handle cs.err != nil condition or nil return.&lt;/p&gt;

&lt;p&gt;This may lead to broken $changeStream BSON command, and then get an error from mongo server : &quot;invalid bson type in element with field name &apos;rsor&apos; in object with unknown _id&#160;&quot;&lt;/p&gt;

&lt;p&gt;My develop environment is go-driver v1.6.0, and I comfirmed this bug in v1.9.1 and&#160; master.&lt;/p&gt;

&lt;p&gt;My MongoDB server version is MongoDB 4.0&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;HowtoReproduce&quot;&gt;&lt;/a&gt;How to Reproduce&lt;/h4&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;em&gt;New a Collection with user-defined bson.registry in a golang project, but the user-defined bson.registry has some bugs to cause transformBsoncoreDocument() failure (Maybe there are other cases to cause this failure)&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;&lt;em&gt;Watch a collection in golang project, and restart MongoDB server to trigger change stream resume&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;The bson.registry bugs lead to transformBsoncoreDocument() failure in ChangeStream::createPipelineOptionsDoc(), and return nil after set cs.err (Maybe there are other cases that lead to &#160;transformBsoncoreDocument() failure)&lt;/li&gt;
	&lt;li&gt;ChangeStream::executeOperation() ignores the cs.err, and continue to build a broken pipeline BSON&lt;/li&gt;
	&lt;li&gt;The broken pipeline BSON command is sent to MongoDB Server, and get &quot;invalid bson&quot; response&lt;/li&gt;
&lt;/ol&gt;


&lt;h4&gt;&lt;a name=&quot;AdditionalBackground&quot;&gt;&lt;/a&gt;Additional Background&lt;/h4&gt;

&lt;p&gt;ChangeStream::createPipelineOptionsDoc() error is already handled in ChangeStream::buildPipelineSlice(), see:&#160; &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/v1.9.1/mongo/change_stream.go#L366-L369&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/blob/v1.9.1/mongo/change_stream.go#L366-L369&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But ChangeStream::executeOperation() don&apos;t, see:&#160; &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/v1.9.1/mongo/change_stream.go#L249&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/blob/v1.9.1/mongo/change_stream.go#L249&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2088241">GODRIVER-2489</key>
            <summary>Return error if createPipelineOptionsDoc failed in executeOperation</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="13201">Fixed</resolution>
                                        <assignee username="preston.vasquez@mongodb.com">Preston Vasquez</assignee>
                                    <reporter username="pengzhenyi">peng zhenyi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jul 2022 07:18:23 +0000</created>
                <updated>Sat, 28 Oct 2023 11:37:32 +0000</updated>
                            <resolved>Thu, 20 Oct 2022 17:59:57 +0000</resolved>
                                    <version>1.6.0</version>
                    <version>1.9.1</version>
                                    <fixVersion>1.10.1</fixVersion>
                                    <component>Aggregation</component>
                    <component>Change Streams</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="4722984" author="xgen-internal-githook" created="Tue, 2 Aug 2022 18:34:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Preston Vasquez&apos;, &apos;email&apos;: &apos;prestonvasquez@icloud.com&apos;, &apos;username&apos;: &apos;prestonvasquez&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2489&quot; title=&quot;Return error if createPipelineOptionsDoc failed in executeOperation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2489&quot;&gt;&lt;del&gt;GODRIVER-2489&lt;/del&gt;&lt;/a&gt; createPipelineOptionsDoc: return err (#1036)&lt;br/&gt;
Branch: release/1.10&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/06579a7711952e6518299e57a77bdb5ebedf6586&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/06579a7711952e6518299e57a77bdb5ebedf6586&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4719811" author="xgen-internal-githook" created="Mon, 1 Aug 2022 22:25:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Preston Vasquez&apos;, &apos;email&apos;: &apos;prestonvasquez@icloud.com&apos;, &apos;username&apos;: &apos;prestonvasquez&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2489&quot; title=&quot;Return error if createPipelineOptionsDoc failed in executeOperation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2489&quot;&gt;&lt;del&gt;GODRIVER-2489&lt;/del&gt;&lt;/a&gt; Return error if createPipelineOptionsDoc() fails (#1035)&lt;/p&gt;

&lt;p&gt;Co-authored-by: Preston Vasquez &amp;lt;prestonvasquez@icloud.com&amp;gt;&lt;br/&gt;
Co-authored-by: pengzhenyi &amp;lt;503282373@qq.com&amp;gt;&lt;br/&gt;
Co-authored-by: Benjamin Rewis &amp;lt;32186188+benjirewis@users.noreply.github.com&amp;gt;&lt;br/&gt;
Branch: release/1.10&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/51ecabd07f0fba6a4bb6a40b4a5430cc0aa27db3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/51ecabd07f0fba6a4bb6a40b4a5430cc0aa27db3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4683471" author="esha.bhargava" created="Fri, 15 Jul 2022 20:52:33 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=pengzhenyi&quot; class=&quot;user-hover&quot; rel=&quot;pengzhenyi&quot;&gt;pengzhenyi&lt;/a&gt; Thank you for reporting this issue. We&apos;ll look into it and get back to you.&lt;/p&gt;</comment>
                            <comment id="4672733" author="pengzhenyi" created="Tue, 12 Jul 2022 07:38:59 +0000"  >&lt;p&gt;The error should be handled in go-driver.&lt;/p&gt;

&lt;p&gt;So I create a PullRequest: &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/1020&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/pull/1020&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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|i0ksi0:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>