Ask Your Question
0

swift - Account HEAD failed: 401 Unauthorized - Kilo CentOS 7 [closed]

asked 2015-08-18 08:23:52 -0500

Kairo gravatar image

updated 2015-08-18 15:44:53 -0500

I'm making a installation using Kilo document on CentOS 7.

On the chapter, Add object Storage, in verification part I received this error:

# swift -V 3 stat Account HEAD failed: http://ctl1srv:8080/v1/AUTH_dc182f2c475846889c7cb68602439d84 401 Unauthorized

I tried some solutions from the http://ask.openstack.org but without success.

  • ctl1srv is my controller and proxy-server

My output using --debug of this command:

# swift --debug -V 3 stat
DEBUG:keystoneclient.auth.identity.v3.base:Making authentication request to http://ctl1srv:35357/v3/auth/tokens
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): ctl1srv
DEBUG:requests.packages.urllib3.connectionpool:"POST /v3/auth/tokens HTTP/1.1" 201 4777
DEBUG:iso8601.iso8601:Parsed 2015-08-18T14:05:06.517573Z into {'tz_sign': None, 'second_fraction': u'517573', 'hour': u'14', 'daydash': u'18', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'06', 'tz_minute': None, 'year': u'2015', 'separator': u'T', 'monthdash': u'08', 'day': None, 'minute': u'05'} with default timezone <iso8601.iso8601.Utc object at 0x7f703402f690>
DEBUG:iso8601.iso8601:Got u'2015' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'08' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 8 for 'month' with default 8
DEBUG:iso8601.iso8601:Got u'18' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 18 for 'day' with default 18
DEBUG:iso8601.iso8601:Got u'14' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'05' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'06' for 'second' with default None
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): ctl1srv
DEBUG:requests.packages.urllib3.connectionpool:"HEAD /v1/AUTH_dc182f2c475846889c7cb68602439d84 HTTP/1.1" 401 0
INFO:swiftclient:REQ: curl -i http://ctl1srv:8080/v1/AUTH_dc182f2c475846889c7cb68602439d84 -I -H "X-Auth-Token: 706f5084859f46c0a85218b14d3fd76c"
INFO:swiftclient:RESP STATUS: 401 Unauthorized
INFO:swiftclient:RESP HEADERS: [('content-length', '0'), ('connection', 'keep-alive'), ('x-trans-id', 'txd53dbe85554f4144b4949-0055d32d82'), ('date', 'Tue, 18 Aug 2015 13:05:06 GMT'), ('content-type', 'text/html; charset=UTF-8'), ('www-authenticate', 'Swift realm="AUTH_dc182f2c475846889c7cb68602439d84"')]
DEBUG:keystoneclient.auth.identity.v3.base:Making authentication request to http://ctl1srv:35357/v3/auth/tokens
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): ctl1srv
DEBUG:requests.packages.urllib3.connectionpool:"POST /v3/auth/tokens HTTP/1.1" 201 4777
DEBUG:iso8601.iso8601:Parsed 2015-08-18T14:05:07.854012Z into {'tz_sign': None, 'second_fraction': u'854012', 'hour': u'14', 'daydash': u'18', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'07', 'tz_minute': None, 'year': u'2015', 'separator': u'T', 'monthdash': u'08', 'day': None, 'minute': u'05'} with default timezone <iso8601.iso8601.Utc object at 0x7f703402f690>
DEBUG:iso8601.iso8601:Got u'2015' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'08' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 8 for 'month' with default 8
DEBUG:iso8601.iso8601:Got u'18' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 18 for 'day' with default 18
DEBUG:iso8601.iso8601:Got u'14' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'05' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'07 ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Kairo
close date 2015-08-20 08:34:15.563494

Comments

there may be something in /var/log/swift/swift.log, but I would not hold my breath

zaitcev gravatar imagezaitcev ( 2015-08-18 15:15:18 -0500 )edit

Yes, I've some erros in /var/log/swift/swift.log. I updated my ask with logs.

Kairo gravatar imageKairo ( 2015-08-18 15:33:24 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-08-20 08:31:56 -0500

Kairo gravatar image

The problem occurs when you use a password for the user swift (on the keystone) with special characters as !@#$% etc and you put between ' ' or " " in the /etc/swift/proxy-server.conf on [filter:authtoken] session.

In others services like cinder, nova, glance etc is necessary put the password with these characters between " " or ' '.

Example:

[filter:authtoken]
...
username = swift
password = "!this_is_my_swift_passwd$"
delay_auth_decision = true

Try change to:

[filter:authtoken]
...
username = swift
password = !this_is_my_swift_passwd$
delay_auth_decision = true
edit flag offensive delete link more
0

answered 2015-08-19 04:30:31 -0500

Looks like the authtoken middleware is failing to authenticate with keystone service. i.e. the swift service is failing to authenticate itself with keystone when it attempts to validate the token sent with the request.

The log messages you see are from authtoken, e.g.: https://github.com/openstack/keystonemiddleware/blob/master/keystonemiddleware/auth_token/__init__.py#L821 (https://github.com/openstack/keystone...)

Check the steps here http://docs.openstack.org/kilo/install-guide/install/yum/content/swift-install-controller-node.html (http://docs.openstack.org/kilo/instal...) "Create the swift user" ... and check that the password that you set for the swift service at this step matches the value in proxy-server.conf [filter:authtoken] section.

To see more detailed logging in proxy.log, add log_level = DEBUG to the [DEFAULT] section of proxy-server.conf.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2015-08-18 08:23:52 -0500

Seen: 1,485 times

Last updated: Aug 20 '15