[SERVER-9900] Can't connect to mongo Created: 11/Jun/13  Updated: 10/Dec/14  Resolved: 30/Dec/13

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.0.5
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Gabriel Badescu Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows server 2008 R2 64bit


Attachments: Text File mongod.log    
Operating System: ALL
Steps To Reproduce:

Open an admin cmd.
Run command:
c:\Program Files (x86)\Ixia\ResourceManager\MongoDB\bin>mongod.exe --journal --dbpath "C:\ProgramData\Ixia\ResourceManager\Storage\Database" --logpath "C:\ProgramData\Ixia\ResourceManager\Logs\mongod.log" --logappend --verbose --ipv6

Try to start mongo.exe.
This the output:
c:\Program Files (x86)\Ixia\ResourceManager\MongoDB\bin>mongo.exe
MongoDB shell version: 2.0.5
connecting to: test
Tue Jun 11 03:32:31 Socket recv() got 1 bytes wanted len=4
Tue Jun 11 03:32:31 Socket recv() got 1 bytes wanted len=3
Tue Jun 11 03:32:33 Socket recv() got 1 bytes wanted len=2

The problem is the connection can't be establish to database.
Also i try to use mongo as a windows service. Service is in started state. Also if try to connect with MongoVUE client or mongo.exe to database but I can't.

Can someone help me why I can't use database?

Thanks!

Participants:

 Description   

I'm using mongo 2.0.5. I try to use mongod.exe hosted in a windows service or started in a commandline and no connection can be made to it.



 Comments   
Comment by Tad Marshall [ 11/Jun/13 ]

Hi Gabriel,

What is your reason for running 32-bit version 2.0.5 in Windows 2008 R2 64-bit instead of a more recent 64-bit version such as 2.0.9, 2.2.4 or 2.4.4?

The log file you posted shows that a connection was made 30 seconds after the server started:

Tue Jun 11 03:32:00 [initandlisten] waiting for connections on port 27017
Tue Jun 11 03:32:00 [websvr] admin web console waiting for connections on port 28017
Tue Jun 11 03:32:30 [initandlisten] connection accepted from 127.0.0.1:49498 #1
Tue Jun 11 03:32:30 [conn1] run command admin.$cmd { whatsmyuri: 1 }
Tue Jun 11 03:32:30 [conn1] command admin.$cmd command: { whatsmyuri: 1 } ntoreturn:1 reslen:62 0ms

You might want to try the current stable 64-bit version, 2.4.4.

This Jira system is used for posting bug reports and feature requests. Questions relating to usage of MongoDB should be posted in https://groups.google.com/forum/?fromgroups#!forum/mongodb-user .

Tad

Comment by Gabriel Badescu [ 11/Jun/13 ]

Error when trying to connect with MongoVUE:
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Type: System.IO.IOException
Stack: at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at MongoDB.Bson.IO.BsonBuffer.LoadFrom(Stream stream, Int32 count)
at MongoDB.Bson.IO.BsonBuffer.LoadFrom(Stream stream)
at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializationOptions serializationOptions)
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.DirectConnector.Connect(TimeSpan timeout)

An existing connection was forcibly closed by the remote host
Type: System.Net.Sockets.SocketException
Stack: at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

Generated at Thu Feb 08 03:21:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.