Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stephenr85's avatar

Laravel Horizon jobs are vanishing

My jobs will all queue correctly and start processing, but when I check them after some time, the Pending and Completed jobs have vanished. I thought this was an issue with the cache redis stores conflicting and getting cleared, but I have those configured correctly as far as I can tell.

I have a pro version of Herd 1.9.1 (latest) running with PHP 8.2.22. My app is on Laravel v10.48.20 with Horizon v5.27.1.

I have a separate redis database setup in config/database.php

return [
//...
        'cache' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'username' => env('REDIS_USERNAME'),
            'password' => env('REDIS_PASSWORD'),
            'port' => env('REDIS_PORT', '6379'),
            'database' => env('REDIS_CACHE_DB', '1'),
        ],

        'jobs' => [
            'url' => env('REDIS_URL'),
            'host' => env('REDIS_HOST', '127.0.0.1'),
            'username' => env('REDIS_USERNAME'),
            'password' => env('REDIS_PASSWORD'),
            'port' => env('REDIS_PORT', '6379'),
            'database' => 'jobs_' . env('REDIS_DB', '1'),
        ],
//...
];

I have config/horizon.php set to use the jobs connection.

return [
//...


    /*
    |--------------------------------------------------------------------------
    | Horizon Redis Connection
    |--------------------------------------------------------------------------
    |
    | This is the name of the Redis connection where Horizon will store the
    | meta information required for it to function. It includes the list
    | of supervisors, failed jobs, job metrics, and other information.
    |
    */

    'use' => 'jobs',
//...
];

And I have these set in my .env (which initially I thought solved the issue - not having a REDIS_DB defined).

CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
REDIS_DB=myappname
REDIS_CACHE_DB=myappname_cache
REDIS_QUEUE=default

I've been going on circles with this for hours, so any help is appreciated!

0 likes
6 replies
jlrdw's avatar

Have you did any upgrading and perhaps missed something in the upgrade guide?

Just a thought.

1 like
stephenr85's avatar

@jlrdw I've not done any major upgrades on this project, and there's no indication that anything else isn't working properly.

What's more is that I'm noticing that jobs do continue processing for some time, but at some point they stop. The dashboard shows over 11,000 still in queue, and they'll tick down for some time (until they don't), but there is nothing under Pending or Completed.

jlrdw's avatar

@stephenr85 Have you checked all of your various log files for any indication of why this is happening.

Also you do have plenty of memory correct?

stephenr85's avatar

The queue is pretty large, but I'm not seeing any errors about memory.

I've checked the log files. I don't see anything related to the service stopping or starting, and there's no error on the process. I do see standard logging when a job fails for a reason within the job.

I'm continuing to deal with this and it's driving me crazy. I want to use Horizon because I have several queues to manage, but I think it's related to redis - I never had the issue of losing jobs when using the database driver.

KieranWright's avatar

@stephenr85 Did you resolve this? Experiencing something similar with 200k+ jobs pending and the job drops in completed then pretty quickly disappears.

Please or to participate in this conversation.