Ask Your Question
1

ImportError running Swift

asked 2013-09-12 01:16:07 -0600

racom88 gravatar image

updated 2013-09-15 10:54:04 -0600

Jobin gravatar image

Dear Members,

I have installed OpenStack Swift on Ubuntu 13.04 Raring Ringtail using this link: http://docs.openstack.org/developer/swift/development_saio.html

Now when I performed a step 12 of section http://docs.openstack.org/developer/swift/development_saio.html#setting-up-scripts-for-running-swift , I am getting this error:

ImportError: No module named middleware.recon

Can anyone help in this regard. I tried the solution given on this link but no use: https://answers.launchpad.net/swift/+question/204244

I ve tried it but nothing happened. I will appreciate if anyone can guide me.

The error log:

    Starting proxy-server...(/etc/swift/proxy-server.conf) Starting container-server...(/etc/swift/container-server/1.conf) Starting container-server...(/etc/swift/container-server/2.conf) Starting container-server...(/etc/swift/container-server/3.conf) Starting container-server...(/etc/swift/container-server/4.conf) Starting account-server...(/etc/swift/account-server/1.conf) Starting account-server...(/etc/swift/account-server/2.conf) Starting account-server...(/etc/swift/account-server/3.conf) Starting account-server...(/etc/swift/account-server/4.conf) Starting object-server...(/etc/swift/object-server/1.conf) Starting object-server...(/etc/swift/object-server/2.conf) Starting object-server...(/etc/swift/object-server/3.conf) Starting object-server...(/etc/swift/object-server/4.conf) Traceback (most recent call last): File "/usr/local/bin/swift-proxy-server", line 22, in <module> run_wsgi(conf_file, 'proxy-server', default_port=8080, *options) File "/root/swift/swift/common/wsgi.py", line 256, in run_wsgi File "/root/swift/swift/common/wsgi.py", line 107, in wrapper File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp return loadobj(APP, uri, name=name, *kw) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 271, in loadobj global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig return loader.get_context(object_type, name, global_conf) File "/root/swift/swift/common/wsgi.py", line 55, in get_context File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 450, in get_context global_additions=global_additions) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 562, in _pipeline_app_context for name in pipeline[:-1]] File "/root/swift/swift/common/wsgi.py", line 55, in get_context File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 454, in get_context section) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 476, in _context_from_use object_type, name=use, global_conf=global_conf) File "/root/swift/swift/common/wsgi.py", line 55, in get_context File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 406, in get_context global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext global_conf=global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 328, in _loadegg return loader.get_context(object_type, name, global_conf) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 620, in get_context object_type, name=name) File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 646, in find_egg_entry_point possible.append((entry.load(), protocol, entry.name)) File "/usr/local/lib/python2.7/dist-packages/pkg_resources ...
(more)
edit retag flag offensive close merge delete

Comments

Can you please post the complete log or stacktrace?

Jobin gravatar imageJobin ( 2013-09-12 08:39:01 -0600 )edit

Thanks Jobin. Sorry for replying you late. Here is the complete error which I get: Starting proxy-server...(/etc/swift/proxy-server.conf) Starting container-server...(/etc/swift/container-server/1.conf) Starting container-server...(/etc/swift/container-server/2.conf) Starting container-server...(/etc/swift/container-server/3.conf) Starting container-server...(/etc/swift/container-server/4.conf) Starting account-server...(/etc/swift/account-server/1.conf) Starting account-server...(/etc/swift/account-server/2.conf) Starting account-server...(/etc/swift/account-server/3.conf) Starting account-server...(/etc/swift/account-server/4.conf) Starting object-server...(/etc/swift/object-server/1.conf) Starting object-server...(/etc/swift/object-server/2.conf) Starting object-server...(/etc/swift/object-server/3.conf) Starting object-server...(/etc/swift/object-server/4.conf) Traceback (most recent call last): File "/usr/local/bin/swift-proxy-server", line 22, in <module> run_wsgi(conf_f

racom88 gravatar imageracom88 ( 2013-09-15 10:47:44 -0600 )edit

2 answers

Sort by » oldest newest most voted
2

answered 2013-09-18 06:40:58 -0600

racom88 gravatar image

updated 2013-09-18 07:33:21 -0600

Yahooo!!!!!! Finally It worked. :) After doing the following changes:

  1. Check out the python-swiftclient repo:

    git clone https://github.com/openstack/python-swiftclient.git
    
  2. Build a development installation of python-swiftclient

    cd ~/python-swiftclient; sudo python setup.py build; sudo python setup.py install; cd -
    
  3. Check out the swift repo

    git clone https://github.com/openstack/swift.git
    
  4. Build a development installation of swift

    cd ~/swift; sudo python setup.py build; sudo python setup.py install; cd -
    
  5. Install swift’s test dependencies

    sudo pip install -r swift/test-requirements.txt
    
edit flag offensive delete link more

Comments

Please click the "tick" next to your answer to mark it as the accepted answer to this question. This will prevent the question being listed as unanswered. Thanks!

sgordon gravatar imagesgordon ( 2013-09-19 08:26:17 -0600 )edit
1

it still doesn't work. same error is coming again

pragya jain gravatar imagepragya jain ( 2013-11-18 22:10:06 -0600 )edit
1

answered 2013-09-17 00:57:48 -0600

clayg gravatar image

This looks like a standard run of the mill install error. The following normally works:

cd ~/swift/  # /root/swift seems to be the current install location according to your traceback
pip install --upgrade distribute  # or maybe setuptools
pip install -U -r requirements.txt
python setup.py develop

If you're still having problems it may be something with how pkg_resources is exposing the entry_points from swift to paste - weird stuff been goin' on since distribute took over and setuptools started up versionin' again...

(e.g.https://bitbucket.org/pypa/setuptools/issue/73/typeerror-dist-must-be-a-distribution)

What does the following print your your system:

cd ~; python -c 'import pkg_resources, pprint; pprint.pprint(pkg_resources.get_entry_map(pkg_resources.get_distribution("swift")))'

Here's mine:

http://paste.openstack.org/show/47137/

edit flag offensive delete link more

Comments

1

didn't worked. What to do now? Please suggest some easy method to identify the root cause. I am a novice in OpenStack.

racom88 gravatar imageracom88 ( 2013-09-18 01:50:21 -0600 )edit

@racom88 If you can give a fresh start & follow the steps as mentioned above it will be helpful. Cheers, atul

koolhead17 gravatar imagekoolhead17 ( 2013-11-11 06:51:55 -0600 )edit

these steps are not working output of these commands: cd ~; python -c 'import pkg_resources, pprint; pprint.pprint(pkg_resources.get_entry_map(pkg_resources.get_distribution("swift")))' is http://paste.openstack.org/show/53579/ what should I do now? Please help

pragya jain gravatar imagepragya jain ( 2013-11-18 22:20:22 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-09-12 01:16:07 -0600

Seen: 1,516 times

Last updated: Sep 18 '13