Error setting up SAIO: middleware.healthcheck not found

Asked by jwt

warning - complete python newbie! Trying to get SAIO ruinning in a VM - followed guide but getting the followiing on startmain:

root@ubuntu:/var/log# startmain
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 7, in <module>
    execfile(__file__)
  File "/root/swift/trunk/bin/swift-proxy-server", line 22, in <module>

  File "/root/swift/trunk/swift/common/wsgi.py", line 122, in run_wsgi
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 204, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 224, in loadobj
    global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 248, in loadcontext
    global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 278, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 405, in get_context
    global_additions=global_additions)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 503, in _pipeline_app_context
    for name in pipeline[:-1]]
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 409, in get_context
    section)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 431, in _context_from_use
    object_type, name=use, global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 361, in get_context
    global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 248, in loadcontext
    global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 285, in _loadegg
    return loader.get_context(object_type, name, global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 561, in get_context
    object_type, name=name)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 587, in find_egg_entry_point
    possible.append((entry.load(), protocol, entry.name))
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named middleware.healthcheck

Hints?

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Solved by:
jwt
Solved:
Last query:
Last reply:
Revision history for this message
clayg (clay-gerrard) said :
#1

double check for typos in your proxy-server.conf:
http://swift.openstack.org/development_saio.html#configuring-each-node

especially make sure that the helthcheck section is correct:
[filter:healthcheck]
use = egg:swift#healthcheck

Revision history for this message
jwt (james-turner-sr) said :
#2

Looks OK - pretty much a copy/paste from the setup page. I am wondering if I need to re-load the code base since the module seems to be missing: "ImportError: No module named middleware.healthcheck"

Revision history for this message
gholt (gholt) said :
#3

In the setup.py, it says (for the filter_factory installation):

healthcheck=swift.common.middleware.healthcheck:filter_factory

And the config should have:

[filter:healthcheck]
use = egg:swift#healthcheck

So I'm not sure why yours is trying to import middleware.healthcheck instead of swift.common.middleware.healthcheck

Revision history for this message
gholt (gholt) said :
#4

Eh, I accidentally marked this as answered, which I definitely haven't done. :)

Revision history for this message
Mike Scherbakov (mihgen) said :
#5

I had the same issue installing from http://swift.openstack.org/development_saio.html

The issue has been resolved when I ran
python setup.py install , not python setup.py develop

Revision history for this message
jwt (james-turner-sr) said :
#6

Just getting back to this after a real work break. Thanks for your suggestion - that solved the issue. Not sure what the setup differences are between install and develop, but after I that things went fairly smoothly. I had some additional issues with the logical links for the loopback storage setup (I think the swift reset script breaks those) but there were some other notes in here that gave me enough clues to fix that too. Wish I had kept notes.

Revision history for this message
Ivan Bondarev (vanch-deactivatedaccount) said :
#7

In spite of these advices i still have this issue.

(venv) # swift-init proxy no-daemon
Starting proxy-server...(/etc/swift/proxy-server.conf)
Traceback (most recent call last):
  File "/home/vanch/venv/bin/swift-proxy-server", line 5, in <module>
  File "/home/vanch/venv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 461, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/vanch/venv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 1194, in run_script
    execfile(script_filename, namespace, namespace)
  File "/home/vanch/venv/lib/python2.6/site-packages/swift-1.4.9-py2.6.egg/EGG-INFO/scripts/swift-proxy-server", line 22, in <module>
  File "/home/vanch/venv/lib/python2.6/site-packages/swift-1.4.9-py2.6.egg/swift/common/wsgi.py", line 132, in run_wsgi
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 204, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 224, in loadobj
    global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 248, in loadcontext
    global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 278, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 405, in get_context
    global_additions=global_additions)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 503, in _pipeline_app_context
    for name in pipeline[:-1]]
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 409, in get_context
    section)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 431, in _context_from_use
    object_type, name=use, global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 361, in get_context
    global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 248, in loadcontext
    global_conf=global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 285, in _loadegg
    return loader.get_context(object_type, name, global_conf)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 561, in get_context
    object_type, name=name)
  File "/usr/lib/pymodules/python2.6/paste/deploy/loadwsgi.py", line 587, in find_egg_entry_point
    possible.append((entry.load(), protocol, entry.name))
  File "/home/vanch/venv/lib/python2.6/site-packages/distribute-0.6.10-py2.6.egg/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named middleware.healthcheck

If I remove a middleware instance in proxy pipeline then it argues on the next one and so on.
All of this is valid only when using virtualenv.

Revision history for this message
jk0833 (jyj0833) said :
#8

I had the same problem,solved by adding the line below in swift/common/wsgi.py
from swift.common.middleware import healthcheck, memcache, tempauth, proxy_logging

Revision history for this message
Brian Cline (briancline) said :
#9

Had the same issue, along with the same errors around both middleware.healthcheck and middleware.recon, but no longer a problem once I ran `python setup.py install`.

Seems like there is probably a specific reason this wouldn't have been reflected in the docs? Or is the desired fix to adjust what occurs when the development install is built?

Revision history for this message
janonymous (janonymous) said :
#10

Hi ,

I had the same issue, The problem here was with permissions for me i.e trying to run with root user (Code is installed in /root/swift location) but it was not able to find the modules.
After going the pbr and __import__ things i found that there is some problem in finding the module to import maybe ownership(chown) or some pkg_resources issue.
What i did was:
Give permissions to the USER ,you have given Ownership while installing in the steps before.
Like:
{Command}
root # chown -R <user>:<user> /root/swift/*
{Command}
Assuming you have code in /root/swift. This worked for me , maybe it might help someone facing the same issue.