<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:41 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-738] Unable to connect to the server { }:27017</title>
                <link>https://jira.mongodb.org/browse/CSHARP-738</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I am getting this issue with latest C# driver version 1.8.1 frequently while I run even simple query  on a large collection.&lt;/p&gt;

&lt;p&gt;However this does not generate in all cases and it works sometimes but fails sometimes which is really frustrating.&lt;/p&gt;

&lt;p&gt;The mongo server is on Amazon Ec2 ubuntu instance and .net app is on another EC2 server.&lt;/p&gt;


&lt;p&gt;Tried Sevres fixes like connectiontimeout,sockettimeout etc but not able to fix this.&lt;/p&gt;

&lt;p&gt;Unable to connect to the server ec2-143-39-225-37.us-west-1.compute.amazonaws.com:27017.&lt;br/&gt;
   at MongoDB.Driver.Internal.DirectMongoServerProxy.ChooseServerInstance(ReadPreference readPreference) in c:\projects\mongo-csharp-driver\MongoDB.Driver\Communication\Proxies\DirectMongoServerProxy.cs:line 115&lt;br/&gt;
   at MongoDB.Driver.MongoServer.AcquireConnection(ReadPreference readPreference) in c:\projects\mongo-csharp-driver\MongoDB.Driver\MongoServer.cs:line 935&lt;br/&gt;
   at MongoDB.Driver.MongoCollection.Update(IMongoQuery query, IMongoUpdate update, MongoUpdateOptions options) in c:\projects\mongo-csharp-driver\MongoDB.Driver\MongoCollection.cs:line 1589&lt;/p&gt;


&lt;p&gt;Please help asap.&lt;/p&gt;</description>
                <environment></environment>
        <key id="73752">CSHARP-738</key>
            <summary>Unable to connect to the server { }:27017</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</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="craig.wilson@mongodb.com">Craig Wilson</assignee>
                                    <reporter username="deepharman">Harman</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 May 2013 12:19:35 +0000</created>
                <updated>Thu, 20 Mar 2014 14:36:58 +0000</updated>
                            <resolved>Thu, 13 Jun 2013 19:37:37 +0000</resolved>
                                    <version>1.8.1</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="337208" author="craiggwilson" created="Thu, 16 May 2013 16:03:07 +0000"  >&lt;p&gt;Harman,&lt;br/&gt;
  Thanks.  This all seems fine, so some more things I&apos;d like to have from you.  During the times when you are experiencing these errors, I&apos;d like to have the log files from all the nodes in your replica set.  You can just upload them here.  They don&apos;t need to be the full logs, just the ranges a little before the errors start to a little after they stop.&lt;/p&gt;</comment>
                            <comment id="337146" author="deepharman" created="Thu, 16 May 2013 14:56:26 +0000"  >&lt;p&gt;Hi Craig Wilson &lt;/p&gt;

&lt;p&gt;I am using following code &lt;br/&gt;
Shape data = null;&lt;br/&gt;
MongoDatabase dbserver = null;&lt;br/&gt;
try&lt;br/&gt;
{&lt;br/&gt;
                dbserver = ConnectionManager.GetMongoConnection();&lt;br/&gt;
                var query = Query.EQ(&quot;ShapeID&quot;, shapeid);&lt;br/&gt;
                data = dbserver.GetCollection&amp;lt;Shape&amp;gt;(&quot;shapes&quot;).FindOne(query);&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;GetMongoConnection method&lt;/p&gt;

&lt;p&gt;      public static MongoDatabase GetMongoConnection()&lt;/p&gt;
        {
            MongoServer mongo = new MongoClient(System.Configuration.ConfigurationManager.AppSettings[&quot;MongoServer&quot;]).GetServer();
            return mongo.GetDatabase(System.Configuration.ConfigurationManager.AppSettings[&quot;MongoDB&quot;]);
        }



&lt;p&gt;I am not using disconnect in my code.&lt;br/&gt;
Thanks...&lt;/p&gt;</comment>
                            <comment id="337087" author="craiggwilson" created="Thu, 16 May 2013 13:55:09 +0000"  >&lt;p&gt;Harman,&lt;br/&gt;
  Could you please post some code related to how you are: &lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Creating a MongoClient&lt;/li&gt;
	&lt;li&gt;Querying and Updating the database.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Most importantly, are you ever calling Disconnect() in your code? Calling Disconnect from within your code can manifest itself as errors exactly like the ones you are describing.&lt;/p&gt;

&lt;p&gt;Thanks...&lt;/p&gt;</comment>
                            <comment id="336889" author="deepharman" created="Thu, 16 May 2013 06:22:04 +0000"  >&lt;p&gt;Hi @Robert Stam,&lt;/p&gt;

&lt;p&gt;I did not changed the or updated driver file.I just used  C# version 1.8.1 official mongo driver from &lt;a href=&quot;http://driver-downloads.mongodb.org/dotnet/index.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://driver-downloads.mongodb.org/dotnet/index.html&lt;/a&gt;.&lt;br/&gt;
Stack trace 1 is the more serious and frequent problem than Stack trace2.&lt;/p&gt;</comment>
                            <comment id="331296" author="rstam" created="Wed, 8 May 2013 18:42:08 +0000"  >&lt;p&gt;Stack trace 2 seems impossible because line 115 of DirectMongoServerProxy.cs is not a throw statement.&lt;/p&gt;

&lt;p&gt;Are you building the driver yourself? Is it possible you have modified this file slightly so that the line numbers no longer match?&lt;/p&gt;</comment>
                            <comment id="328651" author="deepharman" created="Sun, 5 May 2013 06:07:36 +0000"  >&lt;p&gt;Hi @Robert Stam,&lt;/p&gt;

&lt;p&gt;yes stack trace is complete.Point 2 has same stack trace but with delete operation.&lt;/p&gt;


&lt;p&gt;I am getting two issues mainly.Issue 1 is mainly occurring too often.&lt;/p&gt;

&lt;p&gt;1)Server instance ec2-132-112-112-150.us-west-1.compute.amazonaws.com:27017 is no longer connected.&lt;/p&gt;

