missing import logging.handlers in start-loggerhead

Bug #673999 reported by Hilario J. Montoliu (hjmf)
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
loggerhead
Fix Released
Medium
Max Kanat-Alexander

Bug Description

First run of loggerhead 1.18 ends with the following stacktrace::

    # ./start-loggerhead -f -c loggerhead.conf

    WARNING!!! This script has been deprecated by serve-branches, and will be removed in the next release. Please migrate to serve-branches and report any missing features.

    Traceback (most recent call last):
      File "./start-loggerhead", line 146, in <module>
        main()
      File "./start-loggerhead", line 110, in main
        setup_logging(options.log_folder, config, foreground=options.foreground)
      File "/tmp/loggerhead-1.18/loggerhead/trace.py", line 51, in setup_logging
        debug_log = make_handler(config, os.path.join(log_folder, 'debug.log'))
      File "/tmp/loggerhead-1.18/loggerhead/trace.py", line 36, in make_handler
        h = logging.handlers.TimedRotatingFileHandler(filename, 'W0', 1, 100)
    AttributeError: 'module' object has no attribute 'handlers'

To fix it just add an import logging.handlers to start-loggerhead

    === modified file 'start-loggerhead'
    --- start-loggerhead 2010-11-11 12:59:43 +0000
    +++ start-loggerhead 2010-11-11 13:00:18 +0000
    @@ -20,6 +20,7 @@

     import logging
    +import logging.handlers
     from optparse import OptionParser
     import os
     import sys

That seems to fix the problem::

    # ./start-loggerhead -f -c /etc/loggerhead/loggerhead.conf

    WARNING!!! This script has been deprecated by serve-branches, and will be removed in the next release. Please migrate to serve-branches and report any missing features.

    DEB [20101111-14:00:33.047] paste.httpserver.ThreadPool: Started new worker -1223750768: Initial worker pool
    [...]

Related branches

Revision history for this message
Hilario J. Montoliu (hjmf) (hmontoliu) wrote :

patch for file start-loggerhead attached

Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

Hmm. Actually, it's loggerhead.trace that seems to be missing the import. However, I didn't reproduce this locally--any chance that I could see your loggerhead.conf to see what might be triggering this?

Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

Ah, nevermind, I can reproduce it by setting a log rotation rate.

Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

Okay, the fix is on the 1.18 branch--I added it to loggerhead.trace instead of to start-loggerhead.

Changed in loggerhead:
status: New → Fix Committed
assignee: nobody → Max Kanat-Alexander (mkanat)
importance: Undecided → Medium
Changed in loggerhead:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.