Bug 740919 - IndexError on logging handler operation
Summary: IndexError on logging handler operation
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 15
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Clark Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-23 19:19 UTC by BJ Dierkes
Modified: 2011-10-14 03:20 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-14 03:20:00 UTC


Attachments (Terms of Use)

Description BJ Dierkes 2011-09-23 19:19:27 UTC
Description of problem:

The following traceback is received:

$ /usr/bin/mock --define="dist .el5.4.z" --print-root-path --uniqueext=XXXX
Traceback (most recent call last):
  File "/usr/sbin/mock", line 493, in 
    def do_buildsrpm(config_opts, chroot, options, args):
  File "/usr/sbin/mock", line 643, in main
    logging.getLogger("mockbuild.Root.state").handlers[0].setLevel(logging.WARNING)
IndexError: list index out of range


Version-Release number of selected component (if applicable):

mock-1.1.12-1

How reproducible:

Spuratic ...  I have no idea what is triggering this error.


Additional Info:

Obviously this isn't the greatest bit of information to resolve a 'bug' as the issue is likely something I am doing.  This is a build system where Mock is used on the backend and narrowing this down is proving difficult.  My request is simply to add a try/except to catch this error condition... something like:

--- mock.orig	2011-09-09 15:38:38.000000000 -0400
+++ mock	2011-09-23 14:28:10.111438352 -0400
@@ -640,7 +640,11 @@
     # set logging verbosity
     if options.verbose == 0:
         log.handlers[0].setLevel(logging.WARNING)
-        logging.getLogger("mockbuild.Root.state").handlers[0].setLevel(logging.WARNING)
+        try:
+            logging.getLogger("mockbuild.Root.state").handlers[0].setLevel(logging.WARNING)
+        except IndexError:
+            # What happened?
+            pass
     elif options.verbose == 1:
         log.handlers[0].setLevel(logging.INFO)
     elif options.verbose == 2:

Comment 1 Chris Gagne 2011-09-26 15:31:21 UTC
I'm on Fedora 14 and seeing this exception since updating to mock-1.1.14-1.fc14.noarch

Comment 2 Clark Williams 2011-09-26 17:19:39 UTC
I missed this BZ when updating mock to 1.1.15, but I believe that it will fix your problems. 

Please try the mock-1.1.15 package in updates testing and let me know if the problem still exists for you.

Comment 3 Chris Gagne 2011-09-26 18:50:35 UTC
1.1.15 fixes the issue for me.  Thanks.

Comment 4 Clark Williams 2011-09-26 19:26:05 UTC
Cool, When 1.1.15 goes stable I'll close this BZ as well.


Note You need to log in before you can comment on or make changes to this bug.