EN ES
Home > Web development > Laravel Tutorials > Laravel 5 Queuework Queuelisten Does Not Process Jobs

Laravel 5 Queuework Queuelisten Does Not Process Jobs

Diego Cortés
Diego Cortés
September 8, 2016
Laravel 5 Queuework Queuelisten Does Not Process Jobs

The truth is that this is an issue that had me thinking for 2 days because neither the queue:work nor the queue:listen command were processing the jobs from the jobs table within a client's VPS. The truth is that it had never happened to me before, locally everything worked perfectly. Things to keep in mind that can cause this problem:

If you use the queue driver database, confirm within our database in the jobs table that the job was actually saved (maybe this sounds strange, what's the point of checking that table if the job was executed and is automatically deleted? We clearly have the opposite situation, the job is not processed xD!).

Make sure that when you pass the argument –env=production when running queue:work or queue:listen within our .env file, that environment is declared. If you are using supervisor, check if you have error output files (logs) configured and check those files in case supervisor stores a possible error in these logs.

If we check all this and we don't get any error and when we execute the queue:work or queue:listen command from the terminal or if we use supervisor, the logs are empty, then the same thing happens to you as to me, most likely you have the application in maintenance mode and as was my case with an IP exception.

When the application is in maintenance mode, no queue will be processed, regardless of whether we have the environment mode correctly configured or some IP exception in maintenance mode, neither queue:listen nor queue:work will work xD!, so the solution is:

Solution:

Disable maintenance mode and finally the pending queues or jobs will be processed if we are using supervisor, if this is not the case, run queue:listen or queue:work and you will see that it works

Command to disable maintenance mode:

php artisan down

I hope it helps more than one person

Diego Cortés
Diego Cortés
Full Stack Developer, SEO Specialist with Expertise in Laravel & Vue.js and 3D Generalist

Categories

Page loaded in 23.24 ms