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

tihoti's avatar
Level 14

Cloud Run and Scheduler issue

I have a Laravel 10 application running on Google Cloud Run.

I'm using Google Cloud Scheduler to trigger the scheduler by hitting the application with php artisan scheduler:run. Although it successfully hits the application, the scheduled tasks aren't being executed.

Strangely, when I change the command to php artisan my-custom-command:test, it works fine.

This issue has persisted for a month now, despite previously functioning correctly.

I have added a test cron

$schedule->command(SchedulerTest::class)->everyMinute()
            ->name('scheduler_test:mywebsite')
            ->withoutOverlapping()
            ->emailOutputTo('myemail.com')
            ->description('My Scheduled Task')
            ->onOneServer();

And the output is:

Fatal error: Uncaught RuntimeException: A facade root has not been set. in /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:352 Any insights on how to resolve this?

0 likes
4 replies
Snapey's avatar

have you tried php artisan schedule:run and not scheduler

Snapey's avatar

Check the laravel logs, and I doubt this is the correct format;

$schedule->command(SchedulerTest::class)->everyMinute()

You can't call the class directly, you should specify here the signature of the test command.

tihoti's avatar
Level 14

Just found the issue

Don't work
$schedule->command(SchedulerTest::class)->everyMinute();
Works
 $schedule->call(function () {
      app(SchedulerTest::class)->handle();
 })->everyMinute();
1 like

Please or to participate in this conversation.