&lt;p&gt;Stack Trace is :&lt;br/&gt;
System.InvalidOperationException: Server instance ec2-132-112-112-150.us-west-1.compute.amazonaws.com:27017 is no longer connected.&lt;br/&gt;
   at MongoDB.Driver.MongoServerInstance.AcquireConnection() in c:\projects\mongo-csharp-driver\MongoDB.Driver\Communication\MongoServerInstance.cs:line 386&lt;br/&gt;
   at MongoDB.Driver.MongoServer.AcquireConnection(MongoServerInstance serverInstance) in c:\projects\mongo-csharp-driver\MongoDB.Driver\MongoServer.cs:line 964&lt;br/&gt;
  at MongoDB.Driver.MongoCursorEnumerator`1.GetMore() in c:\projects\mongo-csharp-driver\MongoDB.Driver\MongoCursorEnumerator.cs:line 348&lt;br/&gt;
   at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext() in c:\projects\mongo-csharp-driver\MongoDB.Driver\MongoCursorEnumerator.cs:line 251&lt;br/&gt;
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)&lt;br/&gt;
   at System.Linq.Enumerable.ToList&lt;span class=&quot;error&quot;&gt;&amp;#91;TSource&amp;#93;&lt;/span&gt;(IEnumerable`1 source)&lt;/p&gt;



&lt;p&gt;2)Unable to connect to the server ec2-143-39-225-37.us-west-1.compute.amazonaws.com:27017.&lt;/p&gt;

&lt;p&gt;Stack Trace is:&lt;br/&gt;
MongoDB.Driver.MongoConnectionException: Unable to connect to the server ec2-143-39-225-37.us-west-1.compute.amazonaws.com:27017.&lt;br/&gt;
   at MongoDB.Driver.Internal.DirectMongoServerProxy.ChooseServerInstance(ReadPreference readPreference) in c:\projects\mongo-csharp-driver\MongoDB.Driver\Communication\Proxies\DirectMongoServerProxy.cs:line 115&lt;br/&gt;
   at MongoDB.Driver.MongoServer.AcquireConnection(ReadPreference readPreference) in c:\projects\mongo-csharp-driver\MongoDB.Driver\MongoServer.cs:line 935&lt;br/&gt;
   at MongoDB.Driver.MongoCollection.Remove(IMongoQuery query, RemoveFlags flags, WriteConcern writeConcern) in c:\projects\mongo-csharp-driver\MongoDB.Driver\MongoCollection.cs:line 1361&lt;/p&gt;
</comment>
                            <comment id="328402" author="rstam" created="Sat, 4 May 2013 17:33:35 +0000"  >&lt;p&gt;This looks like just a regular network connectivity issue.&lt;/p&gt;

&lt;p&gt;But I&apos;m perplexed by your stack trace line numbers. Line 115 of DirectMongoServerProxy.cs does not throw an exception. It calls another method called Connect that isn&apos;t on your stack trace. Are you sure your stack trace is complete?&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|hrnl8f:</customfieldvalue>

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