codestudiohq / laravel-totem

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

Commands Not Running Even Though Listed #280

Closed s1rc closed 2 years ago

s1rc commented 3 years ago

Just switching from manually scheduling tasks into Totem. Everything is imported and php artisan schedule:list shows all commands correctly. However none of the commands run at their scheduled time, though manually executing through Totem does work.

Trying to debug locally if I create command to simply log an output, it shows up in list:

image

Not sure if there is other configuration missing why this isn't working?

Laravel Framework: 8.34.0 Laravel Totem: 8.1.1

ikudosi commented 3 years ago

I also noticed the commands were not running when upgrading to latest version. I downgrade to version 8.0.4 and tasks are now running however I don't see any execution results.

s1rc commented 3 years ago

@ikudosi thank you that did work, but no execution results as you mentioned.

daniel-g-wood commented 3 years ago

@ikudosi, @s1rc, Unfortunately, downgrading to 8.0.4 may not work because of the bug introduced in 8.0.3 (see #271). Can you try using version 8.0.2 and see if the issue persists? I've tried a few different things (including creating a new app with a task in Totem and running schedule:test) and I'm not able to reproduce the issue (the task still executes and adds to the results).

Are you getting any errors in your log files?

s1rc commented 3 years ago

@daniel-g-wood trying with 8.0.2, the tasks are running but no results. Now we are getting which wasn't in the logs with 8.0.4.

Undefined property: Illuminate\\Console\\Scheduling\\Event::$start at /var/www/vendor/studio/laravel-totem/src/Providers/ConsoleServiceProvider.php:44)
daniel-g-wood commented 3 years ago

@s1rc It doesn't look like going backwards is going to solve this. This might be the same issue as #278. Try using a standard Artisan command, and setting the queue driver to sync, and attempting to execute the command via the totem dashboard and also via schedule:test and see if you end up with any results in the database then.

s1rc commented 3 years ago

The default queue connection is already sync since we override already to different queues per job.

Manually triggering each job from Totem already worked ok, even on v8.1.1. The results display in Totem.

ikudosi commented 3 years ago

Updated to latest version (8.1.3) and still cannot get this to work. I see the test.txt being created but tasks are not firing on its scheduled time. Manually executing the task works by clicking on the checkmark.

When I run php artisan schedule:list this is the output:

image

stale[bot] commented 3 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.

kanhaiyam commented 3 years ago

@s1rc @daniel-g-wood Found the solution.

There are a few Laravel protocols that you know and understand before I give you the solution to this, When executing a task from totem dashboard, that task is being executed by PHP. Similarly, when a job gets executed by the scheduler weather using schedule:test OR schedule:run, it gets executed by shell.

Now, since the scheduler is overridden by Totem, totem create a temp log file at storage path - storage/app/totem/ and deletes it after execution. And since it is getting executed by shell, the shell output and errors gets suppressed, hence we don't get to know about it.

So for your tasks to be executed by Totem Scheduler you should give proper permission to storage path - storage/app/totem/ so that shell can create and delete file at the location.

kanhaiyam commented 3 years ago

@s1rc @daniel-g-wood Can you guys please verify if it solved your issue.

shijie1991 commented 3 years ago

Laravel Framework 8.51.0 versions : * v8.1.4

无法自动运行

s1rc commented 3 years ago

@kanhaiyam I'd love to try but I can't even install totem anymore on a local env. https://github.com/codestudiohq/laravel-totem/issues/290

qschmick commented 3 years ago

@kanhaiyam Please see #295 as there is a proposed solution to remove the local storage usage. Additionally, I had a similar issue of some commands running and others not when I used the do not overlap functionality. One of the jobs errors but the mutex entries were created by Laravel already but not cleaned up and they persisted. I could manually run but when running the commands via schedule:run they would be skipped. Not sure if the same issue or just related to the local storage. Hopefully after #295 is reviewed and released the issue will be resolved.

kanhaiyam commented 3 years ago

@qschmick This seems promising.

qschmick commented 3 years ago

New version released (https://github.com/codestudiohq/laravel-totem/releases/tag/v8.2.0). Let us know if it fixes the issue.

kanhaiyam commented 3 years ago

Thanks for the notification. Will check the results and get back to you soon.

On 14-Aug-2021, at 1:36 AM, Quentin Schmick @.***> wrote:

 New version released (https://github.com/codestudiohq/laravel-totem/releases/tag/v8.2.0). Let us know if it fixes the issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

stale[bot] commented 2 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.