Bug 856850 - Beakerd fails to start successfully on Fedora 17 with Python 2.7
Summary: Beakerd fails to start successfully on Fedora 17 with Python 2.7
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.9
Hardware: Unspecified
OS: Linux
unspecified
high vote
Target Milestone: ---
Assignee: Amit Saha
QA Contact:
URL:
Whiteboard:
Depends On: 858912
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-13 00:22 UTC by Amit Saha
Modified: 2019-05-22 13:42 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-11 23:50:09 UTC


Attachments (Terms of Use)
Proposed patch for discussion (716 bytes, text/plain)
2012-09-17 01:27 UTC, Amit Saha
no flags Details

Description Amit Saha 2012-09-13 00:22:20 UTC
Description of problem:

Beakerd fails to start succesfully on Fedora 17 (Python 2.7). 

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

Pulled form Git repository.

How reproducible:

Easy.

Steps to Reproduce:
1. Follow the install guide from http://beaker-project.org/guide/Installation-Install_Beaker-Start_Beaker.html
2. Once the beaker server has been installed, run the beaker server in the foreground as 'apache' user. You should see the stacktrace. See below.

  
Actual results:

    [root@fedora17 ~]# su -s /bin/sh apache -c "beakerd -f"
    Traceback (most recent call last):
      File "/usr/bin/beakerd", line 9, in <module>
        load_entry_point('bkr.server==0.9.3', 'console_scripts', 'beakerd')()
      File "/usr/lib/python2.7/site-packages/bkr/server/tools/beakerd.py", line 650, in main
        schedule()
      File "/usr/lib/python2.7/site-packages/bkr/server/tools/beakerd.py", line 524, in schedule
        reload_config()
      File "/usr/lib/python2.7/site-packages/bkr/server/tools/beakerd.py", line 599, in reload_config
        handler.flush()
    AttributeError: 'weakref' object has no attribute 'flush'
    Error in atexit._run_exitfuncs:
    Traceback (most recent call last):
      File "/usr/lib64/python2.7/atexit.py", line 24, in _run_exitfuncs
        func(*targs, **kargs)
      File "/usr/lib64/python2.7/logging/__init__.py", line 1648, in shutdown
        h.release()
      File "/usr/lib/python2.7/site-packages/cloghandler.py", line 194, in release
        self.stream.flush()
    ValueError: I/O operation on closed file
    Error in sys.exitfunc:
    Traceback (most recent call last):
      File "/usr/lib64/python2.7/atexit.py", line 24, in _run_exitfuncs
        func(*targs, **kargs)
      File "/usr/lib64/python2.7/logging/__init__.py", line 1648, in shutdown
        h.release()
      File "/usr/lib/python2.7/site-packages/cloghandler.py", line 194, in release
        self.stream.flush()
    ValueError: I/O operation on closed file



Expected results:

 Successful beakerd instance running.

Additional info:

 The RPMs I used for installing was custom built for Fedora and is not available publicly at this moment.

Comment 1 Amit Saha 2012-09-17 01:27:00 UTC
Created attachment 613548 [details]
Proposed patch for discussion

Python 2.7 logging stores the logging handlers as weakref's whereas Python 2.6 logging stors the actual objects. Relevant source references:

Python 2.6: http://hg.python.org/cpython/file/f130ce67387d/Lib/logging/__init__.py#l597

Python 2.7: http://hg.python.org/cpython/file/820032281f49/Lib/logging/__init__.py#l663

Hence, the above change is required to retrieve the handler object from the weak reference.

Comment 2 Amit Saha 2012-09-17 03:39:01 UTC
Submitted Gerrit patch review: http://gerrit.beaker-project.org/#/c/1352/

Comment 4 Dan Callaghan 2012-10-11 23:50:09 UTC
Beaker 0.9.4 has been released.


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