shimana's avatar

shimana wrote a reply+100 XP

5mos ago

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
‍‍


shimana's avatar

shimana wrote a reply+100 XP

5mos ago

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?
shimana's avatar

shimana liked a comment+100 XP

5mos ago

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')
shimana's avatar

shimana started a new conversation+100 XP

5mos ago

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.