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

Profiling silently fails with --auth

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.0.1
    • Component/s: Security
    • None
    • Environment:
      Mac OS X 10.7, 64-bit
    • OS X

      It seems that when I start a mongod with --auth, then do db.setProfilingLevel(2) and a find(), nothing is stored in system.profile. Repeating the same test without --auth succeeds.

      I run the attached test_profile.sh against a mongod started with and without auth:

      $ mongod --dbpath ./data/db4000 --port 4000 --logpath ./log/db4000.log --fork
      $ bash test-profile.sh
      MongoDB shell version: 2.0.1
      connecting to: 127.0.0.1:4000/test
      dropping system.profile
      true
      profiling level=
      0
      setting level to 2

      { "was" : 0, "slowms" : 100, "ok" : 1 }

      find

      { "_id" : ObjectId("4f1ee0ca17b5b6b96b6ec15d") }

      setting profiling level to 0

      { "was" : 2, "slowms" : 100, "ok" : 1 }

      db.system.profile.find()
      { "ts" : ISODate("2012-01-24T16:48:10.395Z"), "op" : "query", "ns" :
      "test.test", "query" : { }, "nscanned" : 1, "nreturned" : 1,
      "responseLength" : 42, "millis" : 0, "client" : "127.0.0.1", "user" :
      "" }
      { "ts" : ISODate("2012-01-24T16:48:10.395Z"), "op" : "command", "ns" :
      "test.$cmd", "command" :

      { "profile" : 0 }

      , "ntoreturn" : 1,
      "responseLength" : 58, "millis" : 0, "client" : "127.0.0.1", "user" :
      "" }
      bye

      $ mongod --dbpath ./data/db4000 --port 4000 --logpath ./log/db4000.log
      --fork --auth
      $ bash test-profile.sh MongoDB shell version: 2.0.1
      connecting to: 127.0.0.1:4000/test
      dropping system.profile
      true
      profiling level=
      0
      setting level to 2

      { "was" : 0, "slowms" : 100, "ok" : 1 }

      find

      { "_id" : ObjectId("4f1ee0bd5f245c46ab557b47") }

      setting profiling level to 0

      { "was" : 2, "slowms" : 100, "ok" : 1 }

      db.system.profile.find()
      bye

        1. test-profile.sh
          0.4 kB
          A. Jesse Jiryu Davis

            Assignee:
            Unassigned Unassigned
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: