dongpeihui1051 2016-01-29 23:46
浏览 99

AWS SQS与PHP连接时无效令牌,但使用Python无效

I'm having a very peculiar issue with trying to connect to AWS SQS. When running this PHP code:

$client = SqsClient::factory(array(
    'credentials' => [
       'key' => 'somekey',
       'secret' => 'somesecret'
    ],
    'region'  => 'eu-west-1',
    'version' => 'latest'
));
$result = $client->receiveMessage(array(
    'QueueUrl' => $queueUrl,
));

I'm getting this error:

PHP Fatal error:  Uncaught exception 'Aws\Sqs\Exception\SqsException' with message 'Error executing "ReceiveMess
age" on "https://sqs.eu-west-1.amazonaws.com/189729872213/my-very-special-queue"; AWS HTTP error: Client error: 403 Inva
lidClientTokenId (client): This account is suspended - <?xml version="1.0"?><ErrorResponse xmlns="http://queue.a
mazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>InvalidClientTokenId</Code><Message>This account i
s suspended</Message><Detail/></Error><RequestId>aaf63243-6840-5b49-893a-7d66919c07da</RequestId></ErrorResponse
>'

But when I'm using boto (the Python equivalent of AWS PHP SDK) with the same credentials on the same machine it works fine! And the account is opened as expected, and I can access all the queues that are associated with it.

How can I make the PHP code work? What should I be checking?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探