codestudiohq / laravel-totem

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

[BUG] Schedule page and console list desync #115

Closed chssmith closed 4 years ago

chssmith commented 6 years ago

In our environment, none of our tasks are getting executed anymore. On the page, we have tasks (just a sample of our tasks):

image

But notice that the only task that appears to be executing anymore is the Download TV Guide. Which was one of the first tasks added to the system. Most of our tasks look exactly the same: 8/31 was their last execution. Even though they have upcoming scheduled times. This includes tasks that are supposed to run every minute.

However, the console command: image

Lists nothing.

This morning, I ran a composer update to see if it would fix the problem, and no issues with the update. But tasks still aren't running. I checked my crontab:

* * * * * * php /var/www/html/scheduler/artisan schedule:run >> /var/www/html/scheduler/storage/logs/schedule_runs.log 2>&1

Which writes to a log file so we can make sure everything is running. And the scheduled task runs.

Any of the tasks on the page can be run manually by hitting the play button.

roshangautam commented 6 years ago

try php artisan cache:clear and see what happens

chssmith commented 6 years ago

Does not seem to have helped.

image

roshangautam commented 6 years ago

What version of Laravel and Totem are you running?

chssmith commented 6 years ago

Laravel 5.5.43 Totem 2.4.1

roshangautam commented 6 years ago

I am not able to reproduce this on Laravel 5.5.42 and Totem 2.4.1. Just tested this on a fresh 5.5 install and its working fine.

Also I can't find Laravel 5.5.43 assuming you are talking about laravel/framework package. The latest tag is 5.5.42

Can you try scheduling a command directly from app/Console/kernel.php and see if that shows up in schedule:list?

chssmith commented 6 years ago

See attachment below as far as version numbers.

It does appear scheduling via Kernel.php is working correctly: image image

And we've been running Totem for about 6 months up to this point. And nothing changed on Friday when everything seemed to stop running.

Attachment: image

roshangautam commented 6 years ago

I see 5.5.43 now. Still not able to reproduce. The only reason a scheduled task wouldn't show up in schedule:list is if its disabled.

chssmith commented 6 years ago

I do have 3 disabled tasks. But even the task that is running (Download TV Schedule) doesn't show up in that schedule list. So I'm not certain if it's going to run tomorrow.

In addition, creating new tasks via the totem pages does not appear to add anything into the scheduled tasks list.

syphernl commented 5 years ago

Seems like the cache may be an issue here. At least, it is on our end. schedule:list doesn't show new entries we added trough the model and still shows the old ones.

The overview changes once we clear the cache manually. I see that some Totem caching functionality was added at the beginning of September.

michalper commented 5 years ago

Hi,

I've exactly the same problem.

Kernel.php class: image

Totem dashboard: image

Schedule list: image

I don't know what to do next. This is a fresh installation of Totem in very old Laravel project which was updated from version 4.2 to latest 5.8. Project was also migrated from PHP 5.6 to 7.3. After three days of looking for solution, I write to You guys.

Maybe I've missed something when I was migrating Laravel between versions, but seriously I don't know what am I looking for to fix it...

Please help!

b-roberts commented 5 years ago

I had this issue and it was related to how the ConsoleServiceProvider was getting loaded, or rather not getting loaded. The check that is in place to ensure the database is setup doesn't handle non-standard configurations well. See https://github.com/codestudiohq/laravel-totem/pull/198

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.