<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:44:00 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>[CSHARP-2968] Exception occurs when using mongodb+srv connection string</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2968</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Our C# applications have been quite happily connecting to various MongoDB Atlas clusters using the SRV connection string for roughly a year now. Since the start of this month, (and about 2 weeks after we upgraded to .NET Core 3.1), we started getting an error with the MongoDB connection &apos;Record reader index out of sync.&apos;&lt;br/&gt;
&#160;&lt;br/&gt;
Looking into it a bit further, it appears that the problem manifests in in the DnsClient package (v1.2.0). It seems to work just fine on my windows machine, on my linux boxes, but not within my AKS environment.&lt;br/&gt;
Suspiciously, Microsoft have recently started rolling out a change to CoreDNS (&#160;&lt;a href=&quot;https://github.com/Azure/AKS/blob/master/CHANGELOG.md&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/Azure/AKS/blob/master/CHANGELOG.md&lt;/a&gt;&#160;)&lt;br/&gt;
&#160;&lt;br/&gt;
Spoke to Mary Gorman at support and tested this out on an M10 instance, same results and have the logs attached (though I suspect the problem is within AKS and nothing to do with the database itself).&lt;br/&gt;
&#160;&lt;br/&gt;
This can be recreated using .NET Core 3.1 and a reference to the DnsClient package and the following code running in a .NET Core 3.1 Alpine container within AKS:&lt;br/&gt;
&#160;&lt;br/&gt;
````&lt;br/&gt;
class Program&lt;br/&gt;
 {&lt;br/&gt;
 static void Main(string[] args)&lt;br/&gt;
 {&lt;br/&gt;
 try&lt;br/&gt;
 &lt;/p&gt;
{
 LookupClient client = new LookupClient();
 IDnsQueryResponse result = client.Query(&quot;_mongodb._tcp.clusterm10-u06qs.mongodb.net&quot;, QueryType.SRV);
 Console.WriteLine($&quot;Error: \{result.HasError}
&lt;p&gt;&quot;);&lt;/p&gt;

&lt;p&gt;foreach (DnsResourceRecord dnsResourceRecord in result.AllRecords) &lt;br/&gt;
 Console.WriteLine(dnsResourceRecord.ToString());&lt;br/&gt;
 }&lt;br/&gt;
 catch (Exception e)&lt;/p&gt;
 {
 Console.WriteLine(e);
 }

&lt;p&gt;Console.ReadLine();&lt;br/&gt;
 }&lt;br/&gt;
 }&lt;/p&gt;

&lt;p&gt;````&lt;/p&gt;

&lt;p&gt;Replace the mongoDB host for a valid cluster if the one supplied is no longer there - this happens on the free tier and M10 lookups.&lt;/p&gt;

&lt;p&gt;You will end up with an error that looks like this:&lt;/p&gt;

&lt;p&gt;````&lt;/p&gt;

&lt;p&gt;DnsClient.DnsResponseException: Unhandled exception&lt;br/&gt;
 ---&amp;gt; System.InvalidOperationException: Record reader index out of sync.&lt;br/&gt;
 at DnsClient.DnsRecordFactory.GetRecord(ResourceRecordInfo info) in C:\Users\jason\Source\Repos\DnsClientTest\DnsClientTest\Src\DnsRecordFactory.cs:line 181&lt;br/&gt;
 at DnsClient.DnsMessageHandler.GetResponseMessage(ArraySegment`1 responseData) in C:\Users\jason\Source\Repos\DnsClientTest\DnsClientTest\Src\DnsMessageHandler.cs:line 114&lt;br/&gt;
 at DnsClient.DnsUdpMessageHandler.Query(IPEndPoint server, DnsRequestMessage request, TimeSpan timeout) in C:\Users\jason\Source\Repos\DnsClientTest\DnsClientTest\Src\DnsUdpMessageHandler.cs:line 66&lt;br/&gt;
 at DnsClient.LookupClient.ResolveQuery(IReadOnlyCollection`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit continueAudit) in C:\Users\jason\Source\Repos\DnsClientTest\DnsClientTest\Src\LookupClient.cs:line 724&lt;br/&gt;
 &amp;#8212; End of inner exception stack trace &amp;#8212;&lt;br/&gt;
 at DnsClient.LookupClient.ResolveQuery(IReadOnlyCollection`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit continueAudit) in C:\Users\jason\Source\Repos\DnsClientTest\DnsClientTest\Src\LookupClient.cs:line 835&lt;br/&gt;
 at DnsClient.LookupClient.QueryInternal(DnsQuestion question, DnsQuerySettings settings, IReadOnlyCollection`1 useServers) in C:\Users\jason\Source\Repos\DnsClientTest\DnsClientTest\Src\LookupClient.cs:line 650&lt;br/&gt;
 at DnsClient.LookupClient.Query(String query, QueryType queryType, QueryClass queryClass, DnsQueryOptions queryOptions) in C:\Users\jason\Source\Repos\DnsClientTest\DnsClientTest\Src\LookupClient.cs:line 401&lt;br/&gt;
 at DnsClientTest.Program.Main(String[] args) in C:\Users\jason\Source\Repos\DnsClientTest\DnsClientTest\Program.cs:line 15&lt;/p&gt;

&lt;p&gt;````&lt;/p&gt;

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

&lt;p&gt;Please note, that this error only occurs within AKS! It does not seem to manifest on a Windows 10 machine, or on a Linux box outside of AKS.&lt;/p&gt;

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

&lt;p&gt;This has been cross reported here:&#160;&lt;a href=&quot;https://github.com/MichaCo/DnsClient.NET/issues/51&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/MichaCo/DnsClient.NET/issues/51&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;I can obviously get round this issue by not using seedless connection strings (non SRV connection strings), but SRV connection strings are far preferable from a maintainability point of view.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>AKS (Linux) - Server version v1.14.8</environment>
        <key id="1149269">CSHARP-2968</key>
            <summary>Exception occurs when using mongodb+srv connection string</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="dmitry.lukyanov@mongodb.com">Dmitry Lukyanov</assignee>
                                    <reporter username="jason.jhuboo@asm.org.uk">Jason Jhuboo</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Feb 2020 10:37:21 +0000</created>
                <updated>Sat, 28 Oct 2023 11:48:22 +0000</updated>
                            <resolved>Mon, 6 Apr 2020 13:14:44 +0000</resolved>
                                    <version>2.10.1</version>
                                    <fixVersion>2.10.3</fixVersion>
                                    <component>Connectivity</component>
                    <component>Error Handling</component>
                                        <votes>2</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="3025074" author="xgen-internal-githook" created="Fri, 3 Apr 2020 14:38:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;DmitryLukyanov&apos;, &apos;email&apos;: &apos;dmitry.lukyanov@mongodb.com&apos;, &apos;username&apos;: &apos;DmitryLukyanov&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2968&quot; title=&quot;Exception occurs when using mongodb+srv connection string&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2968&quot;&gt;&lt;del&gt;CSHARP-2968&lt;/del&gt;&lt;/a&gt;: Exception occurs when using seedless connection string in AKS.&lt;br/&gt;
Branch: v2.10.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/067940db605ff769297407bbad48f9ace10bc441&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/067940db605ff769297407bbad48f9ace10bc441&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3024863" author="xgen-internal-githook" created="Fri, 3 Apr 2020 13:24:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;DmitryLukyanov&apos;, &apos;email&apos;: &apos;dmitry.lukyanov@mongodb.com&apos;, &apos;username&apos;: &apos;DmitryLukyanov&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2968&quot; title=&quot;Exception occurs when using mongodb+srv connection string&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2968&quot;&gt;&lt;del&gt;CSHARP-2968&lt;/del&gt;&lt;/a&gt;: Exception occurs when using seedless connection string in AKS.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/dc3849cf52f190c0e48479a3cbba32ed78d18f4c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/dc3849cf52f190c0e48479a3cbba32ed78d18f4c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3023273" author="dmitry.lukyanov" created="Thu, 2 Apr 2020 15:08:41 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=fernanda.palomino&quot; class=&quot;user-hover&quot; rel=&quot;fernanda.palomino&quot;&gt;fernanda.palomino&lt;/a&gt;, it will be fixed in the next patch release.&lt;/p&gt;</comment>
                            <comment id="3022841" author="jason.jhuboo@asm.org.uk" created="Thu, 2 Apr 2020 11:41:46 +0000"  >&lt;p&gt;@Fermanda Palmino - I think that you don&apos;t need to wait for a new driver release - your customers can just reference the latest DnsClient package (&amp;gt;=1.3.0)&#160; which will supersede the version referenced by the MongoDB C# NuGET package. This package contains the fix, and the MongoDB NuGet package just requires &amp;gt;=1.2.0 if the DnsClient package, soooo it should just work &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;&lt;/p&gt;

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

&lt;p&gt;I think v1.3.1 of the package is out now.&lt;/p&gt;</comment>
                            <comment id="3022835" author="fernanda.palomino" created="Thu, 2 Apr 2020 11:29:56 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dmitry.lukyanov&quot; class=&quot;user-hover&quot; rel=&quot;dmitry.lukyanov&quot;&gt;dmitry.lukyanov&lt;/a&gt; a couple of customers are having issues when using SRV conn string from their apps on .net C#. Do we know in which version this bug will be fixed so we can update those customers? Thanks!&lt;/p&gt;</comment>
                            <comment id="2969584" author="kletterer@web.de" created="Thu, 12 Mar 2020 01:51:52 +0000"  >&lt;p&gt;There are also a couple of duplicate issues here. At least I&apos;m pretty sure its the same bug in DnsClient 1.2.0 which will be resolved in 1.3.0:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2968&quot; title=&quot;Exception occurs when using mongodb+srv connection string&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2968&quot;&gt;&lt;del&gt;CSHARP-2968&lt;/del&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2957&quot; title=&quot;Connection error due to DNS failed lookup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2957&quot;&gt;&lt;del&gt;CSHARP-2957&lt;/del&gt;&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2852&quot; title=&quot;DnsClient.DnsResponseException: Unhandled exception when using mongodb+srv://&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-2852&quot;&gt;&lt;del&gt;CSHARP-2852&lt;/del&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2966977" author="kletterer@web.de" created="Wed, 11 Mar 2020 16:01:35 +0000"  >&lt;p&gt;Hi (author of DnsClient here),&lt;/p&gt;

&lt;p&gt;I&apos;m not sure if that&apos;s the best way of communicating this but yes, version 1.2.0 has a bug which causes issues right not in AKS which apparently started sending more information then the library expected.&lt;/p&gt;

&lt;p&gt;This bug seems to be fixed in version 1.3.0. I&apos;m currently in the process of finalizing the release by testing it more and verifying that the bug is fixed.&lt;/p&gt;

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

&lt;p&gt;Sorry for any inconveniences,&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
M&lt;/p&gt;</comment>
                            <comment id="2953005" author="jason.jhuboo@asm.org.uk" created="Mon, 9 Mar 2020 10:52:18 +0000"  >&lt;p&gt;Please see&#160;&lt;a href=&quot;https://github.com/MichaCo/DnsClient.NET/issues/51&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/MichaCo/DnsClient.NET/issues/51&lt;/a&gt;&#160;- it looks like the problem has been identified and a fix is going to be added to v1.3.0 of the DncClient.NET package&lt;/p&gt;</comment>
                            <comment id="2923773" author="mohothadura@gmail.com" created="Mon, 2 Mar 2020 20:41:03 +0000"  >&lt;p&gt;Look like this is not only happening on AKS , but in plain Docker instance created based on .net core 3.1&#160; image gives the same error&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="998862">CSHARP-2852</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1176071">CSHARP-2977</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="697203">CSHARP-2518</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="247720" name="clusterm10-shard-00-00-u06qs.mongodb.net_2020-02-13T00_00_00_2020-02-14T00_00_00_mongodb.log" size="103713" author="jason.jhuboo@asm.org.uk" created="Fri, 14 Feb 2020 10:35:03 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000loNfRQAU, 5002K00000gfDXFQA2, 5002K00000gf13oQAA]]]></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|hr7q1r:</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>