Do you have a queue worker running???
EDIT Wait.... is this a queued Job or a scheduled Job?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm facing an issue in my production environment. One specific job is not working as expected when specifically called via the scheduler php artisan schedule:run. As it seems, the queue worker does not run through the code in the handle function of the job. Instead, the job is marked as completed in Horizon with a runtime of under a second. The strange thing is that if I run Laravel Tinker on my production server, and push the job manually to the queue it works as expected.
See below for my setup and code snippets.
Does anyone have an idea what the issue is? No code around this specific job has been touched in months, and the issue just showed up randomly last Friday. The server, docker, and Horizon have been restarted several times without any change in the behavior. And no other job has this issue.
Server Setup
Laravel Version: v8.78.1
Laravel Horizon Version: v5.7.18
Docker PHP Image: php:8.1.0-fpm-alpine3.15
App\Console\Kernel.php
protected function schedule(Schedule $schedule)
{
$schedule->job(new AdExportFile(
fileName: 'adwords.csv',
daysToExport: 10,
header: [
'Google Click ID',
'Conversion Name',
'Conversion Time',
'Conversion Value',
'Conversion Currency'
],
timezone: config('app.timezone'),
origin: Visit::SOURCE_GOOGLE
))->hourly();
}
App\Jobs\AdExportFile.php
class AdExportFile implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
public const QUEUE = 'default';
/**
* Create a new job instance.
*
* @return void
*/
public function __construct(
protected string $fileName,
protected int $daysToExport,
protected array $header,
protected string $timezone,
protected string $origin,
protected string $delimiter = ',',
protected int $minBaseCommission = 5000
) {
$this->onQueue(static::QUEUE);
\Log::info('AdExportFile: Running __construct');
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
\Log::info('AdExportFile: Running the handle function');
Application-specific code...
}
}
Log output
AdExportFile: Running __construct
Please or to participate in this conversation.