# Shopware scheduled tasks (cron) do not work

**URL:** https://forum.shopware.com/t/shopware-scheduled-tasks-cron-do-not-work/68577
**Category:** Programming (EN)
**Created:** [24. Juli 2020 um 12:54 UTC](https://forum.shopware.com/t/shopware-scheduled-tasks-cron-do-not-work/68577 "2020-07-24T12:54:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AnriKo](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@AnriKo](https://forum.shopware.com/u/AnriKo)
#### Post date: [24. Juli 2020 um 12:54 UTC](https://forum.shopware.com/t/shopware-scheduled-tasks-cron-do-not-work/68577/1 "2020-07-24T12:54:48Z")

</div>

Hello everybody. Have question about shopware scheduled task (cron). I create ScheduledTask in my custom plugin, actived this plugin but this task not work.

I check ScheduledTask in shopware database, there exist my task with status queued. But why it not execution? And how I see in scheduled\_task database table there exist 6 tasks but no one of them no execution. Maiby need some ssh command to start them all or only one task can run, or some else? I tried php bin/console scheduled-task:run but no effect. Shopware 6, I will be grateful for any advice, tips.

---

<div class="post-metadata">

### Author: ![katkatdev](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@katkatdev](https://forum.shopware.com/u/katkatdev)
#### Post date: [25. Juli 2020 um 11:47 UTC](https://forum.shopware.com/t/shopware-scheduled-tasks-cron-do-not-work/68577/2 "2020-07-25T11:47:14Z")

</div>

Hey,

my expierence so far:

scheduled-task:register

scheduled-task:run (then, I dont know why, abort the running)

then do:

messenger:consume &nbsp;&nbsp;

After this, have a look in the scheduled tasks DB table and most important in your log file. Choose a short task interval&nbsp;to test if the customized task runs correctectly. Task in Database should be now set to “scheduled” - if successful. If it fails - “failed”- Log file will also provide you with further information. Still figuring out the process myself, hopefully this helped a bit further.

---

<div class="post-metadata">

### Author: ![Sumedia](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@Sumedia](https://forum.shopware.com/u/Sumedia)
#### Post date: [19. Februar 2021 um 22:04 UTC](https://forum.shopware.com/t/shopware-scheduled-tasks-cron-do-not-work/68577/3 "2021-02-19T22:04:58Z")

</div>

On the Administrationpanel by default it runs cronjobs and consume messages in asynchronous requests continously.  
Try to check the Network Details on your Inspection Tool of Browser.

This feature can be disabled.

In this case it’s on you to trigger the cron jobs with: scheduled-task:run  
scheduled-task:run is a programm you can give parameters for execution time else it will run till break by user.  
about: messenger:consume im not allready famliar with it. It could be, that you have to execute it on console but im not sure currently.

Normaly stucking in “queued” and “failed” points out, that something goes wrong.  
It’s hard to debug.

Is your Environment ENV=dev  
Does it write dev.log in var/log  
Could you try to treat errors with an custom log file in the Cronjob (Execution) for debugging.

I currently use an AbstractCronHandler which tries (try{]catch{}) to execute and log in a seperated custom log file.
