<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:34:28 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-559] Improve server selection error messages for connection and context errors</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-559</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;&lt;b&gt;New Description:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;If there&apos;s a configuration error that prevents any connection handshakes from succeeding (e.g. configuring a Client with no TLS enabled when the server requires TLS connections), all operations will fail with a server selection timeout error. The error message will be something like:&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;server selection error: server selection timeout, current topology: { Type: Unknown, Servers: [{ Addr: localhost:&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;27017&lt;/span&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;, Type: Unknown, State: Connected, Average RTT: &lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;0&lt;/span&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;, Last error: connection() : connection(localhost:&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;27017&lt;/span&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;[-&lt;/span&gt;&lt;span style=&quot;color: #009900; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;10&lt;/span&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;]) incomplete read of message header: EOF },] }&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 error reported from &lt;tt&gt;Last error: ...&lt;/tt&gt; is of type &lt;tt&gt;ConnectionError&lt;/tt&gt; and could be improved. Some ideas:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Add handshaking state to the error message. It&apos;d be useful to know that this failure was during handshaking rather than a regular operation because it clarifies that the connection was never established successfully.&lt;/li&gt;
	&lt;li&gt;The &lt;tt&gt;incomplete read of message header&lt;/tt&gt; signals that the initial 4-byte read from the socket failed. In the case that the read returned (0, io.EOF), this message could be improved to something like &lt;tt&gt;socket was unexpectedly closed&lt;/tt&gt; to indicate that the server hung up the connection.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The previous description mentioned failing fast for TLS errors rather than waiting for server selection to time out. We won&apos;t be doing this because there are edge cases where only a subset of servers are unreachable due to TLS errors and some TLS errors can be transient (e.g. OCSP responses are cached so it&apos;s possible the response changes after the cached version expires) so it&apos;s important that we block for the server selection period and report the full state of all servers in the error message.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Previous Description:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;When there is a TLS error, such as connecting without TLS to a server that requires it or vice-versa, or when connecting with an invalid certificate, the Go driver eventually fails server selection with an error but gives no indication of the reason why.&#160; This is going to cause confusion for users and increase support inquiries.&lt;/p&gt;

&lt;p&gt;As we have no TLS spec, we never actually say anywhere that a TLS error needs to be reported, but it can be implied from both the auth spec (about handshake errors being auth errors, which need to fail fast and be reported with details) and the server selection spec (about reporting &quot;useful&quot; error messages when selection fails).&lt;/p&gt;</description>
                <environment></environment>
        <key id="606106">GODRIVER-559</key>
            <summary>Improve server selection error messages for connection and context errors</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="kriti.ravindran@mongodb.com">Kriti Ravindran</assignee>
                                    <reporter username="david.golden@mongodb.com">David Golden</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Sep 2018 18:47:54 +0000</created>
                <updated>Sat, 28 Oct 2023 11:39:27 +0000</updated>
                            <resolved>Wed, 15 Jul 2020 21:56:03 +0000</resolved>
                                                    <fixVersion>1.5.0</fixVersion>
                                    <component>Error Handling</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3335070" author="xgen-internal-githook" created="Wed, 12 Aug 2020 18:04:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Divjot Arora&apos;, &apos;email&apos;: &apos;divjot.arora@10gen.com&apos;, &apos;username&apos;: &apos;divjotarora&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-559&quot; title=&quot;Improve server selection error messages for connection and context errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-559&quot;&gt;&lt;del&gt;GODRIVER-559&lt;/del&gt;&lt;/a&gt; Increase test timeout (#477)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/669826a9d91345bdbc664a18e233450ed8b8fde9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/669826a9d91345bdbc664a18e233450ed8b8fde9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3287170" author="xgen-internal-githook" created="Wed, 15 Jul 2020 21:54:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kriti Ravindran&apos;, &apos;email&apos;: &apos;kriti.ravindran@mongodb.com&apos;, &apos;username&apos;: &apos;KritiRav&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-559&quot; title=&quot;Improve server selection error messages for connection and context errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-559&quot;&gt;&lt;del&gt;GODRIVER-559&lt;/del&gt;&lt;/a&gt; Add ServerSelectionError type and improve ConnectionError format/messages  (#444)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/3c006f1b6cf926e38993c85ca43913a723193dd8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/3c006f1b6cf926e38993c85ca43913a723193dd8&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="450201">TOOLS-1833</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="778377">TOOLS-2299</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="659146">GODRIVER-733</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2118408">DRIVERS-2421</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>GODRIVER-114</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxdl2f:</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>