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

server aborts if original log file is moved before rotating log

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Duplicate
    • Affects Version/s: 2.4.7
    • Fix Version/s: None
    • Component/s: Logging, Stability
    • Labels:
    • Environment:
      Ubuntu 10.04 64 bit
    • Operating System:
      Linux
    • Steps To Reproduce:
      Hide

      Configure logrotate with a configuration such as

      /var/log/mongodb/mongodb.log {
      daily
      dateext
      missingok
      rotate 60
      compress
      delaycompress
      notifempty
      nocreate
      sharedscripts
      postrotate
      [ ! -f /mongo/db/mongod.lock ] || kill -USR1 `cat /mongo/db/mongod.lock`
      endscript
      }

      Run logrotate, mongodb.log file will get moved by logrotate, SIGUSR1 is sent expecting mongodb.log to exist but it's already been rotated.

      Tue Oct 29 06:37:33.009 ERROR: failed to rename '/var/log/mongodb/mongodb.log' to '/var/log/mongodb/mongodb.log.2013-10-29T10-37-33': errno:2 No such file or directory
      Tue Oct 29 06:37:33.019 Fatal Assertion 16782
      0xde0151 0xd9ff43 0x6cf530 0xe289d9 0x7f631dbe09ca 0x7f631cf8721d
      /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde0151]
      /usr/bin/mongod(_ZN5mongo13fassertFailedEi+0xa3) [0xd9ff43]
      /usr/bin/mongod(_ZN5mongo22signalProcessingThreadEv+0xe0) [0x6cf530]
      /usr/bin/mongod() [0xe289d9]
      /lib/libpthread.so.0(+0x69ca) [0x7f631dbe09ca]
      /lib/libc.so.6(clone+0x6d) [0x7f631cf8721d]

      Show
      Configure logrotate with a configuration such as /var/log/mongodb/mongodb.log { daily dateext missingok rotate 60 compress delaycompress notifempty nocreate sharedscripts postrotate [ ! -f /mongo/db/mongod.lock ] || kill -USR1 `cat /mongo/db/mongod.lock` endscript } Run logrotate, mongodb.log file will get moved by logrotate, SIGUSR1 is sent expecting mongodb.log to exist but it's already been rotated. Tue Oct 29 06:37:33.009 ERROR: failed to rename '/var/log/mongodb/mongodb.log' to '/var/log/mongodb/mongodb.log.2013-10-29T10-37-33': errno:2 No such file or directory Tue Oct 29 06:37:33.019 Fatal Assertion 16782 0xde0151 0xd9ff43 0x6cf530 0xe289d9 0x7f631dbe09ca 0x7f631cf8721d /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde0151] /usr/bin/mongod(_ZN5mongo13fassertFailedEi+0xa3) [0xd9ff43] /usr/bin/mongod(_ZN5mongo22signalProcessingThreadEv+0xe0) [0x6cf530] /usr/bin/mongod() [0xe289d9] /lib/libpthread.so.0(+0x69ca) [0x7f631dbe09ca] /lib/libc.so.6(clone+0x6d) [0x7f631cf8721d]

      Description

      Mongodb segfaults expecting mongodb.log to exist during logrotate

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jlintz Justin Lintz
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: