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

SQS Job Driver - Visibility Timeout Mapped As String #51045

Closed
andrew-belac opened this issue Apr 13, 2024 · 5 comments
Closed

SQS Job Driver - Visibility Timeout Mapped As String #51045

andrew-belac opened this issue Apr 13, 2024 · 5 comments

Comments

@andrew-belac
Copy link

Laravel Version

10.48.7

PHP Version

8.2

Database Driver & Version

No response

Description

See previous issue #50397.

Bug is present on Laravel 10 and possibly all currently supported versions.

When dispatching a job visibility timeout is passed in as a string. The AWS PHP SDK works up to version aws/aws-sdk-php:3.285.0. Version aws/aws-sdk-php:3.285.1 and above stop working with the following error message

The provided type for Attributes -> ReceiveMessageWaitTimeSeconds value was integer. The modeled type is string.

The error is raised at /vendor/aws/aws-sdk-php/src/QueryCompatibleInputMiddleware.php:161

AWS PHP Laravel SQS Error

The error was encountered using Laravel Vapor. But the previous issue raised suggests it is not Vapor specific.

Steps To Reproduce

  • Configure SQS as the job driver
  • Dispatch a job
  • Error is raised when the driver attempts to push the job to SQS
@crynobone
Copy link
Member

I cannot find any references where release() method can be called using string.

Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@andrew-belac
Copy link
Author

I cannot find any references where release() method can be called using string.

I am referring to how Laravel sets some AWS QueueAttributes as integers instead of strings. My understanding is the AWS documentation is incorrect in that it states integers when the API takes strings.

If you look in the vendor folder of aws/aws-sdk-php:3.285.1 you will see under src/data/sqs/2012-11-05/api-2.json.php you will see the specification has all QueueAttributes being string. Seems to be due to the migration from XML to JSON.

Screenshot from 2024-04-15 07-50-47

With this version and above I receieve the errors in the log. But if I move revert to aws/aws-sdk-php:3.285.0 of the SDK then no errors are logged.

@andrew-belac
Copy link
Author

@crynobone Apologies the problem was in one job we have using the SQSClient directly. I also confused queue attributes being strings with message attributes it seems.

@andrew-belac
Copy link
Author

Closing

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

No branches or pull requests

2 participants