David Burke | 4 Feb 10:40 2013

Re: Can't connect to mongodb: "System lacked sufficient buffer space or because a queue was full"

Hi Guys,


I am experiencing the same problem:

System.Net.Sockets.SocketException (0x80004005): An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 127.0.0.1:27017
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
   at MongoDB.Driver.Internal.MongoConnection.Open() in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 375
   at MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoRequestMessage message, WriteConcern writeConcern, String databaseName) in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 559
   at MongoDB.Driver.Internal.MongoConnection.RunCommand(String databaseName, QueryFlags queryFlags, CommandDocument command, Boolean throwOnError) in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 425
   at MongoDB.Driver.Internal.MongoConnection.Authenticate(String databaseName, MongoCredentials credentials) in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 160
   at MongoDB.Driver.Internal.MongoConnection.CheckAuthentication(MongoDatabase database) in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 282
   at MongoDB.Driver.MongoServerInstance.AcquireConnection(MongoDatabase database) in C:\build\mongo-csharp-driver\Driver\Core\MongoServerInstance.cs:line 410
   at MongoDB.Driver.MongoServer.AcquireConnection(MongoDatabase database, ReadPreference readPreference) in C:\build\mongo-csharp-driver\Driver\Core\MongoServer.cs:line 1058
   at MongoDB.Driver.MongoCursorEnumerator`1.AcquireConnection() in C:\build\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 299
   at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst() in C:\build\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 312
   at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext() in C:\build\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 230
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at MongoDB.Driver.Linq.SelectQuery.Execute() in C:\build\mongo-csharp-driver\Driver\Linq\Translators\SelectQuery.cs:line 210
   at MongoDB.Driver.Linq.MongoQueryProvider.Execute[TResult](Expression expression) in C:\build\mongo-csharp-driver\Driver\Linq\MongoQueryProvider.cs:line 132
   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)


The code is running on windows 2008r2 with mongo c# driver 1.7 connecting to a mongos 2.2.1 on the same machine. Shards are on aws linux 3.2 64bit. 

On Tuesday, April 10, 2012 9:44:07 PM UTC+1, Bill Hayward wrote:
No problem, Brent. Thanks for the update information. I will see what I can come up with for you shortly.

On Tuesday, March 27, 2012 3:55:57 PM UTC-4, Brent Mills wrote:
Hey Bill,

Sorry for the late response.  We are running mongo 2.0.0 with suse linux 11.3.  The client machines are running windows 2008r2.  Everything is 64bit.  The problem is pretty sporadic and we haven't been able to narrow down anything particular happening at that time.  What specific error logs are you looking for?

On Thursday, March 22, 2012 1:23:18 PM UTC-5, Bill Hayward wrote:
It looks like you are running the latest version of the C# driver. What version of MongoDB are you running? Can you provide the complete log file and document the version of the operating system you are running this on (and 32 or 64 bit)? Is there any pattern to when you get this exception - is, for example, something else running at the time that may be a part of the problem?

On Thursday, March 22, 2012 12:24:53 PM UTC-4, Rex Morgan wrote:
I'm getting the following exception occasionally when attempting to connect to our mongodb in production (we are using the mongo-csharp-drivers v1.3.1.4349):

<Message>Unable to connect to the primary member of the replica set: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 192.168.3.28:27017.</Message>
<Source>MongoDB.Driver</Source>
<StackTrace>   at MongoDB.Driver.Internal.ReplicaSetConnector.Connect(TimeSpan timeout, ConnectWaitFor waitFor)
   at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout, ConnectWaitFor waitFor)
   at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
   at MongoDB.Driver.MongoServer.Connect()
   at Infrastructure.Configuration.MongoDbRegistry.&lt;.ctor&gt;b__0(IContext cx)</StackTrace>
<TargetSite>Void Connect(System.TimeSpan, MongoDB.Driver.ConnectWaitFor)</TargetSite>
<InnerException>
    <Message>An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 192.168.3.28:27017</Message>
    <Source>System</Source>
    <StackTrace>   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
   at MongoDB.Driver.Internal.MongoConnection.Open()
   at MongoDB.Driver.Internal.MongoConnection.GetNetworkStream()
   at MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoRequestMessage message, SafeMode safeMode)
   at MongoDB.Driver.Internal.MongoConnection.RunCommand(String collectionName, QueryFlags queryFlags, CommandDocument command)
   at MongoDB.Driver.MongoServerInstance.VerifyState(MongoConnection connection)
   at MongoDB.Driver.MongoServerInstance.Connect(Boolean slaveOk)
   at MongoDB.Driver.Internal.ReplicaSetConnector.ConnectWorkItem(Object argsObject)</StackTrace>
    <TargetSite>Void DoConnect(System.Net.EndPoint, System.Net.SocketAddress)</TargetSite>
</InnerException>


The article makes it sound like we are running out of available TCP ports on our server, but I'm unsure if this is correct or not. I'm hoping someone could explain the error a little more, and point me in the right direction.

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Moacy Barros | 26 Apr 20:16 2013
Picon

Re: Can't connect to mongodb: "System lacked sufficient buffer space or because a queue was full"

Hello,

it seams to be a windows issues, please check the following reference: http://support.microsoft.com/kb/196271/en

Regards,
Moacy

On Monday, February 4, 2013 7:40:22 AM UTC-2, David Burke wrote:
Hi Guys,

I am experiencing the same problem:

System.Net.Sockets.SocketException (0x80004005): An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 127.0.0.1:27017
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
   at MongoDB.Driver.Internal.MongoConnection.Open() in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 375
   at MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoRequestMessage message, WriteConcern writeConcern, String databaseName) in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 559
   at MongoDB.Driver.Internal.MongoConnection.RunCommand(String databaseName, QueryFlags queryFlags, CommandDocument command, Boolean throwOnError) in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 425
   at MongoDB.Driver.Internal.MongoConnection.Authenticate(String databaseName, MongoCredentials credentials) in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 160
   at MongoDB.Driver.Internal.MongoConnection.CheckAuthentication(MongoDatabase database) in C:\build\mongo-csharp-driver\Driver\Internal\MongoConnection.cs:line 282
   at MongoDB.Driver.MongoServerInstance.AcquireConnection(MongoDatabase database) in C:\build\mongo-csharp-driver\Driver\Core\MongoServerInstance.cs:line 410
   at MongoDB.Driver.MongoServer.AcquireConnection(MongoDatabase database, ReadPreference readPreference) in C:\build\mongo-csharp-driver\Driver\Core\MongoServer.cs:line 1058
   at MongoDB.Driver.MongoCursorEnumerator`1.AcquireConnection() in C:\build\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 299
   at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst() in C:\build\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 312
   at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext() in C:\build\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 230
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at MongoDB.Driver.Linq.SelectQuery.Execute() in C:\build\mongo-csharp-driver\Driver\Linq\Translators\SelectQuery.cs:line 210
   at MongoDB.Driver.Linq.MongoQueryProvider.Execute[TResult](Expression expression) in C:\build\mongo-csharp-driver\Driver\Linq\MongoQueryProvider.cs:line 132
   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)


