Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 9.4 SQS configuration - Invalid configuration value provided for "token" ... got string #1336

Closed
arimolzer opened this issue Dec 1, 2022 · 1 comment
Labels

Comments

@arimolzer
Copy link

arimolzer commented Dec 1, 2022

Description:

PHP: 8.0.25
Laravel: 9.41.0
Bref: 1.7.12

Serverless:
Framework Core: 3.23.0 (local) 3.19.0 (global)
Plugin: 6.2.2
SDK: 4.3.2

Flareapp stacktrace: https://flareapp.io/share/67OvlynP#F72

I have recently ran into an issue after deploying where it appears that the AWS_SESSION_TOKEN that is set by AWS Lambda is not compatible with the AWS Client resolver.

Invalid configuration value provided for "token". Expected Aws\Token\TokenInterface|Aws\CacheInterface|array|bool|callable, but got string(884) "IQoJb3..." token: (Aws\Token\TokenInterface|Aws\CacheInterface|array|bool|callable) Specifies the token used to authorize requests. Provide an Aws\Token\TokenInterface object, an associative array of "token", and an optional "expiration" key, `false` to use a null token, or a callable token provider used to fetch a token or return null. See Aws\Token\TokenProvider for a list of built-in credentials providers. If no token is provided, the SDK will attempt to load one from the environment.

My SQS config looks like this in queue.php:

sqs' => [
            'driver' => 'sqs',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'token' => env('AWS_SESSION_TOKEN'),
            'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
            'queue' => env('SQS_QUEUE', 'default'),
            'suffix' => env('SQS_SUFFIX'),
            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
            'after_commit' => false,
        ],

Temporarily changing the queue to use the database driver has resolved my issue for now. But would be eager to know what has caused this and how I can resolve. Please let me know if you have any questions.

@arimolzer arimolzer added the bug label Dec 1, 2022
@mnapoli
Copy link
Member

mnapoli commented Dec 1, 2022

Thanks for the report, have a look at #1330, it seems to be a regression in Laravel: laravel/framework#44979

Closing as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants