redhat-cip / swift-middleware-sample

Example how to develop wsgi and Swift middlewares
6 stars 6 forks source link

Entry point 'middleware' not found in egg 'sample' #1

Open koralik opened 9 years ago

koralik commented 9 years ago

Hi, I've tried to install this example.

[root@titanic swift-middleware-sample-master]# python setup.py develop running develop running egg_info writing sample.egg-info/PKG-INFO writing top-level names to sample.egg-info/top_level.txt writing dependency_links to sample.egg-info/dependency_links.txt writing entry points to sample.egg-info/entry_points.txt reading manifest file 'sample.egg-info/SOURCES.txt' writing manifest file 'sample.egg-info/SOURCES.txt' running build_ext Creating /usr/lib/python2.6/site-packages/sample.egg-link (link to .) sample 0.0.0 is already the active version in easy-install.pth

Installed /root/swift-middleware-sample-master Processing dependencies for sample==0.0.0 Finished processing dependencies for sample==0.0.0

/etc/swift/proxy-server.conf has been modified as in config.ini from your project:

[pipeline:main] pipeline = healthcheck cache authtoken keystoneauth middleware sample proxy-server [filter:middleware] use = egg:sample#middleware [app:sample] use = egg:sample#app

But then I restart swift-proxy with command: service openstack-swift-proxy restart entry points are not found:

File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 659, in find_egg_entry_point for prot in protocol_options] or '(no entry points)')))) LookupError: Entry point 'middleware' not found in egg 'sample' (dir: /root/swift-middleware-sample-master; protocols: paste.filter_factory, paste.filter_app_factory; entry_points: )

cschwede commented 9 years ago

Did you install the middleware using

python setup.py install

before restarting the proxy? Please also note that the config.ini is not for Swift. I added a README.md, and also linked the the video + slides for this code (this is sample code used during a talk).

Christian

koralik commented 9 years ago

Hi Thanks for hints.

  1. I've fixed proxy-server.conf (now only middleware in pipeline).
  2. Previously I used in python setup.py command develop in place of install Now it works fine! But ..... :) It work only when authorization on pipeline is set to tempauth as: pipeline = catch_errors healthcheck proxy-logging cache tempauth imagepreview proxy-server when I return to our base settings (authtoken keystoneauth): pipeline = catch_errors healthcheck proxy-logging cache authtoken keystoneauth imagepreview proxy-server then swift file upload command fails on

Dec 1 12:39:19 controller proxy-server: ERROR Unhandled exception in request: #012Traceback (most recent call last):#012 File "/usr/lib/python2.6/site-packages/swift/proxy/server.py", line 347, in handle_request#012 resp = req.environ'swift.authorize'#012 File "/usr/lib/python2.6/site-packages/swift/common/middleware/keystoneauth.py", line 183, in authorize#012 tenant_id, tenant_name = env_identity['tenant']#012TypeError: 'NoneType' object is unsubscriptable (txn: txdb72a472a9934cab920c0-00547c5367)

I suppose, that there is a problem in interaction beetwen keystoneauth and next step (imagepreview). If you have any hints. I'll appreciate.

BR Pavel

cschwede commented 9 years ago

Hmm, this looks strange. It seems that the error is not related to the imagepreview middleware, but to Keystone. Is Swift working correctly using Keystone, but without the imagepreview middleware?

I tried to reproduce this error, but it works for me.