shimana's avatar

Jobs exist in DB but aren't processed

Hello everyone,

I am facing a strange issue with Laravel Queues on my production server. Everything works perfectly on my local machine, but after deploying to the production server, the queue worker seems to ignore the jobs.

The Problem: I am using the database driver. The jobs are successfully dispatched and inserted into the jobs table. However, they remain there indefinitely.

  • attempts is 0
  • reserved_at is NULL

Here is a screenshot of my database table showing the pending jobs: Jobs Table Screenshot

What happens when I run the worker: When I execute php artisan queue:work on the server, I get the standard startup message: But then it just hangs there. It does not pick up any jobs, no errors are thrown, and the database rows remain untouched.

What I have tried so far:

  1. Ran php artisan optimize:clear and config:clear.
  2. Verified that QUEUE_CONNECTION=database in the .env file.
  3. Checked the server time (it matches).
  4. Restarted the queue worker (queue:restart).
  5. Verified that the PHP version in CLI matches the web version.

Has anyone experienced this "hanging" behavior where the worker starts but never processes existing database records?

Any help would be appreciated.

0 likes
5 replies
Glukinho's avatar

How many databases do you have on production servers? Maybe a worker is somehow pointed to a wrong database or table?

What is the value of default and connections.database values in config/queue.php file?

Go to php artisan tinker on production server and give the output:

> config('queue.default')

> config('queue.connections.database')
2 likes
shimana's avatar

I have only 1 database. I ran the requested commands in php artisan tinker on the production server, and here are the results:

  1. config('queue.default') returns "database".
  2. config('queue.connections.database') returns:
[
    "driver" => "database",
    "connection" => null,
    "table" => "jobs",
    "queue" => "default",
    "retry_after" => 90,
    "after_commit" => false,
]
also :
\DB::table('jobs')->count() returns 4.

So, it seems the CLI environment can connect to the correct database and can see the pending jobs. However, php artisan queue:work still hangs on "Processing jobs from the [default] queue" without picking them up (start processing).

It is very strange that tinker sees the rows, but the worker ignores them. Do you have any other suggestions?
Glukinho's avatar

I don't see errors in the configuration you provided, it's default and should work.

Do you start queue worker with exact command php artisan queue:work while being inside your app folder? Maybe you have another project folder nearby and you got similar folders confused? Double check all paths.

Does php artisan queue:listen behave the same way as queue:work or different?

Also give output of php artisan queue:monitor default.

And try this:

php artisan queue:work database --queue=default -v

What will be the result?

shimana's avatar

I'm not sure if this is related to the PHP version or the installed extensions, but here is my php -v output on the server: It is really baffling because everything works flawlessly on my local machine. I have also checked storage/logs/laravel.log, and there are absolutely no errors logged there.

PHP 8.4.14 (cli) (built: Nov  6 2025 00:00:00) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.14, Copyright (c) Zend Technologies
    with the ionCube PHP Loader v14.4.1, Copyright (c) 2002-2025, by ionCube Ltd.
    with Zend OPcache v8.4.14, Copyright (c), by Zend Technologies
‍‍


kevinbui's avatar

This is a bizarre problem. Can you ssh into your server, run php artisan tinker and run the following statements:

use Illuminate\Support\Facades\Queue;

Queue::size();

The worker will use the above method to pop jobs from the queue.

Please or to participate in this conversation.