Swift S3 error: No module named s3_token [closed]

asked 2013-08-06 13:07:23 -0600

RohitGupta gravatar image

updated 2013-08-07 11:04:28 -0600

smaffulli gravatar image

Hi Experts,

I have managed to get the Swift installation working correctly with the Swift API's using Keystone. But I am currently having issues when starting the Proxy after adding the Swift3 setup into the Proxy config and I was hoping someone could point me in the right direction.

I am receiving the following error when restarting the proxy service using "swift-init proxy restart"

root@proxy:~# swift-init proxy restart
Signal proxy-server  pid: 1707  signal: 15
No proxy-server running
Starting proxy-server...(/etc/swift/proxy-server.conf)
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.7/dist-packages/swift/common/wsgi.py", line 119, in run_wsgi
    init_request_processor(conf_file, app_section, *args, **kwargs)
  File "/usr/lib/python2.7/dist-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.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
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
  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 "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 450, in get_context
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 562, in _pipeline_app_context
    for name in pipeline[:-1]]
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 458, in get_context
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 517, in _context_from_explicit
    value = import_string(found_expr)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 22, in import_string
    return pkg_resources.EntryPoint.parse("x=" + s).load(False)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named s3_token

My current setup is as follows:

proxy server:
Storage node:

Proxy-server.conf :
bind_port = 8080
user = swift

pipeline = catch_errors healthcheck cache swift3 s3token  authtoken keystoneauth proxy-server

use = egg:swift#proxy
allow_account_management = true
account_autocreate = true

use = egg:swift#keystoneauth
operator_roles = Member,admin,swiftoperator

paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory

# Delaying the auth decision is required to support token-less
# usage for anonymous referrers ('.r:*').
delay_auth_decision = true

# cache directory for signing certificate
signing_dir = /home/swift/keystone-signing

# auth_* settings refer to the Keystone server
auth_protocol = http
auth_host =
auth_port = 35357

# the same admin_token as provided in keystone.conf
admin_token = ADMIN

# the service tenant and swift userid and password created in Keystone
admin_tenant_name = service
admin_user = swift
admin_password = swift

use = egg:swift#memcache
use = egg:swift#catch_errors

use = egg:swift#healthcheck

use = egg:swift3#swift3

