Wednesday, 28 December 2016

Swift upload : Authorization Failure : Liberty | Solved

While uploading a text file to container I was getting authorization failure.

Error:

Authorization Failure. Authorization failed: An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-ba4faaad-4c19-4248-b474-b898ad8975a1)

In the Liberty version you need additional configurations in the swift proxy server.

Solution: 



Edit the proxy config file and modify the content like below,

[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
auth_uri = http://controller/5000
auth_url = http://controller/35357
memcached_servers = controller:11211
auth_plugin = password
project_domain_name = default
user_domain_name = default
project_name = service
username = swift
password = swiftpassword
delay_auth_decision = True

swift stat - Authorization Failure - Liberty | Solved

I was installing Openstack Liberty version. While doing the swift configuration it gave me below error,

Error

root@controller:~# swift stat
Authorization Failure. Authorization failed: An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-dc0f530c-e642-4b51-a742-f19567002e01)


I was surprised to get an authorization error even though I have provided the credentials. Later I figured out the problem was not with the credentials, but with the version of keystone which I was using.

Solution

In the keystone version 1.7.1 we also need a region set along with the other variables while souring the admin / user credentials. So I edited my admin-openrc.sh file and added the entry,

export OS_REGION_NAME=RegionOne

Now "#swift stat" gives me the output as expected.

root@controller:~# swift stat
                        Account: AUTH_9e7ef26465a34f6bb18d16ba5499ff20
                     Containers: 1
                        Objects: 0
                          Bytes: 0
Containers in policy "policy-0": 1
   Objects in policy "policy-0": 0
     Bytes in policy "policy-0": 0
    X-Account-Project-Domain-Id: default
                    X-Timestamp: 1482851783.30541
                     X-Trans-Id: txdae1854e1a7847858e876-0058632946
                   Content-Type: text/plain; charset=utf-8
                  Accept-Ranges: bytes