Ask Your Question
0

swift responds with 401 unauthorized error

asked 2015-03-27 11:31:19 -0500

I have simple swift setup with one proxy-server connected to one storage-server. Swift commands like swift stat,list,upload,download etc.. are working fine. Once i post the container using swift post -r '.r:*' command, i can even access the objects like images from url. But when i run commands like

swift -q -A authurl -U username -K password stat -v
swift -A http://127.0.0.1/auth/v1.0 -U admin:admin -K admin stat -v
curl -v -H 'X-Auth-User:admin:admin' -H 'X-Auth-Key:admin' http://127.0.0.1/auth/v1.0/

throws unauthorized error and hence not able to get auth token and storage url.

all.log file in /var/log/swift shows:

 Mar 21 15:35:53 varsha-Inspiron-5521 swift-proxy-server: Pipeline was modified. New pipeline is "catch_errors gatekeeper dlo healthcheck memcache keystoneclient.middleware.auth_token:filter_factory keystoneauth proxy". 
Mar 21 15:35:53 varsha-Inspiron-5521 swift-proxy-server: Pipeline was modified. New pipeline is "catch_errors gatekeeper dlo healthcheck memcache keystoneclient.middleware.auth_token:filter_factory keystoneauth proxy". 
Mar 21 15:35:59 varsha-Inspiron-5521 swift-proxy-server: STDOUT: ERROR:root:Error connecting to memcached:
    127.0.0.1:11211#012Traceback (most recent call last):#012  File "/usr/lib/python2.7/dist-packages/swift/common/memcached.py", line 239, in _get_conns#012    fp, sock = self._client_cache[server].get()#012  File "/usr/lib/python2.7/dist-packages/swift/common/memcached.py", line 132, in get#012    fp, sock = self._parent_class_getter()#012  File "/usr/lib/python2.7/dist-packages/eventlet/pools.py", line 119, in get#012    created = self.create()#012  File "/usr/lib/python2.7/dist-packages/swift/common/memcached.py", line 128, in create#012    sock.connect((host, int(port)))#012  File "/usr/lib/python2.7/dist-packages/eventlet/greenio.py", line 194, in connect#012    socket_checkerr(fd)#012  File "/usr/lib/python2.7/dist-packages/eventlet/greenio.py", line 46, in socket_checkerr#012    raise socket.error(err, errno.errorcode[err])#012error: [Errno 111] ECONNREFUSED (txn: tx8bb814d6acde4ab2a8b70-00550d4286) (client_ip: 192.168.56.29)

Please help!

edit retag flag offensive close merge delete

Comments

Did you checked the memcache server?

ebyenjoys gravatar imageebyenjoys ( 2015-03-29 21:46:26 -0500 )edit

You should use sample proxy-server.conf from github and then restart service.

Quang Vu gravatar imageQuang Vu ( 2019-07-04 03:11:47 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-30 00:23:07 -0500

updated 2015-04-01 05:05:54 -0500

Hi Varsha,

Check your /etc/swift/proxy-server.conf, check

[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk tempurl ratelimit tempauth container-quotas account-quotas slo dlo proxy-logging proxy-server

[app:proxy-server] use = egg:swift#proxy
# You can override the default log routing for this app here:
# set log_name = proxy-server
# set log_facility = LOG_LOCAL0
# set log_level = INFO
# set log_address = /dev/log
#
# log_handoffs = true
# recheck_account_existence = 60
# recheck_container_existence = 60
# object_chunk_size = 65536
# client_chunk_size = 65536

Also Check

[filter:tempauth]
use = egg:swift#tempauth
# You can override the default log routing for this filter here:
# set log_name = tempauth
# set log_facility = LOG_LOCAL0
# set log_level = INFO
# set log_headers = false
# set log_address = /dev/log

Better in hand is avoid proxy. do direct call, it s makes easier.

edit flag offensive delete link more

Comments

Thanks for your reply. But it didnt work. I am stuck with same problem.

Varsha gravatar imageVarsha ( 2015-04-03 03:01:19 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-03-27 11:31:19 -0500

Seen: 806 times

Last updated: Apr 01 '15