keystone s3_token middleware not usable

Bug #1231339 reported by James Page
50
This bug affects 11 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
High
Brant Knudson
python-keystoneclient
Invalid
High
Unassigned
swift (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

s3 middleware authentication is causing swift-proxy server to fail to start:

proxy-server (21880) appears to have stopped
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 256, in run_wsgi
    loadapp(conf_path, global_conf={'log_name': log_name})
  File "/usr/lib/python2.7/dist-packages/swift/common/wsgi.py", line 107, in wrapper
    return f(conf_uri, *args, **kwargs)
  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/swift/common/wsgi.py", line 55, in get_context
    object_type, name=name, global_conf=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/swift/common/wsgi.py", line 55, in get_context
    object_type, name=name, global_conf=global_conf)
  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 2015, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/dist-packages/keystone/middleware/__init__.py", line 18, in <module>
    from keystone.middleware.core import *
  File "/usr/lib/python2.7/dist-packages/keystone/middleware/core.py", line 21, in <module>
    from keystone.common import utils
  File "/usr/lib/python2.7/dist-packages/keystone/common/utils.py", line 32, in <module>
    from keystone import exception
  File "/usr/lib/python2.7/dist-packages/keystone/exception.py", line 63, in <module>
    class ValidationError(Error):
  File "/usr/lib/python2.7/dist-packages/keystone/exception.py", line 64, in ValidationError
    message_format = _("Expecting to find %(attribute)s in %(target)s."
NameError: name '_' is not defined

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: swift-proxy 1.9.1-0ubuntu2
ProcVersionSignature: Ubuntu 3.11.0-4.9-generic 3.11.0-rc7
Uname: Linux 3.11.0-4-generic x86_64
ApportVersion: 2.12.4-0ubuntu1
Architecture: amd64
Date: Thu Sep 26 09:14:50 2013
Ec2AMI: ami-00000092
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: aki-00000002
Ec2Ramdisk: ari-00000002
MarkForUpload: True
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: swift
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
James Page (james-page) wrote :
Revision history for this message
James Page (james-page) wrote :

Configuration for s3 auth:

[filter:s3token]
paste.filter_factory = keystone.middleware.s3_token:filter_factory
service_host = 10.5.0.51
service_port = 5000
auth_port = 35357
auth_host = 10.5.0.51
auth_protocol = http
auth_token = ubuntutesting
admin_token = ubuntutesting

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

Revision history for this message
Denis Sobolev (dns-sobol) wrote :

Add in /usr/lib/python2.7/dist-packages/keystone/exception.py next line

from keystone.openstack.common.gettextutils import _

after
from keystone.openstack.common import log as logging

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in swift (Ubuntu):
status: New → Confirmed
affects: swift → python-keystoneclient
Wei T (nuaafe)
information type: Public → Public Security
Dolph Mathews (dolph)
Changed in python-keystoneclient:
importance: Undecided → High
milestone: none → 0.5.2
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

Why is that public security? AFAIK the version from keystoneclient should work it's the version of keystone which is deprecated (and should just be a shim to load the version from keystone like we did in authtoken) that has this bug.

Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

but we still need to backport that for havana

Revision history for this message
Dolph Mathews (dolph) wrote :

Removed the Public Security status; if this should be Public Security, please provide justification.

information type: Public Security → Public
Revision history for this message
Jamie Lennox (jamielennox) wrote :

@Dolph: This would appear to me to be a keystone issue or possibly swift should be doing gettext before importing the middleware. There are no gettext translations in the client.

The exception here is coming from keystone - Swift should update to use s3token from keystoneclient now that has been released.

Setting to keystone, send it back if i'm wrong.

Changed in python-keystoneclient:
status: New → Invalid
Changed in keystone:
importance: Undecided → High
Dolph Mathews (dolph)
Changed in python-keystoneclient:
milestone: 0.5.2 → none
Revision history for this message
Brant Knudson (blk-u) wrote :

The s3_token middleware was moved from keystone to keystoneclient and is left deprecated in keystone. It's in the 0.6.0 version of keystoneclient. Applications should use s3_token from keystoneclient rather than from keystone.

Users of the keystone version will have to do a gettext.install() to set the _ builtin.

Changed in keystone:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Dolph Mathews (dolph)
Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)
James Page (james-page)
Changed in swift (Ubuntu):
status: Confirmed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.