Back

No scheduled commands are ready to run | empty


MwSpace LLC posted 2 months ago
  • Laravel Version: 5.7.25
  • PHP Version: 7.2.14
  • Database Driver & Version: MySQL 2ª gen. 5.7

Hi, Sorry for the trouble, I have this problem in creating a scheduled command.

Description:

In our crontab -e user we have inserted the following on Debian:

* * * * * cd /var/www/myfolder.com/ && php artisan schedule:run >> crontab.laravel

We have correctly entered the schedule function as follows:

app/console/kernel.php

  <?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;


class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
//        'App\Console\Commands\HelpCenter',
        Commands\HelpCenter::class
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('elena:help')->everyMinute();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__ . '/Commands');

        require base_path('routes/console.php');
    }

}

but the result continues to be No scheduled commands are ready to run we tried all the combinations impossible but nothing. If we uncomment the function Artisan call working, the script is executed

Try to force command crontab -e

To better understand where the problem lies We have added a crontab directly with the command without going through the schedule as :

* * * * * cd /var/www/myfolder.com/ && php artisan elena:help >> crontab.laravel

This command runs perfectly every minute so we can not figure out where the problem is. if you have the patience to give us some advice we will be happy. good day

Tobias van Beek replied 2 months ago

It does look strange that it didn't work.
I have almost the same with the only different that I use the ::class version in schedule:


    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command(\App\ConsoleCommands\HelpCenter::class)->everyMinute();
    }

I'm not sure if it result in more information but did you try to run it with -vvv (verbose) for more information?

MwSpace LLC replied 2 months ago

Yes even now, the fact is that even if I put this:

$Schedule-> command ('vbfdsvdsvds') -> everyminute ();

he always tells me:

No scheduled commands are ready to run

not even error returns 😢


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us