codestudiohq / laravel-totem

Manage Your Laravel Schedule From A Web Dashboard
MIT License
1.79k stars 224 forks source link

Cron Job not running totem commands #33

Closed andrewwindfall closed 7 years ago

andrewwindfall commented 7 years ago

I am running Laravel 5.5 I have a cron job set to run every min at: php /complete/path/to/app/artisan schedule:run >/dev/null 2>&1

It only runs commands set in the app/console/kernel.php I can test this with the inspire command, and it works fine but never runs the tasks in totem.

When I run php artisan schedule:run via ssh, it runs the tasks set in totem as well as in kernel.php. Php artisan schedule:list also returns totem tasks and kernel tasks. Totem tasks view does not display tasks listed in kernel.

When I remove all kernel tasks, the cron job simply displays this: No scheduled commands are ready to run.

All tasks are set to run every min. I need my totem tasks to run every min! Any ideas what I am doing wrong?

I am just using simple tasks such as inspire and command list for testing.

roshangautam commented 7 years ago

Just tested this in a fresh installation of L5.5. Its working fine. Make sure your cron is setup correctly. What operating system are you testing this on ?

Also make sure you are on the latest version of totem.

roshangautam commented 7 years ago

@andrewwindfall still having problems ?

andrewwindfall commented 7 years ago

Yes, not sure where to troubleshoot from here. Odd that totem can see its tasks and run its tasks just fine via web browser. And odd that ssh artisan command can run all kernel tasks and totem tasks. Yet the cron running the exact same command can only run kernel tasks.

The server is running apache 5.6.35. I thought that Auth might be the issue, so I removed it from the boot function in my AppServiceProvider but that did not fix things. The cron job still believes that no commands are ready to run. I must have broken something in the way tasks are scheduled. Totem dashboard thinks they should be running every min, but the cron job seemingly does not.

Open to your thoughts, but I also realize this issue is probably on my end only.

roshangautam commented 7 years ago

I've tested this in both 5.4 and 5.5 vanilla installations and its working fine. Also latest apache is 2.4, I believe you are trying to say php 5.6 ? Also L5.5 only support php 7.0 and up. Are you trying this in an existing laravel application or vanilla laravel instance ?

andrewwindfall commented 7 years ago

php version 7.1.9 new laravel application. This package was auto-discovered by 5.5

roshangautam commented 7 years ago

whats your development environment and how are you configuring your cron job ?

andrewwindfall commented 7 years ago

Running Composer self-update via SSH and then composer update fixed this issue thanks to suggestions from @roshangautam. Composer version on the server was out of date.