`PingOhDearJob` throws error
marcreichel opened this issue · 1 comments
I was trying to implement the Schedule Monitor but the queued job throws an error (see below):
Error: The script tried to call a method on an incomplete object. Please ensure that the class definition "Spatie\ScheduleMonitor\Jobs\PingOhDearJob" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition in /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php:115
Here's the complete stack trace:
#0 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(115): method_exists()
--
1 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()
2 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\Queue\CallQueuedHandler->call()
3 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(410): Illuminate\Queue\Jobs\Job->fire()
4 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(360): Illuminate\Queue\Worker->process()
5 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(158): Illuminate\Queue\Worker->runJob()
6 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(117): Illuminate\Queue\Worker->daemon()
7 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Console\WorkCommand->runWorker()
8 /var/www/releases/20210413234720/vendor/laravel/horizon/src/Console/WorkCommand.php(51): Illuminate\Queue\Console\WorkCommand->handle()
9 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\Horizon\Console\WorkCommand->handle()
10 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
11 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
12 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
13 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Container/Container.php(611): Illuminate\Container\BoundMethod::call()
14 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Container\Container->call()
15 /var/www/releases/20210413234720/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute()
16 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()
17 /var/www/releases/20210413234720/vendor/symfony/console/Application.php(971): Illuminate\Console\Command->run()
18 /var/www/releases/20210413234720/vendor/symfony/console/Application.php(290): Symfony\Component\Console\Application->doRunCommand()
19 /var/www/releases/20210413234720/vendor/symfony/console/Application.php(166): Symfony\Component\Console\Application->doRun()
20 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Console/Application.php(92): Symfony\Component\Console\Application->run()
21 /var/www/releases/20210413234720/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
22 /var/www/releases/20210413234720/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
23 {main}
app/Console/Kernel.php
:
$schedule->command('schedule-monitor:sync')
->dailyAt('04:56')
->doNotMonitor();
$schedule->command('schedule-monitor:clean')
->daily()
->doNotMonitor();
$schedule->command('telescope:prune --hours=48')
->daily();
$schedule->command('horizon:snapshot')
->everyFiveMinutes();
php artisan schedule-monitor:list
:
Monitored tasks
---------------
+----------------------------+---------+----------------------+---------------------+---------------------+----------------+---------------------+------------+-----------------------+
| Name | Type | Frequency | Last started at | Last finished at | Last failed at | Next run date | Grace time | Registered at Oh Dear |
+----------------------------+---------+----------------------+---------------------+---------------------+----------------+---------------------+------------+-----------------------+
| telescope:prune --hours=48 | Command | Every day at 12:00am | Did not start yet | | | 2021-04-20 00:00:00 | 5 | ✅ |
| horizon:snapshot | Command | Every 5 minutes | 2021-04-19 14:40:01 | 2021-04-19 14:40:01 | | 2021-04-19 14:45:00 | 5 | ✅ |
+----------------------------+---------+----------------------+---------------------+---------------------+----------------+---------------------+------------+-----------------------+
Any suggestions on what I am doing wrong?
Found the issue myself ... php artisan horizon:terminate
did not run after deployment.