Account HEAD failed: http://controller:8080/v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 401 Unauthorized

I was trying to deploy openstack swift, all went well but verification failed and suck a lot of time after trying many things. Here are some tips in case one faces similar problem.

 Problem : Swift proxy is not authenticating user "demo"with keystone.

Reason 1: Account, container, object rings run on separate ports on controller. Many a time during doing redundant job of copyin and pasting stuff, one may forget to change the ports.

Reason 2: You need to restart the Apache server on which swift proxy runs. This apache server is same which exposes keystone authentication api's. Somehow new user is not identified by and you need to restart it on controller node.

# service apache2 restart



DEBUG:keystoneclient.auth.identity.v3.base:Making authentication request to http://controller:5000/v3/auth/tokens
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): controller
DEBUG:requests.packages.urllib3.connectionpool:"POST /v3/auth/tokens HTTP/1.1" 201 4738
DEBUG:iso8601.iso8601:Parsed 2016-03-07T17:22:22.226032Z into {'tz_sign': None, 'second_fraction': u'226032', 'hour': u'17', 'daydash': u'07', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'22', 'tz_minute': None, 'year': u'2016', 'separator': u'T', 'monthdash': u'03', 'day': None, 'minute': u'22'} with default timezone <iso8601.iso8601.Utc object at 0x7ff3eb0ffb90>
DEBUG:iso8601.iso8601:Got u'2016' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'03' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 3 for 'month' with default 3
DEBUG:iso8601.iso8601:Got u'07' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 7 for 'day' with default 7
DEBUG:iso8601.iso8601:Got u'17' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'22' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'22' for 'second' with default None
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): controller
DEBUG:requests.packages.urllib3.connectionpool:"HEAD /v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 HTTP/1.1" 401 0
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 -I -H "X-Auth-Token: 732f39d4581c470a9606fad40774fb98"
INFO:swiftclient:RESP STATUS: 401 Unauthorized
INFO:swiftclient:RESP HEADERS: [('Date', 'Mon, 07 Mar 2016 16:22:22 GMT'), ('Content-Length', '0'), ('Content-Type', 'text/html; charset=UTF-8'), ('Www-Authenticate', 'Swift realm="AUTH_f5d59946d78a4085ac5c02003c3dcf03"'), ('X-Trans-Id', 'txda0ea612e1f34e27b639c-0056ddaabe')]
DEBUG:keystoneclient.auth.identity.v3.base:Making authentication request to http://controller:5000/v3/auth/tokens
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): controller
DEBUG:requests.packages.urllib3.connectionpool:"POST /v3/auth/tokens HTTP/1.1" 201 4738
DEBUG:iso8601.iso8601:Parsed 2016-03-07T17:22:23.327847Z into {'tz_sign': None, 'second_fraction': u'327847', 'hour': u'17', 'daydash': u'07', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'23', 'tz_minute': None, 'year': u'2016', 'separator': u'T', 'monthdash': u'03', 'day': None, 'minute': u'22'} with default timezone <iso8601.iso8601.Utc object at 0x7ff3eb0ffb90>
DEBUG:iso8601.iso8601:Got u'2016' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'03' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 3 for 'month' with default 3
DEBUG:iso8601.iso8601:Got u'07' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 7 for 'day' with default 7
DEBUG:iso8601.iso8601:Got u'17' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'22' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'23' for 'second' with default None
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): controller
DEBUG:requests.packages.urllib3.connectionpool:"HEAD /v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 HTTP/1.1" 401 0
INFO:swiftclient:REQ: curl -i http://controller:8080/v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 -I -H "X-Auth-Token: 7c2fcb90d8b848a394d43c00c81a631b"
INFO:swiftclient:RESP STATUS: 401 Unauthorized
INFO:swiftclient:RESP HEADERS: [('Date', 'Mon, 07 Mar 2016 16:22:23 GMT'), ('Content-Length', '0'), ('Content-Type', 'text/html; charset=UTF-8'), ('Www-Authenticate', 'Swift realm="AUTH_f5d59946d78a4085ac5c02003c3dcf03"'), ('X-Trans-Id', 'txd4c9cf5a0312493390162-0056ddaabf')]
ERROR:swiftclient:Account HEAD failed: http://controller:8080/v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 401 Unauthorized
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 1390, in _retry
    service_token=self.service_token, **kwargs)
  File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 591, in head_account
    http_response_content=body)
ClientException: Account HEAD failed: http://controller:8080/v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 401 Unauthorized
ERROR:swiftclient.service:Account HEAD failed: http://controller:8080/v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 401 Unauthorized
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/swiftclient/service.py", line 435, in stat
    items, headers = get_future_result(stats_future)
  File "/usr/lib/python2.7/dist-packages/swiftclient/service.py", line 204, in get_future_result
    res = f.result(timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/concurrent/futures/_base.py", line 403, in result
    return self.__get_result()
  File "/usr/lib/python2.7/dist-packages/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python2.7/dist-packages/swiftclient/multithreading.py", line 188, in conn_fn
    return fn(*conn_args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/swiftclient/command_helpers.py", line 23, in stat_account
    headers = conn.head_account()
  File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 1430, in head_account
    return self._retry(None, head_account)
  File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 1390, in _retry
    service_token=self.service_token, **kwargs)
  File "/usr/lib/python2.7/dist-packages/swiftclient/client.py", line 591, in head_account
    http_response_content=body)
ClientException: Account HEAD failed: http://controller:8080/v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 401 Unauthorized
Account HEAD failed: http://controller:8080/v1/AUTH_f5d59946d78a4085ac5c02003c3dcf03 401 Unauthorized

Comments

Popular posts from this blog

Caused by: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation

HashiCorp Vault Integration with Ansible Etower using approle

utility to extract date from text with java