Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

X-Auth-Token changed itself

i wrote a script to write large number of files into my cluster system, and this morning i found in log that the auth-server came up to a problem, and the write operation cannot be executed. the log looks like this:

Nov 17 09:45:42 swift1 auth-server validate_token('AUTH_tkeea74a86c13244a49327dc7de941e7f0', _, _) = False [0.00] Nov 17 09:45:42 swift1 auth-server 127.0.0.1 - - [17/Nov/2010:01:45:42 +0000] "GET /token/AUTH_tkeea74a86c13244a49327dc7de941e7f0 HTTP/1.0" 404 - "-" "-" - - - - - - - - - "-" "127.0.0.1" "-" 0.0006

it seems that the x-auth-token has failed to be validated. so i check the file which had saved the x-auth-token before. root@swift1:~# cat token AUTH_tkeea74a86c13244a49327dc7de941e7f0

the token saved in the file was used in my request(write operation) to the cluster. so the one in log is the same as that in the file. it seems the x-auth-token is not valid, so i fetched the x-auth-token again like below. root@swift1:~# ./swift_create_token test tester testing <my-auth-server>:<port>

swift_create_token is a script like this:

!/bin/bash

if [ $# -ne 4 ] then echo "Usage:" echo " swift_create_token <account> <user> <password> <auth-server-ip:port>" exit 1 fi

curl -k -v -H "X-Storage-User: $1:$2" -H "X-Storage-Pass: $3" "https://$4/v1.0" > token_tmp 2>&1 grep X-Auth-Token token_tmp | awk -F ": " '{print $2}' > token grep X-Storage-Url token_tmp | awk -F ": " '{print $2}' > url

amazingly, i found that the x-auth-token has changed to something below! root@swift1:~# cat token AUTH_tk48ae64f7d7cf45cb93960bfeaaf14d32

I used the new x-auth token above in my request and the write operation was OK eventually. I wonder how can the x-auth-token had been changed?