<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:10 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-549] Connection string with multiple hosts will not create a valid connection</title>
                <link>https://jira.mongodb.org/browse/CSHARP-549</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;We are unable to create a connection from our web server to our DB server using a connection string in any of the formats below:&lt;/p&gt;

&lt;p&gt;mongodb://XXXUSERXXX:XXXPASSWORDXXX@T02-VM-XXXX01.vss-eng.com,XXXUSERXXX:XXXPASSWORDXXX@T02-VM-XXXX02.vss-eng.com,XXXUSERXXX:XXXPASSWORDXXX@T02-VM-XXXX03.vss-eng.com/NH_DEVICEDATA?replicaSet=NH_Data_01&lt;/p&gt;

&lt;p&gt;mongodb://XXXUSERXXX:XXXPASSWORDXXX@ T02-VM-XXXX01.vss-eng.com:27017, T02-VM-XXXX02.vss-eng.com:27017/NH_DEVICEDATA&lt;br/&gt;
mongodb://XXXUSERXXX:XXXPASSWORDXXX@ T02-VM-XXXX01.vss-eng.com:27017, T02-VM-XXXX02.vss-eng.com:27017/NH_DEVICEDATA?replicaSet=NH_Data_01&lt;/p&gt;


&lt;p&gt;We are trying to connect to a replica set of 3 seperate VM servers and the error we continue to recieve is:&lt;/p&gt;

&lt;p&gt;Type: MongoDB.Driver.MongoConnectionException&lt;br/&gt;
Message: Unable to connect to the primary member of the replica set.&lt;br/&gt;
Source: MongoDB.Driver&lt;br/&gt;
InnerExceptions: System.Exception[]&lt;br/&gt;
StackTrace:    at MongoDB.Driver.Internal.ReplicaSetConnector.Connect(TimeSpan timeout, ConnectWaitFor waitFor)&lt;br/&gt;
   at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout, ConnectWaitFor waitFor)&lt;br/&gt;
   at MongoDB.Driver.MongoServer.ChooseServerInstance(Boolean slaveOk)&lt;br/&gt;
   at MongoDB.Driver.MongoServer.AcquireConnection(MongoDatabase database, Boolean slaveOk)&lt;br/&gt;
   at MongoDB.Driver.MongoCursorEnumerator`1.AcquireConnection()&lt;br/&gt;
   at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst()&lt;br/&gt;
   at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext()&lt;br/&gt;
   at MongoDB.Driver.MongoDatabase.GetCollectionNames()&lt;br/&gt;
   at MongoDB.Driver.MongoDatabase.CollectionExists(String collectionName)&lt;br/&gt;
   at VSS.Nighthawk.EntityModels.Dao.Mongo.MongoStorage`1.SetupCollection(String collectionName, IMongoCollectionOptions collectionOptions, Func`1 runCustomClassMap) in C:\TFS\Nighthawk\NH\RC\2.5.0.3_OEMDF\Server\CommonLibrary\EntityModels\Dao\Mongo\MongoStorage.cs:line 257&lt;br/&gt;
   at VSS.Nighthawk.EntityModels.Dao.Mongo.MongoStorage`1..ctor(IMongoCollectionOptions collectionOptions, Func`1 runCustomClassMap) in C:\TFS\Nighthawk\NH\RC\2.5.0.3_OEMDF\Server\CommonLibrary\EntityModels\Dao\Mongo\MongoStorage.cs:line 32&lt;/p&gt;

&lt;p&gt;We have not modified the 1.5 driver in any way.&lt;/p&gt;

&lt;p&gt;The replica set is correctly set up. The output of the rs.isMaster() command is below:&lt;/p&gt;

&lt;p&gt;PRIMARY&amp;gt; rs.isMaster()&lt;br/&gt;
{&lt;br/&gt;
        &quot;setName&quot; : &quot;NH_Data_01&quot;,&lt;br/&gt;
        &quot;ismaster&quot; : true,&lt;br/&gt;
        &quot;secondary&quot; : false,&lt;br/&gt;
        &quot;hosts&quot; : [&lt;br/&gt;
                &quot;T02-VM-XXXX01:27017&quot;,&lt;br/&gt;
                &quot;T02-VM-XXXX02:27017&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;passives&quot; : [&lt;br/&gt;
                &quot;T02-VM-XXXX03:27017&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;primary&quot; : &quot;T02-VM-XXXX01:27017&quot;,&lt;br/&gt;
        &quot;me&quot; : &quot;T02-VM-XXXX01:27017&quot;,&lt;br/&gt;
        &quot;maxBsonObjectSize&quot; : 16777216,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Please let us know what the issue is with the connection string capability within the Driver.&lt;/p&gt;</description>
                <environment>MongoDB 2.0.2 DB running on CentOs 6.0 connecting from Windows Server 2008 R2 using the C# driver version 1.5</environment>
        <key id="48090">CSHARP-549</key>
            <summary>Connection string with multiple hosts will not create a valid connection</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="erik_holm@trimble.com">Erik Holm</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Aug 2012 21:05:30 +0000</created>
                <updated>Thu, 20 Mar 2014 14:35:02 +0000</updated>
                            <resolved>Mon, 27 Aug 2012 20:07:40 +0000</resolved>
                                    <version>1.5</version>
                                    <fixVersion>1.6</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="157134" author="rstam" created="Mon, 27 Aug 2012 20:07:40 +0000"  >&lt;p&gt;Related issue &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-500&quot; title=&quot;If host names in replica set connection string are aliases of the host names in the replica set config connection fails the first time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-500&quot;&gt;&lt;del&gt;CSHARP-500&lt;/del&gt;&lt;/a&gt; has been resolved and closed.&lt;/p&gt;</comment>
                            <comment id="156588" author="rstam" created="Fri, 24 Aug 2012 21:42:40 +0000"  >&lt;p&gt;See also: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-500&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/CSHARP-500&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="156582" author="rstam" created="Fri, 24 Aug 2012 21:28:41 +0000"  >&lt;p&gt;The first connection string is not valid. The username/password can only appear once.&lt;/p&gt;

&lt;p&gt;The second and third connection strings appear to be syntactically valid (assuming the spaces I see are copy and paste artifacts, if not remove the spaces).&lt;/p&gt;

&lt;p&gt;It appears that there is a mismatch between the names of the hosts on the connection string and the replica set config. That could be the issue. Try making them the same.&lt;/p&gt;

&lt;p&gt;T02-VM-XXXX01.vss-eng.com vs T02-VM-XXXX01:27017&lt;/p&gt;

&lt;p&gt;Let me know if that helps.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="41439">CSHARP-500</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrh77b:</customfieldvalue>

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