-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 1.1
-
Component/s: None
-
None
-
Environment:C# Driver 1.1 on Windows 7 against MongoDB 1.1
Trying to initiate a replica set through the driver using the following code
var settings = new MongoServerSettings();
settings.Server = new MongoServerAddress("localhost", 27017);
settings.SlaveOk = true;
var mongoServer = MongoServer.Create(settings);
mongoServer.Connect();
mongoServer.RunAdminCommand("replSetInitiate");
Failed with exception "Primary server not found." and stack trace
at MongoDB.Driver.MongoServer.GetServerInstance(Boolean slaveOk) in C:\source\mongo-csharp-driver\Driver\Core\MongoServer.cs:line 949
at MongoDB.Driver.MongoServer.AcquireConnection(MongoDatabase database, Boolean slaveOk) in C:\source\mongo-csharp-driver\Driver\Core\MongoServer.cs:line 874
at MongoDB.Driver.MongoCursorEnumerator`1.AcquireConnection() in C:\source\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 184
at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst() in C:\source\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 194
at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext() in C:\source\mongo-csharp-driver\Driver\Core\MongoCursorEnumerator.cs:line 126
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at MongoDB.Driver.MongoCollection.FindOneAs[TDocument](IMongoQuery query) in C:\source\mongo-csharp-driver\Driver\Core\MongoCollection.cs:line 493
at MongoDB.Driver.MongoCollection`1.FindOne(IMongoQuery query) in C:\source\mongo-csharp-driver\Driver\Core\MongoCollection.cs:line 1451
at MongoDB.Driver.MongoDatabase.RunCommandAs(Type commandResultType, IMongoCommand command) in C:\source\mongo-csharp-driver\Driver\Core\MongoDatabase.cs:line 737
at MongoDB.Driver.MongoDatabase.RunCommandAs(Type commandResultType, String commandName) in C:\source\mongo-csharp-driver\Driver\Core\MongoDatabase.cs:line 765
at MongoDB.Driver.MongoServer.RunAdminCommandAs(Type commandResultType, String commandName) in C:\source\mongo-csharp-driver\Driver\Core\MongoServer.cs:line 840
at MongoDB.Driver.MongoServer.RunAdminCommandAs[TCommandResult](String commandName) in C:\source\mongo-csharp-driver\Driver\Core\MongoServer.cs:line 814
at MongoDB.Driver.MongoServer.RunAdminCommand(String commandName) in C:\source\mongo-csharp-driver\Driver\Core\MongoServer.cs:line 790
at ConsoleApplication3.Program.RSStart() in C:\Users\Sridhar\Documents\Visual Studio 2010\Projects\ConsoleApplication3\ConsoleApplication3\Program.cs:line 39