swift stat fails - 401 Unauthorized - Openstack Kilo - CentOS 7

asked 2015-10-29 09:34:14 -0500

zoe gravatar image

updated 2015-10-30 04:09:11 -0500

EDIT: I really cannot understand why i can't get any stats, i hit a wall and it's strange because:

When i execute

curl -s -d '{"auth": {"tenantName": "tenant", "passwordCredentials": {"username": "admin", "password": "password"}}}' -H 'Content-type: application/json' http://node:5000/v2.0/tokens | python -m json.tool

I get the token id and url's but when i use them

curl -i -H "X-Auth-Token: $TOKEN" ${STORAGE_URL}

I get this error

HTTP/1.1 401 Unauthorized
Content-Length: 131
Content-Type: text/html; charset=UTF-8
Www-Authenticate: Swift realm="AUTH_<token_id>"
WWW-Authenticate: Keystone uri='http://node:5000'
X-Trans-Id: <someidhere>
Date: Fri, 30 Oct 2015 09:07:26 GMT

and in my logs

Oct 30 10:55:59 proxy-server: Marking token as unauthorized in cache
Oct 30 10:55:59 proxy-server: Authorization failed for token
Oct 30 10:55:59 proxy-server: Invalid user token - deferring reject downstream
Oct 30 10:55:59 proxy-server: Authenticating service token
Oct 30 10:55:59 proxy-server: Received request from user: user_id None, project_id None, roles None service: user_id None, project_id None, roles None
Oct 30 10:55:59 proxy-server: Authorizing as anonymous (txn: <someidhere>)

Why anonymous and user: user_id None, project_id None, roles None service: user_id None, project_id None, rolesNone if a give the token id of my user?

Thanks in adance

I have setup Openstack Swift Kilo on CentOS 7.1 and when I execute swift --debug -V 3 stat I get the following error:

Source environment variables

  [root@pc ~]# cat demo-openrc.sh 
    export OS_PROJECT_DOMAIN_ID=default
    export OS_USER_DOMAIN_ID=default
    export OS_PROJECT_NAME=demo
    export OS_TENANT_NAME=demo
    export OS_USERNAME=demo
    export OS_PASSWORD=demo
    export OS_AUTH_URL=http://haproxy:5000/v3

Execute swift stat with debug option

[root@pc ~]# swift --debug -V 3 stat
DEBUG:keystoneclient.auth.identity.v3.base:Making authentication request to http://haproxy:5000/v3/auth/tokens
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): haproxy
DEBUG:requests.packages.urllib3.connectionpool:"POST /v3/auth/tokens HTTP/1.1" 201 1830
DEBUG:iso8601.iso8601:Parsed 2015-10-29T15:06:05.282615Z into {'tz_sign': None, 'second_fraction': u'282615', 'hour': u'15', 'daydash': u'29', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'05', 'tz_minute': None, 'year': u'2015', 'separator': u'T', 'monthdash': u'10', 'day': None, 'minute': u'06'} with default timezone <iso8601.iso8601.Utc object at 0x7f8648020f50>
DEBUG:iso8601.iso8601:Got u'2015' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'10' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 10 for 'month' with default 10
DEBUG:iso8601.iso8601:Got u'29' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 29 for 'day' with default 29
DEBUG:iso8601.iso8601:Got u'15' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'06' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'05' for 'second' with default None
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): haproxy
DEBUG:requests.packages.urllib3.connectionpool:"HEAD /v1/AUTH_1a176bed7c1e4168b3391a4ea502b47c HTTP/1.1" 401 0
INFO:swiftclient:REQ: curl -i http://haproxy:8080/v1/AUTH_1a176bed7c1e4168b3391a4ea502b47c ...
(more)
edit retag flag offensive close merge delete

Comments

Hi, I'm facing the exact same issue. Did you manage to understand what was wrong? Thanks.

joanmarcriera gravatar imagejoanmarcriera ( 2016-06-08 05:14:34 -0500 )edit

Hi,

I configured it with v2 after all. I didn't manage to understand what i was doing wrong Sorry for the delayed answer :-(

zoe gravatar imagezoe ( 2016-07-07 07:03:19 -0500 )edit