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

ctyler's avatar

Jobs are not Processing in Laravel 8

Hello, I seem to be having an issue with Laravel jobs and the queue. I have set up the Job, dispatched it and it is sitting in the Jobs table and not being processed. This is not my first experience with Jobs but it is the first time with Laravel 8.

.env

QUEUE_CONNECTION=database

I already ran:

php artisan queue:table
php artisan migrate

I am using supervisor and the workers are running

├─7424 /opt/remi/php74/root/bin/php /home/dev-intranet/public_html/dev-intranet/artisan queue:work --tries=3
           ├─7425 /opt/remi/php74/root/bin/php /home/dev-intranet/public_html/dev-intranet/artisan queue:work --tries=3
           ├─7426 /opt/remi/php74/root/bin/php /home/dev-intranet/public_html/dev-intranet/artisan queue:work --tries=3
           ├─7427 /opt/remi/php74/root/bin/php /home/dev-intranet/public_html/dev-intranet/artisan queue:work --tries=3
           ├─7428 /opt/remi/php74/root/bin/php /home/dev-intranet/public_html/dev-intranet/artisan queue:work --tries=3
           ├─7429 /opt/remi/php74/root/bin/php /home/dev-intranet/public_html/dev-intranet/artisan queue:work --tries=3
           ├─7430 /opt/remi/php74/root/bin/php /home/dev-intranet/public_html/dev-intranet/artisan queue:work --tries=3
           ├─7431 /opt/remi/php74/root/bin/php /home/dev-intranet/public_html/dev-intranet/artisan queue:work --tries=3

I have an event and a listener. I am not getting errors so I was logging info to the log files to see where things maybe going wrong. The log in the job is not being logged - obviously.

It is just sitting in the jobs table:

'9', 'default', '{\"uuid\":\"df65b8e9-0b81-4dc6-b49f-1a86a211fe7b\",\"displayName\":\"App\\Jobs\\SendNewHireNotifications\",\"job\":\"Illuminate\\Queue\\CallQueuedHandler@call\",\"maxTries\":null,\"maxExceptions\":null,\"failOnTimeout\":false,\"backoff\":null,\"timeout\":null,\"retryUntil\":null,\"data\":{\"commandName\":\"App\\Jobs\\SendNewHireNotifications\",\"command\":\"O:33:\\"App\\Jobs\\SendNewHireNotifications\\":11:{s:7:\\"\u0000*\u0000user\\";O:45:\\"Illuminate\\Contracts\\Database\\ModelIdentifier\\":4:{s:5:\\"class\\";s:15:\\"App\\Models\\User\\";s:2:\\"id\\";i:181;s:9:\\"relations\\";a:4:{i:0;s:5:\\"title\\";i:1;s:10:\\"department\\";i:2;s:11:\\"licenseType\\";i:3;s:4:\\"user\\";}s:10:\\"connection\\";s:5:\\"mysql\\";}s:3:\\"job\\";N;s:10:\\"connection\\";N;s:5:\\"queue\\";N;s:15:\\"chainConnection\\";N;s:10:\\"chainQueue\\";N;s:19:\\"chainCatchCallbacks\\";N;s:5:\\"delay\\";N;s:11:\\"afterCommit\\";N;s:10:\\"middleware\\";a:0:{}s:7:\\"chained\\";a:0:{}}\"}}', '0', NULL, '1624370545', '1624370545'

This is how I am dispatching the Job in the listener:

public function handle(CreateNewStaff $event)
    {
        Log::debug('hello from inside the Listener');
        SendNewHireNotifications::dispatch($event->user);
    }

This is the job:

class SendNewHireNotifications implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $user;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct(User $user)
    {
        $this->user = $user;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        Log::debug('hello from inside the Job');
    }
}

Again, I am not getting any errors. The jobs in the jobs table are just not being processed. I am not sure what this could be so any help would be appreciated.

0 likes
2 replies
ctyler's avatar

OMG. Nevermind. Turns out I did have the application in maintenance mode. Apparently Jobs don't process while in maintenance.

Sorry. I hope I didn't waste anyone's time.

4 likes
hillcow's avatar

Oh what the... thank you so much. Didn't realise that as well.

Please or to participate in this conversation.