[filter:s3token ...
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by RohitGupta
close date 2013-08-09 03:26:55.738503

2 answers

Sort by ยป oldest newest most voted

answered 2013-08-07 11:35:29 -0600

RohitGupta gravatar image

updated 2013-08-08 11:45:54 -0600

smaffulli gravatar image

I have resolved this issue- need to perform the following 2 steps:

  • Step 1: as s3_token is a part of keystone and not keystoneclient, hence i have to install python-keystone on the proxy server.
  • step 2: i have to replace the line paste.filter_factory = keystoneclient.middleware.s3_token:filter_factory to paste.filter_factory = keystone.middleware.s3_token:filter_factory

after the above 2 steps my proxy-service is running.

edit flag offensive delete link more



Thanks for sharing how you solved the original problem. If you have new issues please ask them in new questions: it keeps this site more useful this way. See https://ask.openstack.org/faq

smaffulli gravatar imagesmaffulli ( 2013-08-08 11:44:43 -0600 )edit

answered 2013-08-07 04:19:00 -0600

rahmu gravatar image

Are you sure the module is installed on your PC? On Ubuntu, there's a package called swift-plugin-s3. There's probably something similar for every platform.

root@swift1:~# apt-cache search swift3
swift-plugin-s3 - swift3 (S3 compatibility) middleware plugin for swift

root@swift1:~# apt-cache policy swift-plugin-s3
  Installed: (none)
  Candidate: 1.7-3~bpo70+1
  Version table:
     1.0.0~git201200618-0ubuntu1~cloud0 0
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu/ precise-updates/grizzly/main amd64 Packages
edit flag offensive delete link more


Hi Rahmu, Thanks for the response. I have followed the command you suggested on swift proxy-server and got the below output: root@proxy:~# apt-cache search swift3 swift-plugin-s3 - swift3 middleware for swift. root@proxy:~# apt-cache policy swift-plugin-s3 swift-plugin-s3: Installed: 1.0.0~git201200618-0ubuntu1~cloud0 Candidate: 1.0.0~git201200618-0ubuntu1~cloud0 Version table: *** 1.0.0~git201200618-0ubuntu1~cloud0 0 500 http://ubuntu-cloud.archive.canonical.com/ubuntu/ precise-updates/grizzly/main amd64 Packages 100 /var/lib/dpkg/status root@proxy:~# Please suggest what next - thanks

RohitGupta gravatar imageRohitGupta ( 2013-08-07 04:23:06 -0600 )edit

I have one more question for clarification - we are building the openstack staging to test how our application will work with swift object storage. Currently we are hosting ec2 and S3 storage with amazon and our future plan is to build swift and have our own private cloud. Now I know that swift works on Rest API's and our 3rd party application uses S3 api to communicate with amazon objects. Now do I really need this S3 emulation with swift for my 3rd party apps to work with Swift or I can use swift ReST APIs to work? Also, what is the benefit of emulating with S3 if we will be hosting our own private cloud based on openstack swift? please suggest

RohitGupta gravatar imageRohitGupta ( 2013-08-07 04:31:03 -0600 )edit

Rahmu - The swift version is showing 1.0, which I thing is very old. can this be the cause of issue? if yes then how can I update it to the latest version?

RohitGupta gravatar imageRohitGupta ( 2013-08-07 04:33:34 -0600 )edit

RohitGupta: It seems that you have `swift3` installed correctly. Can you edit your question to add more detail on how you installed Swift?

rahmu gravatar imagerahmu ( 2013-08-07 04:37:30 -0600 )edit

To answer your second question in the comments: AFAIK Swift will behave fairly the same way, no matter which API you use. Emulating S3 API in front of Swift will allow you to use your 3rd party app unchanged. If you want to use the Swift API, you'll have to modify your app.

rahmu gravatar imagerahmu ( 2013-08-07 04:39:04 -0600 )edit

I have used the following link to install Swift: http://docs.openstack.org/trunk/openstack-object-storage/admin/content/configuring-openstack-object-storage-with-s3_api.html Firstly, I tried installing by apt-get install swift-python-s3, but it didn't installed and gave unable to locate package. then I installed by following these commands: git clone https://github.com/fujita/swift3.git cd swift3; git checkout v1.7 python setup.py install After that I configured the proxy server and got the error message while starting the proxy services. You wont believe after the above commands, when I tried again apt-get install swift-python-s3 command. I was able to install this too.

RohitGupta gravatar imageRohitGupta ( 2013-08-07 04:48:01 -0600 )edit

one more question - in your previous post you uploaded your server output of apt-cache search swift3 swift-plugin-s3 - swift3 (S3 compatibility) middleware plugin for swift ,whereas my output does not says S3 compatibility before middleware. and your candidate version is 1.7-3 as compared to mine 1.0.0 --- do you think this has something to do with the issue.

RohitGupta gravatar imageRohitGupta ( 2013-08-07 04:50:20 -0600 )edit

Rahmu - any other suggestion?

RohitGupta gravatar imageRohitGupta ( 2013-08-07 06:48:54 -0600 )edit

Hi Experts, On further research - as I have a multi node setup whereby keystone: proxy server I am using keystoneclient in the proxy-server.conf and if i see the middleware available in the following folder, then i cant see s3_token.py: root@proxy:/usr/lib/python2.7/dist-packages/keystoneclient/middleware# ls auth_token.py __init__.py memcache_crypt.py test.py auth_token.pyc __init__.pyc memcache_crypt.pyc test.pyc root@proxy:/usr/lib/python2.7/dist-packages/keystoneclient/middleware# Does keystoneclient support s3_token? why s3_token.py is missing and can it be the cause for the error message?

RohitGupta gravatar imageRohitGupta ( 2013-08-07 07:29:46 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-08-06 13:07:23 -0600

Seen: 1,026 times

Last updated: Aug 08 '13