<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:10:09 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>[CDRIVER-644] bson_error_t&apos;s &quot;code&quot; is often wrong</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-644</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The mongoc_error_code_t enum does not agree with the server&apos;s error codes. For example, recent servers return error code 13 if a command is unauthorized, but 13 means MONGOC_ERROR_CLIENT_IN_EXHAUST in the enum. MONGOC_ERROR_CLIENT_AUTHENTICATE, on the other hand, is 11 in the enum. Nevertheless, when a command fails on the server the driver sets the bson_error_t&apos;s code to the server error code, as if the enum values and the server&apos;s values were related. Applications comparing a bson_error_t&apos;s &quot;code&quot; field to the enum values are often misinformed about the cause of the error.&lt;/p&gt;

&lt;p&gt;The enum and bson_error_t can&apos;t work as designed &amp;#8211; the client and server can&apos;t share that list of codes, because they don&apos;t agree now and can&apos;t be made to agree in the future. I need to investigate if there is a simple upgrade path, or if I just need to document the problem now and wait for version 2.0 for a true fix.&lt;/p&gt;</description>
                <environment></environment>
        <key id="203496">CDRIVER-644</key>
            <summary>bson_error_t&apos;s &quot;code&quot; is often wrong</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="jesse@mongodb.com">A. Jesse Jiryu Davis</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 May 2015 02:01:24 +0000</created>
                <updated>Mon, 8 Jan 2024 15:30:32 +0000</updated>
                            <resolved>Mon, 4 Apr 2016 17:20:43 +0000</resolved>
                                                    <fixVersion>1.4.0</fixVersion>
                                    <component>errors</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1376159" author="xgen-internal-githook" created="Fri, 2 Sep 2016 23:27:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-644&quot; title=&quot;bson_error_t&amp;#39;s &amp;quot;code&amp;quot; is often wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-644&quot;&gt;&lt;del&gt;CDRIVER-644&lt;/del&gt;&lt;/a&gt; prevent setting Error API version twice&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/404f4ef537b4e553f0d905172358fdc27353e18e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/404f4ef537b4e553f0d905172358fdc27353e18e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1225374" author="xgen-internal-githook" created="Mon, 4 Apr 2016 21:32:16 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-644&quot; title=&quot;bson_error_t&amp;#39;s &amp;quot;code&amp;quot; is often wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-644&quot;&gt;&lt;del&gt;CDRIVER-644&lt;/del&gt;&lt;/a&gt; no file mongoc-error.c&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/3f078e42f6fedbcc4f6efe33df99bc7e348b9d0c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/3f078e42f6fedbcc4f6efe33df99bc7e348b9d0c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1224558" author="xgen-internal-githook" created="Mon, 4 Apr 2016 17:20:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-644&quot; title=&quot;bson_error_t&amp;#39;s &amp;quot;code&amp;quot; is often wrong&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-644&quot;&gt;&lt;del&gt;CDRIVER-644&lt;/del&gt;&lt;/a&gt; new error API&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/d45c768682634ab7779bbde9695fef925fa49383&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/d45c768682634ab7779bbde9695fef925fa49383&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1158426" author="jesse" created="Fri, 29 Jan 2016 21:19:23 +0000"  >&lt;p&gt;Current server error codes are here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.err&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.err&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There might be a handful, like duplicate key error, for which applications commonly have specialized error-handling logic. Those are well-known error codes have been stable in the server for many years, so we can make client-side error codes for those in the MONGOC_ERROR_SERVER domain.&lt;/p&gt;

&lt;p&gt;We have to come up with a list of those codes, and maybe agree on a drivers spec for the list.&lt;/p&gt;</comment>
                            <comment id="1156933" author="jesse" created="Thu, 28 Jan 2016 18:36:55 +0000"  >&lt;p&gt;The root problem is that errors with QUERY or COMMAND domains, perhaps other domains as well, include error codes that might be client error codes or server error codes. There&apos;s no way to know for sure, but the meanings of the two sets of codes are different, so there isn&apos;t a clear way to diagnose an error based on its code.&lt;/p&gt;

&lt;p&gt;We&apos;ll go with a solution proposed by &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mira.carey%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;mira.carey@mongodb.com&quot;&gt;mira.carey@mongodb.com&lt;/a&gt;. Two new functions:&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;void mongoc_client_pool_set_error_api (mongoc_client_pool_t *, int32_t version);&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;   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;void mongoc_client_set_error_api (mongoc_client_t *, int32_t version);&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;The default error API version is 1, the current broken behavior.&lt;/p&gt;

&lt;p&gt;Set the version to 2 and all server errors are now reported in a new domain, &lt;tt&gt;MONGOC_ERROR_SERVER&lt;/tt&gt;. These errors have no meaning in the driver, they are simply the number returned by the server.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="211198">CDRIVER-709</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="204735">CDRIVER-662</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="246541">CXX-808</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="202345">PHPC-292</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="213599">CDRIVER-728</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="274554">CDRIVER-1172</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="166257">CDRIVER-449</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="305057">CDRIVER-1434</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="261469">CXX-834</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10012"><![CDATA[Major Change]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrdekv:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="918">C Driver 2016 sprint 3</customfieldvalue>
    <customfieldvalue id="959">C Driver 2016 sprint 4</customfieldvalue>

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