The code is running on windows 2008r2 with mongo c# driver 1.7 connecting to a mongos 2.2.1 on the same machine. Shards are on aws linux 3.2 64bit. 

On Tuesday, April 10, 2012 9:44:07 PM UTC+1, Bill Hayward wrote:
No problem, Brent. Thanks for the update information. I will see what I can come up with for you shortly.

On Tuesday, March 27, 2012 3:55:57 PM UTC-4, Brent Mills wrote:
Hey Bill,

Sorry for the late response.  We are running mongo 2.0.0 with suse linux 11.3.  The client machines are running windows 2008r2.  Everything is 64bit.  The problem is pretty sporadic and we haven't been able to narrow down anything particular happening at that time.  What specific error logs are you looking for?

On Thursday, March 22, 2012 1:23:18 PM UTC-5, Bill Hayward wrote:
It looks like you are running the latest version of the C# driver. What version of MongoDB are you running? Can you provide the complete log file and document the version of the operating system you are running this on (and 32 or 64 bit)? Is there any pattern to when you get this exception - is, for example, something else running at the time that may be a part of the problem?

On Thursday, March 22, 2012 12:24:53 PM UTC-4, Rex Morgan wrote:
I'm getting the following exception occasionally when attempting to connect to our mongodb in production (we are using the mongo-csharp-drivers v1.3.1.4349):

<Message>Unable to connect to the primary member of the replica set: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 192.168.3.28:27017.</Message>
<Source>MongoDB.Driver</Source>
<StackTrace>   at MongoDB.Driver.Internal.ReplicaSetConnector.Connect(TimeSpan timeout, ConnectWaitFor waitFor)
   at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout, ConnectWaitFor waitFor)
   at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
   at MongoDB.Driver.MongoServer.Connect()
   at Infrastructure.Configuration.MongoDbRegistry.&lt;.ctor&gt;b__0(IContext cx)</StackTrace>
<TargetSite>Void Connect(System.TimeSpan, MongoDB.Driver.ConnectWaitFor)</TargetSite>
<InnerException>
    <Message>An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full 192.168.3.28:27017</Message>
    <Source>System</Source>
    <StackTrace>   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
   at MongoDB.Driver.Internal.MongoConnection.Open()
   at MongoDB.Driver.Internal.MongoConnection.GetNetworkStream()
   at MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoRequestMessage message, SafeMode safeMode)
   at MongoDB.Driver.Internal.MongoConnection.RunCommand(String collectionName, QueryFlags queryFlags, CommandDocument command)
   at MongoDB.Driver.MongoServerInstance.VerifyState(MongoConnection connection)
   at MongoDB.Driver.MongoServerInstance.Connect(Boolean slaveOk)
   at MongoDB.Driver.Internal.ReplicaSetConnector.ConnectWorkItem(Object argsObject)</StackTrace>
    <TargetSite>Void DoConnect(System.Net.EndPoint, System.Net.SocketAddress)</TargetSite>
</InnerException>


The article makes it sound like we are running out of available TCP ports on our server, but I'm unsure if this is correct or not. I'm hoping someone could explain the error a little more, and point me in the right direction.

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongodb-user-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gmane