简体   繁体   中英

403 forbidden from amazon SQS using boto

I have the exact same code on 2 servers. With one of them I can connect to amazon SQS, while the other one can't. Here is the output from the non-working server:

send: 'GET /?Action=GetQueueUrl&QueueName=Erablitek&Version=2012-11-05 HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 0\r\nHost: queue.amazonaws.com\r\nAuthorization: AWS4-HMAC-SHA256 Credential=AKIAIOQSTDBQVPXWYK7A/20150219/us-east-1/sqs/aws4_request,SignedHeaders=host;x-amz-date,Signature=9f5b0a187b178974f7b9b28e0028c2f9c034ee6fa2b1ee3ea9fcf9c3370219d5\r\nX-Amz-Date: 20150219T155308Z\r\nUser-Agent: Boto/2.34.0 Python/2.7.3 Linux/3.12.31+\r\n\r\n'
reply: 'HTTP/1.1 403 Forbidden\r\n'
header: Server: Server
header: Date: Thu, 19 Feb 2015 10:53:13 GMT
header: Content-Type: text/xml
header: Content-Length: 367
header: Connection: keep-alive
header: x-amzn-RequestId: 717fcf52-963b-5c4b-8f22-820d54e28cb4

And here is the output from the working server

send: 'GET /?Action=GetQueueUrl&QueueName=Erablitek&Version=2012-11-05 HTTP/1.1\r\nAccept-Encoding: identity\r\nContent-Length: 0\r\nHost: queue.amazonaws.com\r\nAuthorization: AWS4-HMAC-SHA256 Credential=AKIAIOQSTDBQVPXWYK7A/20150219/us-east-1/sqs/aws4_request,SignedHeaders=host;x-amz-date,Signature=a9538654d3b281156cbb5a410717e80381cac1e19c9ffcd8d96589c25ed6256d\r\nX-Amz-Date: 20150219T110853Z\r\nUser-Agent: Boto/2.35.2 Python/2.7.3 Linux/3.12.31+\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: Server
header: Date: Thu, 19 Feb 2015 11:08:55 GMT
header: Content-Type: text/xml
header: Content-Length: 321
header: Connection: keep-alive
header: x-amzn-RequestId: f29ed0a6-d762-5079-b26c-9df911e5c178

To my knowledge, both servers are configured and maintained pretty much the same way, however they're installed in 2 different locations. I have checked and credentials are the same on both servers.

Edit: I have also tried several versions of boto, including 2.35.2 which is the one installed on the working server.

I have no idea what else I should be checking

The QueueName parameter appears to be different in the two requests. In the first one (the non-working one) the queue name is:

QueueName=ErabliTEK

and in the second, working example it is:

QueueName=Erablitek

Could that be your problem?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM