Bug 971026

Summary: Dependancy issue prevents swift proxy from starting
Product: Red Hat OpenStack Reporter: Dan Radez <dradez>
Component: python-keystoneclientAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED ERRATA QA Contact: Pavel Sedlák <psedlak>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.0CC: apevec, ayoung, jruzicka, ykaul, zaitcev
Target Milestone: rc   
Target Release: 3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-keystoneclient-0.2.3-4.el6ost Doc Type: Bug Fix
Doc Text:
Cause: Parallel installable python-webob1.2 isn't found by keystoneclient. Consequence: Importing python-webob from keystoneclient fails with stacktrace. This also applies to applications using keystoneclient such as Swift proxy. Fix: Properly look for python-webob1.2 and require python-webob1.2 instead of python-webob. Result: The keystoneclient is able to import python-webob1.2 independently from other installed versions.
Story Points: ---
Clone Of:
: 975579 (view as bug list) Environment:
Last Closed: 2013-06-27 16:50:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 971089    

Description Dan Radez 2013-06-05 13:37:18 UTC
Description of problem:
All the swift services are running except the proxy.

when I try and start the proxy the log shows this:

[root@control ~]# cat /var/log/swift-startup.log
Traceback (most recent call last):
  File "/usr/bin/swift-proxy-server", line 22, in <module>
    run_wsgi(conf_file, 'proxy-server', default_port=8080, **options)
  File "/usr/lib/python2.6/site-packages/swift/common/wsgi.py", line 119, in run_wsgi
    init_request_processor(conf_file, app_section, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/swift/common/wsgi.py", line 246, in init_request_processor
    app = loadapp('config:%s' % conf_file, global_conf={'log_name': log_name})
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 271, in loadobj
    global_conf=global_conf)
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 320, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 450, in get_context
    global_additions=global_additions)
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 562, in _pipeline_app_context
    for name in pipeline[:-1]]
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 458, in get_context
    section)
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 517, in _context_from_explicit
    value = import_string(found_expr)
  File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 22, in import_string
    return pkg_resources.EntryPoint.parse("x=" + s).load(False)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.6/site-packages/keystoneclient/middleware/auth_token.py", line 155, in <module>
    import webob.exc
ImportError: No module named webob.exc
[root@control ~]# rpm -qa | grep webob
python-webob1.2-1.2.3-2.1.el6ost.noarch
python-webob1.0-1.0.8-3.el6.noarch 

Version-Release number of selected component (if applicable):
Running the May 31st puddle, installed swift with packstack.
this is python-keystoneclient-0.2.3-2.el6ost.noarch.rpm

How reproducible:
every time

Steps to Reproduce:
1. install swift from the may31 puddle using packstack
2. 
3.

Actual results:
swift proxy dies with the above stack track

Expected results:
swift proxy should start without a stack track


Additional info:

Comment 1 Dan Radez 2013-06-05 13:40:52 UTC
solution we came to on the mailing list:

On 06/04/2013 05:22 PM, Alan Pevec wrote:
>>> if you have python-webob1.2 installed, please try adding
>>> replace_dist("WebOb >= 1.2")
>>> one line before replace_dist("PasteDeploy >= 1.5.0")
>>
>> The above works, because the dependencies in the spec are correct
>> (indirectly -- since it's python-keystoneclient that wants WebOb,
>> it requires python-webob, so python-webob1.2 is installed at Dan's
>> box in the end).
>>
>> Do you prefer it in openstack-swift or python-keystoneclient?
>> Both work, the first requires less code, the second is "more correct".
>
> Yeah, let's do the right thing - Dan, please file rhbz against python-keystoneclient, targeting 3.0 RC.
>
> Cheers,
> Alan

Comment 6 Pavel Sedlák 2013-06-11 13:01:11 UTC
Reproduced with python-keystoneclient-0.2.3-2.el6ost.

> /etc/init.d/openstack-swift-proxy restart
> Stopping openstack-swift-proxy:      [  OK  ]
> Starting openstack-swift-proxy:      [  OK  ]

> /etc/init.d/openstack-swift-proxy status
>   openstack-swift-proxy dead but pid file exists

> # tail /var/log/swift-startup.log 
>     section)
>   File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 517, in _context_from_explicit
>     value = import_string(found_expr)
>   File "/usr/lib/python2.6/site-packages/PasteDeploy-1.5.0-py2.6.egg/paste/deploy/loadwsgi.py", line 22, in import_string
>     return pkg_resources.EntryPoint.parse("x=" + s).load(False)
>   File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
>     entry = __import__(self.module_name, globals(),globals(), ['__name__'])
>   File "/usr/lib/python2.6/site-packages/keystoneclient/middleware/auth_token.py", line 155, in <module>
>     import webob.exc
> ImportError: No module named webob.exc



Verified with python-keystoneclient-0.2.3-4.el6ost.

> # > /var/log/swift-startup.log 

> # /etc/init.d/openstack-swift-proxy restart
> Stopping openstack-swift-proxy:      [  OK  ]
> Starting openstack-swift-proxy:      [  OK  ]

> # /etc/init.d/openstack-swift-proxy status
> openstack-swift-proxy (pid  18834) is running...

> # tail /var/log/swift-startup.log 
> # ls -l /var/log/swift-startup.log 
> -rw-r--r--. 1 root root 0 Jun 11 14:58 /var/log/swift-startup.log



With only new webob installed:
> Installed Packages
>  python-webob1.0-1.0.8-3.el6
>  python-webob1.2-1.2.3-2.1.el6ost
> Available Packages
>  python-webob-0.9.6.1-3.el6
so original simple import would have to fail:
> # python -c 'import webob.exc'
> Traceback (most recent call last):
>  File "<string>", line 1, in <module>
> ImportError: No module named webob.exc

Comment 11 Alan Pevec 2013-06-18 19:53:06 UTC
Another solution proposed upstream by Pete https://review.openstack.org/32825
"Drop webob from auth_token.py"

Comment 12 Pete Zaitcev 2013-06-18 21:02:35 UTC
The upstream work needs cooking in regards to HEAD required not to send a body, so I took it to WIP status. We should use the fix as outlined in this bug.

Comment 14 errata-xmlrpc 2013-06-27 16:50:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0992.html