Ask Your Question
0

Cannot connect to Swift, error 401

asked 2013-11-06 22:30:36 -0500

michael-sevy gravatar image

Using cURL, I can connect and obtain an X-Auth-Token. But when I attempt to connect back for a HEAD request, using the returned X-Auth-Token and X-Storage-URL, I receive a 401, unauthorized response.

I'm using tempauth.

The following is output from the two cURL commands:

[swift@localhost ~]$ curl -i -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://192.168.30.128:8080/auth/v1.0 * About to connect() to 192.168.30.128 port 8080 (#0) * Trying 192.168.30.128... connected * Connected to 192.168.30.128 (192.168.30.128) port 8080 (#0)

GET /auth/v1.0 HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Host: 192.168.30.128:8080 Accept: / X-Storage-User: test:tester X-Storage-Pass: testing

< HTTP/1.1 200 OK HTTP/1.1 200 OK < X-Storage-Url: http://192.168.30.128:8080/v1/AUTH_test X-Storage-Url: http://192.168.30.128:8080/v1/AUTH_test < X-Storage-Token: AUTH_tk61345b239dd343cb839d5459030cc643 X-Storage-Token: AUTH_tk61345b239dd343cb839d5459030cc643 < X-Auth-Token: AUTH_tk61345b239dd343cb839d5459030cc643 X-Auth-Token: AUTH_tk61345b239dd343cb839d5459030cc643 < Content-Length: 0 Content-Length: 0 < Date: Wed, 06 Nov 2013 22:11:48 GMT Date: Wed, 06 Nov 2013 22:11:48 GMT

< * Connection #0 to host 192.168.30.128 left intact * Closing connection #0 [swift@localhost ~]$ curl -i -v -H 'X-Auth-Token: AUTH_tk61345b239dd343cb839d5459030cc643' http://192.168.30.128:8080/auth/v1.0 * About to connect() to 192.168.30.128 port 8080 (#0) * Trying 192.168.30.128... connected * Connected to 192.168.30.128 (192.168.30.128) port 8080 (#0)

GET /auth/v1.0 HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Host: 192.168.30.128:8080 Accept: / X-Auth-Token: AUTH_tk61345b239dd343cb839d5459030cc643

< HTTP/1.1 401 Unauthorized HTTP/1.1 401 Unauthorized < Content-Length: 358 Content-Length: 358 < Content-Type: text/html; charset=UTF-8 Content-Type: text/html; charset=UTF-8 < Date: Wed, 06 Nov 2013 22:12:14 GMT Date: Wed, 06 Nov 2013 22:12:14 GMT

< <html> <head> <title>401 Unauthorized</title> </head> <body>

401 Unauthorized

This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.

</body> * Connection #0 to host 192.168.30.128 left intact * Closing connection #0 </html>[swift@localhost ~]$

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
0

answered 2013-11-07 06:06:32 -0500

esedmehmet gravatar image

hi,

this command("curl -i -v -H 'X-Auth-Token: AUTH_tk61345b239dd343cb839d5459030cc643' http://192.168.30.128:8080/auth/v1.0%22 (http://192.168.30.128:8080/auth/v1.0") ) is wrong. you must be use curl -i -v -H 'X-Auth-Token: AUTH_tk61345b239dd343cb839d5459030cc643' http://192.168.30.128:8080/v1/AUTH_test .

Thanks.

edit flag offensive delete link more
0

answered 2013-11-07 17:37:38 -0500

michael-sevy gravatar image

Arrrrr! Thanks. I was trying a couple different things and forgot to copy the returned Storage URL. This did solve my problem. HOWEVER, you can also get the same 401-type error if Swift is running, but memcached is not. I think I was running into a situation, yesterday, where I was rebooting my machine and forgetting to start memcached, then (also) forgetting to copy the correct URL.

Have added starting memcached and swift to startup scripts.

Again, thanks for catching an incorrect URL I was blinded from seeing.

-Michael

edit flag offensive delete link more
0

answered 2013-11-07 17:37:47 -0500

michael-sevy gravatar image

Thanks Mehmet Hacısalihoğlu, that solved my question.

edit flag offensive delete link more

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: 2013-11-06 22:30:36 -0500

Seen: 399 times

Last updated: Nov 07 '13