Swauth: Account creation failed: 500 server error

Asked by Amit Jain

Hi all,

I've installed Swift as Swift-all-in-one as described in the

http://www.slideshare.net/joshuamckenty/openstack-swift-msst-2011-tutorial-day

the above describes Swift installation when Swauth was part of Swift. To work with current version, I had to install Swauth as a separate component.

That went good and I'm able to get proxy server up and running along with other components.

Doing this

swauth-prep -K swauthkey -U '.super_admin' -A https://192.168.6.128:443/auth/

works fine.

Now when I try to add users doing below:

swauth-add-user -K swauthkey -U '.super_admin' -A https://192.168.6.128:443/auth/ -a test tester testing

I get Account creation failed: 500 Server Error.

Seems like part of this command is working as when I do

swauth-list -K swauthkey -U '.super_admin' -A https://192.168.6.128:443/auth/

I see that the account has been added:

{"accounts": [{"name": "test"}]}

Could you help me to know what I'm doing wrong.

Here is my account server configuration:

[DEFAULT]
devices = /srv/1/node
mount_check = false
bind_port = 6012
user = swiftdemo
log_facility = LOG_LOCAL2

[pipeline:main]
pipeline = account-server

[app:account-server]
use = egg:swift#account

[account-replicator]
vm_test_mode = yes

[account-auditor]

[account-reaper]

And my proxy server configuration is:

[DEFAULT]
bind_port = 443
bind_ip = 192.168.6.128
cert_file = /etc/swift/cert.crt
key_file = /etc/swift/cert.key
user = swiftdemo
log_facility = LOG_LOCAL1

[pipeline:main]
pipeline = healthcheck cache swauth proxy-server

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

[filter:swauth]
use = egg:swauth#swauth
set log_name = swauth
super_admin_key = swauthkey
default_swift_cluster = local#https://127.0.0.1:443/v1

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

[filter:cache]
use = egg:swift#memcache

The swift.conf only has the configuration for swauthkey.

Please let me know if anything else is needed.
Thanks for help,
Amit

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Amit Jain (amit-k-jain) said :
#1

Output in /var/log/syslog shows following:

Nov 12 16:42:45 ubuntu proxy-server STDOUT: EXCEPTION IN handle: Traceback (most recent call last):#012

File "/usr/local/lib/python2.6/dist-packages/swauth-1.0.3.dev-py2.6.egg/swauth/middleware.py", line 415, in handle#012 return self.handle_request(req)(env, start_response)#012

File "/usr/local/lib/python2.6/dist-packages/swauth-1.0.3.dev-py2.6.egg/swauth/middleware.py", line 482, in handle_request#012 req.response = handler(req)#012

File "/usr/local/lib/python2.6/dist-packages/swauth-1.0.3.dev-py2.6.egg/swauth/middleware.py", line 1008, in handle_put_user#012 resp.headers['x-container-meta-account-id']}#012

File "/usr/lib/pymodules/python2.6/webob/headers.py", line 16, in __getitem__#012 raise KeyError(key)#012KeyError: 'x-container-meta-account-id'#012: {'HTTP_X_CF_TRANS_ID': 'tx9bf80c55-2c77-4823-b615-8255e31f07f9', 'SCRIPT_NAME': '/auth/v2/reseller/reseller', 'webob.adhoc_attrs': {'start_time': 1321144965.590857, 'bytes_transferred': '-', 'client_disconnect': False}, 'REQUEST_METHOD': 'PUT', 'PATH_INFO': '', 'SERVER_PROTOCOL': 'HTTP/1.0', 'QUERY_STRING': '', 'eventlet.posthooks': [(<bound method Swauth.posthooklogger of <swauth.middleware.Swauth object at 0x92b24ec>>, (<Request at 0x935828c PUT https://192.168.6.128/auth/v2/reseller/reseller>,), {})], 'SERVER_NAME': '192.168.6.128', 'REMOTE_ADDR': '192.168.6.128', 'eventlet.input': <eventlet.wsgi.Input object at 0x92bd30c>, 'HTTP_X_AUTH_ADMIN_KEY': 'firepass', 'wsgi.url_scheme': 'https', 'SERVER_PORT': '443', 'HTTP_X_AUTH_USER_KEY': 'reseller', 'HTTP_X_AUTH_ADMIN_USER': '.super_admin', 'HTTP_X_AUTH_USER_ADMIN': 'true', 'wsgi.input': <eventlet.wsgi.Input object at 0x92bd30c>, 'HTTP_HOST': '192.168.6.128', 'swift.cache': <swift.common.memcached.MemcacheRing object at 0x92b59ec>, 'HTTPS': 'on', 'wsgi.multithread': True, 'wsgi.version': (1, 0), 'GATEWAY_INTERFACE': 'CGI/1.1', 'wsgi.run_once': False, 'wsgi.errors': <swift.common.utils.LoggerFileObject object at 0x92b708c>, 'wsgi.multiprocess': False, 'CONTENT_TYPE': None, 'HTTP_ACCEPT_ENCODING': 'identity'}

Revision history for this message
Christophe Le Guern (c35sys) said :
#2

Try to modify "default_swift_cluster" in "[filter:swauth]" section as following:

default_swift_cluster = local#https://192.168.6.128:443/v1#https://127.0.0.1:443/v1

Then restart swift.

Another trick is to use https://github.com/btorch/swift-saio.sh, it will configure everything for you (with swauth).

Revision history for this message
Pugazhendhi (kpugazh-8) said :
#3

I did that and also I added
account_autocreate = true
in

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

still I am getting the same error I dont want to use the saio. What is the solution

Revision history for this message
shiki (wowraiha) said :
#4

I had the same problem.
Can someone show me how to solue this problem.

Can you help with this problem?

Provide an answer of your own, or ask Amit Jain for more information if necessary.

To post a message you must log in.