Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-698

Shutdown occasionally failing erroneously reporting not using localhost

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • None
    • 1.6
    • None
    • None
    • Windows Azure, C# worker role, 3 Replica set databases, no shards.

    Description

      We get this error message about 30% of the time

      Command 'shutdown' failed: unauthorized: this command must run from localhost when running db without auth (response:

      { "errmsg" : "unauthorized: this command must run from localhost when running db without auth", "ok" : 0.0 }

      )

      We do not use authentication in the database.

      This is the C# code we use to connect to the database for this command. This worked for fine when we were using an earlier version of the database.

      MongoServer.Create(string.Format("mongodb://localhost:

      {0}

      /?slaveOk=true", MongoHostPortSetting.GetMongoHostPortSettings().Port));

      This is the stack trace:

      MongoDB.Driver.MongoCommandException: Command 'shutdown' failed: unauthorized: this command must run from localhost when running db without auth (response:

      { "errmsg" : "unauthorized: this command must run from localhost when running db without auth", "ok" : 0.0 }

      )
      at MongoDB.Driver.MongoDatabase.RunCommandAs(Type commandResultType, IMongoCommand command) in C:\work\rstam\mongo-csharp-driver\Driver\Core\MongoDatabase.cs:line 978
      at MongoDB.Driver.MongoDatabase.RunCommandAs[TCommandResult](String commandName) in C:\work\rstam\mongo-csharp-driver\Driver\Core\MongoDatabase.cs:line 962
      at MongoDB.Driver.MongoServer.Shutdown(MongoCredentials adminCredentials) in C:\work\rstam\mongo-csharp-driver\Driver\Core\MongoServer.cs:line 1008
      at MongoWorker.WorkerRole.OnStop() in c:\Sources\iQmetrix\Service\MongoWorker\WorkerRole.cs:line 250

      Because the database does not shutdown cleanly it has to do a full recovery when we bring it back up which takes quite a while.

      Attachments

        Activity

          People

            craig.wilson@mongodb.com Craig Wilson
            woaksie John Woakes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: