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

ftdc file_manager generates an incorrect absolute diagnostic data path for mongos if the logpath is a relative path

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.5.11
    • Fix Version/s: 3.5.12
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Configure a mongos with the following conf file excerpt or commmand line parameter '--logpath 12345/mongos.log' and the mongos from say '/tmp/mongos.ftdc':

      $> mkdir -p /tmp/mongos.ftdc/12345
      $> cd /tmp/mongos.ftdc
      $> mongos -f mongo.conf
      # OR 
      $> mongos  --logpath 12345/mongos.log ... # the rest of the params
      

      Check '/tmp/mongos.ftdc/12345/mongos.log':

      $ egrep '12345' /tmp/mongos.ftdc/12345/mongos.log                
      2017-07-28T13:19:34.107+0100 I CONTROL  [mongosMain] options: { config: "/tmp/mongos.yml", net: { bindIp: "0.0.0.0", port: 27067 }, processManagement: { fork: true }, setParameter: { enableTestCommands: "1" }, sharding: { configDB: "configRepl/fugly:27019" }, systemLog: { destination: "file", path: "12345/mongos.log" } }
      2017-07-28T13:19:36.111+0100 I FTDC     [mongosMain] Initializing full-time diagnostic data capture with directory '12345/mongos.diagnostic.data'
      2017-07-28T13:19:37.000+0100 W FTDC     [ftdc] Uncaught exception in 'NonExistentPath: '/12345/mongos.diagnostic.data' could not be created: Permission denied' in full-time diagnostic data capture subsystem. Shutting down the full-time diagnostic data capture subsystem.
      

      Conf file:

      systemLog:
        destination: file
        path: 12345/mongos.log
      

      Show
      Configure a mongos with the following conf file excerpt or commmand line parameter ' --logpath 12345/mongos.log ' and the mongos from say '/tmp/mongos.ftdc': $> mkdir -p /tmp/mongos.ftdc/12345 $> cd /tmp/mongos.ftdc $> mongos -f mongo.conf # OR $> mongos --logpath 12345/mongos.log ... # the rest of the params Check ' /tmp/mongos.ftdc/12345/mongos.log ': $ egrep '12345' /tmp/mongos.ftdc/12345/mongos.log 2017-07-28T13:19:34.107+0100 I CONTROL [mongosMain] options: { config: "/tmp/mongos.yml", net: { bindIp: "0.0.0.0", port: 27067 }, processManagement: { fork: true }, setParameter: { enableTestCommands: "1" }, sharding: { configDB: "configRepl/fugly:27019" }, systemLog: { destination: "file", path: "12345/mongos.log" } } 2017-07-28T13:19:36.111+0100 I FTDC [mongosMain] Initializing full-time diagnostic data capture with directory '12345/mongos.diagnostic.data' 2017-07-28T13:19:37.000+0100 W FTDC [ftdc] Uncaught exception in 'NonExistentPath: '/12345/mongos.diagnostic.data' could not be created: Permission denied' in full-time diagnostic data capture subsystem. Shutting down the full-time diagnostic data capture subsystem. Conf file: systemLog: destination: file path: 12345/mongos.log
    • Sprint:
      Platforms 2017-08-21

      Description

      Both --logpath and systemLog.path can accept relative paths and correctly converts them based on the CWD.

      However, when a relative path is passed to FTDCFileManager::create, it is incorrectly converted to an absolute path off the root file system.

      While using relative paths for configuration parameters is probably not the expected use case, the ftdc code should work in the same fashion as logging.

        Attachments

          Activity

            People

            Assignee:
            mark.benvenuto Mark Benvenuto
            Reporter:
            jim.oleary James O'Leary
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: