laravel-aws-worker
laravel-aws-worker copied to clipboard
SQS messages (scheduler and queued jobs) stuck in flight then moved to dead queue
I'm trying to implement this package for my application's scheduling and queues.
The scheduling is working great except that the messages look like they're stuck In Flight and don't get deleted properly.
I think I have mostly everything set up correctly. SQS is receiving the messages on the queue and the messages are immediately put into "In flight" and stay there until what I think is the visibility timeout occurs, and then it gets put onto the dead queue.
When I look at the dead queue I can see that the scheduler is being called once per minute with the following data: Message body:
elasticbeanstalk scheduled job
Message Attributes:
| Name | Type | Value |
|---|---|---|
| beanstalk.sqsd.path | String | /worker/schedule |
| beanstalk.sqsd.scheduled_time | String | 2017-03-22 23:10:00 UTC |
| beanstalk.sqsd.task_name | String | schedule |
When I queue a command, the message body has the correct JSON data format since I'm just calling it from Laravel's default queueing (I had database driver before this and it worked fine, and the payload looks identical to what the message body is here). But the message attributes is empty.
So I'm not really sure what I have set up incorrectly. The scheduler is running and it's calling the scheduler methods, but the messages are staying In Flight and eventually being put onto the dead queue. And the queued jobs aren't being run at all and have the same behaviour as the scheduler messages (stuck In Flight and then moved to dead queue).
Hey there, I am also experiencing this issue. Did you solve it?
In my case I forgot to set the document root of my worker to /public !
Unfortunately I did have that set on mine. So still no solution on my end.
What helped debug my issue sshing into the worker and running tail -f /var/log/aws-sqsd/default.log to see whether the daemon was sending messages and to where.
Someone solved this?
2017-06-20T19:25:07Z message: sent to http://localhost:80 2017-06-20T19:25:07Z message: sent to http://localhost:80 2017-06-20T19:25:07Z http-err: 34681df7-347d-4447-9287-bae7601e4b21 (546) 500 - 0.012 2017-06-20T19:25:07Z http-err: 8fbbab2f-77a7-4397-8524-0af26a7574af (224) 500 - 0.013 2017-06-20T19:25:07Z message: sent to http://localhost:80 2017-06-20T19:25:07Z message: sent to http://localhost:80 2017-06-20T19:25:07Z http-err: 66b6cc47-732d-4678-8fbf-15871eb708e2 (521) 500 - 0.011 2017-06-20T19:25:07Z http-err: c3258326-547c-4982-9d36-d655d4091310 (520) 500 - 0.014 2017-06-20T19:25:07Z message: sent to http://localhost:80 2017-06-20T19:25:07Z http-err: 9e611e2a-30b5-4cfd-ad5a-4f51390a485d (520) 500 - 0.007 2017-06-20T19:25:59Z message: sent to http://localhost:80/worker/schedule
@andreclemente it looks like your app is retuning a 500 error. So you may want to check the error logs at /var/log/apache2/error.log
I'm also seeing a 500 error when looking at my logs on the Worker instance of Elastic Beanstalk. Works fine in my localhost. How do i debug the errors? /var/log/apache2 does not exist so i'm not sure where to find an error log
Thanks!
You may need to composer require aws/aws-sdk-php
Marking issue as stale. Likely seems to be a config issue unrelated to the package.