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

mongod crashes after renaming logfile and sending -SIGUSR1 to reopen

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Admin
    • None
    • ALL
    • Hide
      mkdir -p /logs/mongodb
      ./mongod --fork --logpath /logs/mongodb/mongodb.log
      ls -la /logs/mongodb/
      pidof mongod && kill -SIGUSR1 $(pidof mongod)
      ls -la /logs/mongodb/
      mv /logs/mongodb/mongodb.log /logs/mongodb/mongodb.log_old
      pidof mongod && kill -SIGUSR1 $(pidof mongod)
      ls -la /logs/mongodb/
      cat /logs/mongodb/mongodb.log_old
      Show
      mkdir -p /logs/mongodb ./mongod --fork --logpath /logs/mongodb/mongodb.log ls -la /logs/mongodb/ pidof mongod && kill -SIGUSR1 $(pidof mongod) ls -la /logs/mongodb/ mv /logs/mongodb/mongodb.log /logs/mongodb/mongodb.log_old pidof mongod && kill -SIGUSR1 $(pidof mongod) ls -la /logs/mongodb/ cat /logs/mongodb/mongodb.log_old

      MongoDB 3.4.14, started with

      ./mongod --fork --logpath /logs/mongodb/mongodb.log

      A

      pidof mongod && kill -SIGUSR1 $(pidof mongod)

      results in a new mongodb.log-File and the old file renamed to mongodb.log.2018-03-28T11-41-49.

      After renaming the file mongodb.log to mongodb.log_old by hand, mongod still logs into the old file (no problem, expected this). But after sending

      pidof mongod && kill -SIGUSR1 $(pidof mongod)

      again, mongod crashes with

      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread] pid=5525 port=27017 64-bit host=md-732a.md.local
      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread] db version v3.4.14
      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread] git version: fd954412dfc10e4d1e3e2dd4fac040f8b476b268
      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread] allocator: tcmalloc
      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread] modules: none
      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread] build environment:
      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread]     distarch: x86_64
      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread]     target_arch: x86_64
      2018-03-28T13:41:49.198+0200 I CONTROL  [signalProcessingThread] options: { processManagement: { fork: true }, systemLog: { destination: "file", path: "/logs/mongodb/mongodb.log" }
       }
      2018-03-28T13:42:11.997+0200 I CONTROL  [signalProcessingThread] Log rotation initiated
      2018-03-28T13:42:11.997+0200 W CONTROL  [signalProcessingThread] Rotating log file /logs/mongodb/mongodb.log failed: FileRenameFailed: Failed  to rename "/logs/mongodb/mongodb.log"
       to "/logs/mongodb/mongodb.log.2018-03-28T11-42-11": No such file or directory
      2018-03-28T13:42:11.997+0200 I -        [signalProcessingThread] Fatal Assertion 16782 at src/mongo/util/signal_handlers.cpp 188
      2018-03-28T13:42:11.997+0200 I -        [signalProcessingThread] 
      
      ***aborting after fassert() failure
      
      
      2018-03-28T13:42:12.059+0200 F -        [signalProcessingThread] Got signal: 6 (Aborted).
      
       0x5632105c3f11 0x5632105c3129 0x5632105c360d 0x7f95b811b5e0 0x7f95b7d7e1f7 0x7f95b7d7f8e8 0x56320f8985cb 0x5632105c2a1b 0x56321103e070 0x7f95b8113e25 0x7f95b7e4134d
      ----- BEGIN BACKTRACE -----
      {"backtrace":[{"b":"56320F08F000","o":"1534F11","s":"_ZN5mongo15printStackTraceERSo"},{"b":"56320F08F000","o":"1534129"},{"b":"56320F08F000","o":"153460D"},{"b":"7F95B810C000","o":
      "F5E0"},{"b":"7F95B7D49000","o":"351F7","s":"gsignal"},{"b":"7F95B7D49000","o":"368E8","s":"abort"},{"b":"56320F08F000","o":"8095CB","s":"_ZN5mongo32fassertFailedNoTraceWithLocatio
      nEiPKcj"},{"b":"56320F08F000","o":"1533A1B"},{"b":"56320F08F000","o":"1FAF070"},{"b":"7F95B810C000","o":"7E25"},{"b":"7F95B7D49000","o":"F834D","s":"clone"}],"processInfo":{ "mongo
      dbVersion" : "3.4.14", "gitVersion" : "fd954412dfc10e4d1e3e2dd4fac040f8b476b268", "compiledModules" : [], "uname" : { "sysname" : "Linux", "release" : "3.10.0-693.21.1.el7.x86_64",
       "version" : "#1 SMP Wed Mar 7 19:03:37 UTC 2018", "machine" : "x86_64" }, "somap" : [ { "b" : "56320F08F000", "elfType" : 3, "buildId" : "2FE2CCD41FAAB04029B72923D00FF1908D17A1FF"
       }, { "b" : "7FFC44C41000", "elfType" : 3, "buildId" : "228ADFE0D8C0852BF24F80B24803DA9E25F5B21E" }, { "b" : "7F95B8A44000", "path" : "/lib64/librt.so.1", "elfType" : 3, "buildId" 
      : "6D322588B36D2617C03C0F3B93677E62FCFFDA81" }, { "b" : "7F95B8840000", "path" : "/lib64/libdl.so.2", "elfType" : 3, "buildId" : "1E42EBFB272D37B726F457D6FE3C33D2B094BB69" }, { "b"
       : "7F95B853E000", "path" : "/lib64/libm.so.6", "elfType" : 3, "buildId" : "808BD35686C193F218A5AAAC6194C49214CFF379" }, { "b" : "7F95B8328000", "path" : "/lib64/libgcc_s.so.1", "e
      lfType" : 3, "buildId" : "C344A7E6783B19A5C763AC24746EC6BAD2607F28" }, { "b" : "7F95B810C000", "path" : "/lib64/libpthread.so.0", "elfType" : 3, "buildId" : "A48D21B2578A8381FBD885
      7802EAA660504248DC" }, { "b" : "7F95B7D49000", "path" : "/lib64/libc.so.6", "elfType" : 3, "buildId" : "95FF02A4BEBABC573C7827A66D447F7BABDDAA44" }, { "b" : "7F95B8C4C000", "path" 
      : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3, "buildId" : "22FA66DA7D14C88BF36C69454A357E5F1DEFAE4E" } ] }}
       mongod(_ZN5mongo15printStackTraceERSo+0x41) [0x5632105c3f11]
       mongod(+0x1534129) [0x5632105c3129]
       mongod(+0x153460D) [0x5632105c360d]
       libpthread.so.0(+0xF5E0) [0x7f95b811b5e0]
       libc.so.6(gsignal+0x37) [0x7f95b7d7e1f7]
       libc.so.6(abort+0x148) [0x7f95b7d7f8e8]
       mongod(_ZN5mongo32fassertFailedNoTraceWithLocationEiPKcj+0x0) [0x56320f8985cb]
       mongod(+0x1533A1B) [0x5632105c2a1b]
       mongod(+0x1FAF070) [0x56321103e070]
       libpthread.so.0(+0x7E25) [0x7f95b8113e25]
       libc.so.6(clone+0x6D) [0x7f95b7e4134d]
      -----  END BACKTRACE  -----
      

      i know that

      --logRotate reopen --logappend

      exists but i didn't expect mongod to crash "only" renaming a logfile...

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            md_mg Marc Gebauer
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: