[CSHARP-1028] Unable to connect to server 10.30.41.50:27017: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Created: 11/Aug/14  Updated: 04/Apr/15  Resolved: 04/Apr/15

Status: Closed
Project: C# Driver
Component/s: Configuration, Connectivity, Error Handling, Setup
Affects Version/s: 1.8.3, 1.9
Fix Version/s: None

Type: Task Priority: Critical - P2
Reporter: Michael Assignee: Unassigned
Resolution: Done Votes: 0
Labels: connection
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Localhost windows 7
Server: Windows sever 2012



 Description   

Hi
Using this simple lines code the driver is throwing an exception related with the socket timeout.

// var client = new MongoClient("mongodb://10.30.41.50/DocumentManagerDataBase");

var client = new MongoClient("mongodb://10.30.41.50/DocumentManagerDataBase/?socketTimeoutMS=30000");

var server = client.GetServer();
try

{ server.Connect(); }

catch (Exception e)

{ throw; }

Stacktrace information:

Unable to connect to server 10.30.41.50:27017:
A connection attempt failed because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to respond 10.30.41.50:27017.

at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)
at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
at MongoDB.Driver.MongoServer.Connect()
at UsingDocumentManagerAPI.API.Main(String[] args) in c:\PathAppsProjects\UsingDocumentManagerAPI\UsingDocumentManagerAPI\API.cs:line 30
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

If I change to my localhost it working fine, but for the other hots does not work.

I dont have anny firewwal in the midlle, etc.

My mongoDb database it hoted on Windows server 2012.
If try to conect using any front end like RoboMongo or the shell, it workig fine, and I can retrive data from collection. but not through the api.
Thanks
MIKE


Generated at Wed Feb 07 21:38:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.