Ask Your Question
0

Swift S3 error: No module named s3_token [closed]

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

RohitGupta gravatar image

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

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
    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 "/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 "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 458, in get_context
    section)
  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:

Controller(keystone): 10.0.0.151
proxy server: 10.0.0.154
Storage node: 10.0.0.155

Proxy-server.conf :
[DEFAULT]
bind_port = 8080
user = swift

[pipeline:main]
pipeline = catch_errors healthcheck cache swift3 s3token  authtoken keystoneauth proxy-server

[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = true

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

[filter:authtoken]
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 = 10.0.0.151
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

[filter:cache]
use = egg:swift#memcache
memcache_servers=10.0.0.154
[filter:catch_errors]
use = egg:swift#catch_errors

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

[filter:swift3]
use = egg:swift3#swift3

[filter:s3token ...
(more)
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
2

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

RohitGupta gravatar image

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

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

Comments

1

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 -0500 )edit
0

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

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
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

Comments

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 -0500 )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 -0500 )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 -0500 )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 -0500 )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 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 941 times

Last updated: Aug 08 '13