Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27271

rolesInfo command raises System.InvalidOperationException : Duplicate element name 'roles'.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.1, 3.5.1
    • Affects Version/s: 3.4.0
    • Component/s: Admin
    • None
    • Fully Compatible
    • Platforms 2017-01-23

      Empty installation of http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.4.0.zip on Windows 10 x64.

                  var clientSettings = new MongoClientSettings();
                  clientSettings.Server = new MongoServerAddress("localhost", 27340);
                  var server = new MongoServer(MongoServerSettings.FromClientSettings(clientSettings));
                  server.Connect();
                  var db = server.GetDatabase("admin");
                  var command = new CommandDocument("rolesInfo", 1);
                  db.RunCommand(command);
                  server.Disconnect();
      

      raises System.InvalidOperationException : Duplicate element name 'roles'.
      Previous versions of C# driver raise the same error.
      All versions work fine on Mongo 3.2, 3.0, 2.6.
      Stack trace:

        at MongoDB.Bson.BsonDocument.Add(BsonElement element) in BsonDocument.cs: line 424
         at MongoDB.Bson.BsonDocument.Add(String name, BsonValue value) in BsonDocument.cs: line 586
         at MongoDB.Bson.Serialization.Serializers.BsonDocumentSerializer.DeserializeValue(BsonDeserializationContext context, BsonDeserializationArgs args) in BsonDocumentSerializer.cs: line 67
         at MongoDB.Bson.Serialization.Serializers.BsonValueSerializerBase`1.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args) in BsonValueSerializerBase.cs: line 51
         at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize(IBsonSerializer`1 serializer, BsonDeserializationContext context) in IBsonSerializerExtensions.cs: line 49
         at MongoDB.Driver.CommandResultSerializer`1.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args) in CommandResultSerializer.cs: line 39
         at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize(IBsonSerializer`1 serializer, BsonDeserializationContext context) in IBsonSerializerExtensions.cs: line 49
         at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.ProcessReply(ConnectionId connectionId, ReplyMessage`1 reply) in CommandWireProtocol.cs: line 206
         at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken) in CommandWireProtocol.cs: line 111
         at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocol(IWireProtocol`1 protocol, CancellationToken cancellationToken) in Server.cs: line 698
         at MongoDB.Driver.Core.Servers.Server.ServerChannel.Command(DatabaseNamespace databaseNamespace, BsonDocument command, IElementNameValidator commandValidator, Func`1 responseHandling, Boolean slaveOk, IBsonSerializer`1 resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken) in Server.cs: line 348
         at MongoDB.Driver.Core.Operations.CommandOperationBase`1.ExecuteProtocol(IChannelHandle channel, ServerDescription serverDescription, ReadPreference readPreference, CancellationToken cancellationToken) in CommandOperationBase.cs: line 181
         at MongoDB.Driver.Core.Operations.CommandOperationBase`1.ExecuteProtocol(IChannelSource channelSource, ReadPreference readPreference, CancellationToken cancellationToken) in CommandOperationBase.cs: line 206
         at MongoDB.Driver.Core.Operations.WriteCommandOperation`1.Execute(IWriteBinding binding, CancellationToken cancellationToken) in WriteCommandOperation.cs: line 57
         at MongoDB.Driver.MongoDatabase.ExecuteWriteOperation(IWriteOperation`1 operation) in MongoDatabase.cs: line 966
         at MongoDB.Driver.MongoDatabase.RunCommandAs(IMongoCommand command, IBsonSerializer`1 resultSerializer, ReadPreference readPreference) in MongoDatabase.cs: line 992
         at MongoDB.Driver.MongoDatabase.RunCommandAs(IMongoCommand command, ReadPreference readPreference) in MongoDatabase.cs: line 837
         at MongoDB.Driver.MongoDatabase.RunCommandAs(IMongoCommand command) in MongoDatabase.cs: line 821
         at MongoDB.Driver.MongoDatabase.RunCommand(IMongoCommand command) in MongoDatabase.cs: line 799
      

      Seems it's a MongoDB server error.

            Assignee:
            spencer.jackson@mongodb.com Spencer Jackson
            Reporter:
            alexeybut Alexey Butalov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: