THEKnet's avatar

Amazon SQS. Jobs pushing to queue, but not processing

I'm currently attempting to migrate a Laravel App from a local Linux dev environment to an Amazon EC2 instance.

On my local instance I got queues working perfectly with Supervisor but using Beanstalkd instead of Amazon's SQS. I have now moved my app up to EC2 and set up the required configuration.

The only problem I have is that, while Jobs are pushing to SQS just fine, when I call php artisan queue:work (both using Supervisor and manually), nothing happens. I've checked both Laravel logs and my worker logs for Supervisor but they're all blank.

Anyone know where I can start with debugging this?

0 likes
12 replies
enordwall's avatar

I'm having the same issue. I'll be sure to post here when I figure out the problem.

shincoder's avatar

You should specify the chosen driver after php artisan queue:work (ex: php artisan queue:work sqs)

Also, make sure you restart the queue work if you change your code, since daemon workers do not reboot the framework: php artisan queue:restart

2 likes
THEKnet's avatar

I did manage to fix my queue issue. Although the solution probably doesn't apply to many people (and is somewhat embarrassing). Basically, the site was in maintenance mode. I didn't notice this because I allowed my IP in the middleware.

For those that missed it in the documentation, maintenance mode stops all queues from processing. The reason I didn't notice this straight away is because the note is under the "Maintenance Mode" section with no reference at all in the "Queues" section.

1 like
renky's avatar

@THEKnet I know this is 7 years ago... BUT THANKS - I searched for over an hour now... and finally it was by an accidentially app down in a script... unfortunatelly the queue-worker doesn't tell anything about maintainence mode, even if you restart it (just mentions: procesing queue.... could also say: but waiting for app up...)

donpuerto's avatar

I have also tried SQS, all above suggested solution doesnt work.

tomfordweb's avatar

THEKnet Thank you so much. I was about to go bald troubleshooting queue issues until I realized my dev server is in maintenance mode allowing only my IP

Natonator's avatar

will a previously queued job that you triggered use updated code? I'm seeing some errors that I have updated and fixed when I rerun the queues.

rafal-mbm's avatar

Any luck? I'm having same issue. Messages are present on SQQ queue but never fetched by worker

ganeshghalame's avatar

Same issue, even after trying all above solution. I fill there are many issues when working with SQS FIFO, some options like retry_after not available, queue behaviour is sometimes it is working properly but sometimes not pushing job. I am using https://github.com/shiftonelabs/laravel-sqs-fifo-queue for driver as Laravel default driver for sqs not working for FIFO. Any suggestion to stabilize the functionality?

filipedtristao's avatar

Investigating laravel.log I discovered the following exception was occurring when executing the command:

cURL error 60: SSL certificate problem: unable to get local issuer certificate

This is an error with the cacert.pem certificate that must be configured in the server's php.ini. Despite my setup for this certificate already be correct in my default php.ini, I discovered that when running the command via artisan in the console, a different version with a different php.ini was being used.

To find out the file used run the command:

php --ini

Tuning the certificate solved the problem.

madsey_shades's avatar

The instructions in the following post worked for me: https://blog.wplauncher.com/sqs-queue-in-laravel-not-working/. In essence, make sure you do the following:

  • create your standard queue in SQS
  • update your config/queue.php file to use your SQS credentials (I would suggest adding more env vars to your .env file and referencing them in this file)
  • update your QUEUE_DRIVER in your .env, so it's set to QUEUE_DRIVER=SQS
  • update your supervisor configuration file (typically /etc/supervisor/conf.d/laravel-worker.conf)
  • update and restart supervisor

Please or to participate in this conversation.