AmarjaPatil4
AmarjaPatil4

Reputation: 1650

Amazon SQS keeps returning a 403 error

I am doing project in Laravel. For storing images I am using aws-s3. My project working very well on godaddy server but not on digital ocean server. I am getting error as,

Aws\Sqs\Exception\SqsException: Error executing "ReceiveMessage" on "https://sqs.us-east-1.amazonaws.com/your-account-id/your-queue-name"; AWS HTTP error: Client error: `POST https://sqs.us-east-1.amazonaws.com/your-account-id/your-queue-name` resulted in a `403 Forbidden` response:
<?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>I (truncated...)
 InvalidClientTokenId (client): The security token included in the request is invalid. - <?xml version="1.0"?><Err......

Here Is a code that I used for s3 setup in my project,

filesystem.php

        's3' => [
        'driver' => 's3',
        'key'    => '************',
        'secret' => '***********',
        'region' => 'ap-south-1',
        'bucket' => 'xyz',
        'options' => [
            'ServerSideEncryption' => 'AES256',
        ]
    ]

.env

QUEUE_DRIVER=redis

I am getting this error irrespective of hitting any api. I don't know where I am going wrong. Thanks in advance.

Upvotes: 4

Views: 8553

Answers (1)

Kannaiyan
Kannaiyan

Reputation: 13025

Issue is documented under aws blog,

https://aws.amazon.com/premiumsupport/knowledge-center/security-token-expired/

Please check your credentials and appropriate roles / Policies attaches to roles to access S3.

Upvotes: 2

Related Questions