swauth-prep : httplib.BadStatusLine

Asked by tienbm

Hi.
I try to run swauth using command :

 swauth-prep -K swauthkey
Traceback (most recent call last):
  File "/usr/local/bin/swauth-prep", line 5, in <module>
    pkg_resources.run_script('swauth==1.0.3.dev', 'swauth-prep')
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 467, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1200, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.6/dist-packages/swauth-1.0.3.dev-py2.6.egg/EGG-INFO/scripts/swauth-prep", line 57, in <module>
    resp = conn.getresponse()
  File "/usr/lib/python2.6/dist-packages/swift/common/bufferedhttp.py", line 95, in getresponse
    response = HTTPConnection.getresponse(self)
  File "/usr/lib/python2.6/httplib.py", line 990, in getresponse
    response.begin()
  File "/usr/lib/python2.6/httplib.py", line 391, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.6/httplib.py", line 355, in _read_status
    raise BadStatusLine(line)

Here's my proxy-server.config :

[DEFAULT]
cert_file = /etc/swift/cert.crt
key_file = /etc/swift/cert.key
bind_port = 8080
workers = 8
user = swift

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

[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
set log_name=swift-proxy
set log_level = DEBUG
set log_headers =True

[filter:swauth]
use = egg:swauth#swauth
set log_name = swift-swauth
set log_level =DEBUG
set log_headers= True
super_admin_key = swauthkey
defaul_swift_cluster = local#https://10.2.48.90:8080/v1

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

[filter:cache]
use = egg:swift#memcache
memcache_servers = 10.2.48.90:11211

Please help me resolve this problem.
Thank.

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
Marcelo Martins (btorch) said :
#1

Try giving the Auth URL ... you can find out the flags with --help

Revision history for this message
Hugo Kou (tonytkdk) said :
#2

root@swift:~# swauth-prep -K skey -A http://127.0.0.1:8080/v1
Auth subsystem prep failed: 401 Unauthorized
root@swift:~# swauth-prep -K skey -A http://127.0.0.1:8080/auth
Auth subsystem prep failed: 500 Server Error
root@swift:~# swauth-prep -K skey -A http://127.0.0.1:8080/auth/v1.0
Auth subsystem prep failed: 400 Bad Request
root@swift:~# swauth-prep -K skey -A http://127.0.0.1:8080
Auth subsystem prep failed: 401 Unauthorized

withi Swauth + swift 1.4.4 .......which line is correct to initialize the Swauth backing store ??

My proxy-server.conf :

[DEFAULT]
bind_port = 8080
user = root
log_facility = LOG_LOCAL1

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

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

[filter:swauth]
use = egg:swauth#swauth
set log_name = swift-swauth
set log_level =DEBUG
set log_headers= True
super_admin_key = skey
defaul_swift_cluster = local#http://192.168.1.104:8080/v1#http://127.0.0.1:8080/v1

#[filter:keystone]
#use = egg:keystone#tokenauth
#auth_protocol = http
#auth_host = 192.168.1.105
#auth_port = 35357
#admin_token = 999888777666
#delay_auth_decision = 0
#service_protocol = http
#service_host = 192.168.1.105
#service_port = 8100
#service_pass = dTpw

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

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

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

Revision history for this message
Marcelo Martins (btorch) said :
#3

Hi Hugo,

Two things you need to correct.

1) Your proxy-server.conf needs to have "#allow_account_management = true" uncommented.
2) Your "swift-prep" command needs to have the URL as it's shown in the help output
* Obviously if you change port numbers and enable SSL, you would modify the Auth URL according to your changes.

So, the command you should run is "swauth-prep -K skey -A http://127.0.0.1:8080/auth/"

root@saio-1:~# swauth-prep --help
Usage: swauth-prep [options]

Options:
  -h, --help show this help message and exit

  -A ADMIN_URL, --admin-url=ADMIN_URL
                        The URL to the auth subsystem (default:
                        http://127.0.0.1:8080/auth/

  -U ADMIN_USER, --admin-user=ADMIN_USER
                        The user with admin rights to add users (default:
                        .super_admin).

  -K ADMIN_KEY, --admin-key=ADMIN_KEY
                        The key for the user with admin rights to add users.

Revision history for this message
Hugo Kou (tonytkdk) said :
#4

Thanks btorch........
very clear now

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

I tried the same command

swauth-prep -U .super_admin -K swauthkey -A http://192.168.1.214:8080/auth

It is working fine in my command line but my Dashboard Containers listing is giving problem

proxy-server.conf
--------------------

[DEFAULT]
# cert_file = /etc/swift/cert.crt
# key_file = /etc/swift/cert.key
bind_port = 8080
workers = 8
user = swift

[pipeline:main]
# For DevAuth:
# pipeline = healthcheck cache auth proxy-server
# For Swauth:
pipeline = healthcheck cache swauth proxy-server

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

# Only needed for DevAuth
# [filter:auth]
# use = egg:swift#auth
# ssl = true

# Only needed for Swauth
[filter:swauth]
use = egg:swift#swauth
set log_name = swift-swauth
set log_level =DEBUG
set log_headers= True
default_swift_cluster = local#http://192.168.1.214:8080/v1#http://127.0.0.1:8080/v1
# Highly recommended to change this key to something else!
super_admin_key = swauthkey

#[filter:authtoken]
#paste.filter_factory = keystone.middleware.auth_token:filter_factory
#service_protocol = http
#service_host = 192.168.1.213
#service_port = 5000
#auth_host = 192.168.1.213
#auth_port = 35357
#auth_protocol = http
#auth_uri = http://192.168.1.213:5000/
#admin_tenant_name = service
#admin_user = swift
#admin_password = swift
#delay_auth_decision = 0

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

[filter:cache]
use = egg:swift#memcache
memcache_servers = 192.168.1.214:11211
set log_name = cache

If I add the following in the proxy server, I am getting "Auth subsystem prep failed: 500 Server Error" and still the dashboard fails

[filter:swiftauth]
paste.filter_factory = keystone.middleware.swift_auth:filter_factory
operator_roles = admin, SwiftOperator
is_admin = true

[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
service_protocol = http
service_host = 192.168.1.213
service_port = 5000
auth_host = 192.168.1.213
auth_port = 35357
auth_protocol = http
auth_uri = http://192.168.1.213:5000/
admin_tenant_name = service
admin_user = swift
admin_password = swift
delay_auth_decision = 0

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

forgot to mention the version i am installing essex

Can you help with this problem?

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

To post a message you must log in.