Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tasks]

The tag has no usage guidance.

1
vote
1answer
19 views

Tasks runs only after admin is logged in

I have a plugin which runs a task on order complete. The tasks runs successfully without any errors. But the problem is the task is only completed when admin is logged in. So if someone has completed ...
3
votes
3answers
137 views

Tons of Deleting Stale Template caches

My task queue (is that what it's called?) is filled with literally hundreds of "Deleting Stale Template Caches" and every day there seem to be new ones. Along there are also resaving entries tasks and ...
3
votes
1answer
168 views

How to manually run pending tasks in Craft CMS 3

I have a task that I want to run, but unfortunately I dont seem to be able to disable mod_gzip/mod_deflate on this server, so that task will not run in the background and causes the site to hang while ...
1
vote
0answers
28 views

Subclassing BaseTask Class

I am trying to create a Sub Task with Craft 2 that uses a task class. I have created some generic code to explain my setup: Parent Task Class: <?php namespace Craft; class ...
1
vote
1answer
26 views

How to prevent “Failed” errors in job scheduler in Craft CMS 3?

I have an instance of BaseJob that I occasionally queue up that involves reading an XML file from another server. However, requests to that server are rate-limited, and so occasionally it will fail ...
2
votes
2answers
120 views

Queue Exec Time

Please see the attached screenshot. On heavy tasks the queue is cancelled. Where do I set the timeout or remove it completely?
0
votes
0answers
30 views

Task Duplication

While developing a plugin, I've run into an issue where tasks are getting run twice (or sometimes more). In short, the plugin fetches feed data via a URL and then creates entries in Craft using that ...
0
votes
0answers
18 views

Strange behavior with Re-saving Events entries task

I have an odd issue with re-saving entries. I have a structure where I have 3 levels. There are 3 top level parent entries. If I change the Entry Url Format. It changes 2 of the parent entries and ...
0
votes
0answers
323 views

return process.env.NODE_ENV not working within gulp file.js

I am using the multi configuration setup by nystudio107, but I am unable to switch or access the node_env variable within the gulp file.js. Here is my current package.json file: Package.json { "...
1
vote
3answers
928 views

How can I troubleshoot why my queue of tasks in stuck in CraftCMS 3?

I have a series of tasks lined up in the queue to run but they are just marking one as in progress and then sitting there and not executing. I have tried updating the DB table "queue" by doing the ...
0
votes
0answers
29 views

SuperTable and locales

Having problems with using locales on a Craft site using Super Tables pretty extensively. Came across this issue which seems related: https://github.com/verbb/super-table/issues/22 It basically ...
0
votes
0answers
146 views

Cannot resolve “Deleting stale template caches” getting stalled

I'm out of ideas here. I have made a website for a client which has a lot of entries with each having a lot of fields (including a lot of matrix and neo fields). And the "Deleting stale template ...
1
vote
1answer
47 views

Why when a task is marked as “Stalled” the following tasks can't automatically processed?

This is annoying to have to click on “Try again” to unlock the queued tasks. This could leads to dozen and dozen of stucked tasks that usually could be processed without any problem (like the ...
1
vote
1answer
53 views

Deleting oldest 404 redirects task stalling

I have a site which has 100's of pending "Deleting oldest 404 redirects" tasks and they keep stalling so the list isn't clearing. The client has added lots of custom rules to the .htaccess which I ...
1
vote
1answer
37 views

Craft ordering tags by 'name'

I've got a problem with some tasks. Craft tells me 'Deleting Stale Template Caches Failed' multiple times. When I look in the Deprecated Warnings, it tells me two things: Ordering tags by ‘name’ has ...
1
vote
1answer
132 views

Craft task send mails at specific date

I already learned how to create a task from this page but I would like to know how to run this task? I'm creating a portal where users are allowed to give their votes and discuss several projects. ...
3
votes
0answers
214 views

Task “Resaving all localizable elements” is stuck when adding new new locale

I'm trying to add a new locale, but the task "Resaving all localizable elements" is stuck and the new locale is not being added to content. Even after restarting the task. There are no errors in the ...
2
votes
1answer
244 views

Failed Task and various errors in logs

I've got a few issues with a site but I'll try to separate in case they're not related. Firstly I keep getting "Failed task - Deleting stale template caches". I've looked in the logs and some ...
3
votes
2answers
307 views

GeneratePendingTransforms stuck every time

I get a stuck GeneratePendingTransforms task over and over again. In the first place, I don't know why any transforms are getting created at that point. By now, almost every image transform for every ...
1
vote
1answer
38 views

How do I hide notifications about running tasks?

I installed Import. I tried to run a test import and it froze. Now the pop-up status that appears in Craft's menu - just below Settings - will not disappear. I even uninstalled the plugin. But, ...
2
votes
1answer
63 views

Is it possible to determine if a script is running within a task?

I have a chunk of PHP code which should not be run if the script is being executed from a task. We already have these methods, which are similar to what I'm looking for: craft()->isConsole() - ...
3
votes
1answer
745 views

Generating pending image transforms stuck

My image transform task always gets stuck halfway through so that I have to "repair" the task as per this guide. Im trying to convert about 150 images (amounts to ~300 steps). Resetting the task ...
2
votes
1answer
307 views

Tasks either don't start or don't run as background processes

I'm using Laravel Valet for my Craft development environment (which is awesome, btw) except for an issue with Tasks not kicking off. I initially stumbled upon the problem while using the Import plugin....
0
votes
1answer
544 views

Stalled / Stuck Task (GeneratePendingTransforms) [duplicate]

I’ve got a task running called “GeneratePendingTransforms”, but it seems to stop/get stuck just over 65% of the way through and never completes. Is there anything that could cause this I’ve got Task ...
1
vote
1answer
725 views

Delete Stale Template Caches tasks much larger in Production than Staging

I've been running into issues where the Delete Stale Template Caches tasks on my Production environment are running up to 20x longer than on my identical Staging environment. The config/environment ...
1
vote
1answer
129 views

How to notify the user from a Task

Is it possible to somehow notify the user from a completing task? I am walking trough a set of .csv files and on completion i would like to notify the user. // last step $stepIndex = $step + 1; if ( $...
1
vote
1answer
82 views

How can I access or set a Task's properties inside a class or method?

How am I able to get or set additional properties on a Task model inside a plugin. Eventually I would like to influence the Totalsteps of a task. $task = craft()->tasks->createTask('Reroute', '...
1
vote
1answer
300 views

Memory usage in sub tasks vs. regular tasks

I'm currently implementing a task-based application, which pulls some data from an external API before creating a number of entries based on the payload. After creating the entries, the app will need ...
3
votes
1answer
431 views

Error: Variable 'entry' does not exist - When adding homepage or other entry with URL

I have an existing Craft Pro installation (v2.5.2757) that I'm using to drive an application. The current install does not have a homepage or any entry associated with a URL. All requests are being ...
3
votes
2answers
1k views

Resolving “Stuck” Background Tasks

Hi guys so I am having an issue with the "generating pending image transforms" being stuck. I've seen the solution listed here https://craftcms.com/support/stuck-tasks telling me to go to the ...
2
votes
3answers
942 views

Debugging a Failed Custom Task in Craft CMS

I am trying to debug a failed task in craft. However I'm not really sure what I'm looking for. I've dug though the log files and found traces of the task but no real errors to speak of. I have set: ...
0
votes
1answer
175 views

DeleteStaleTemplateCaches/tasks error

I've got the ol’ DeleteStaleTemplateCaches issue breaking the Craft task manager/process. I've tried switching the offending task over to error from running but is still stuck. Any thoughts on ...
1
vote
1answer
575 views

Possible memory leak - GeneratePendingTransforms/ImageMagick

Wondering if anyone else has had issues with memory and a large amount of image transforms. I seems like perhaps memory is not being freed up between transforms. When GeneratePendingTransforms is ...
4
votes
1answer
556 views

Recurring Scheduled Tasks in Craft

Is it possible to have a task (defined in a plugin) be scheduled in Craft to run on a recurring basis without having to use cron? If so, where do I put those settings (eg, to run a task hourly)?
3
votes
1answer
215 views

Tasks on Uninstall Plugin

When I try to initiate tasks on uninstall the tasks fail because the plugin completes uninstalling before the tasks. The task is referencing an uninstalled plugin at that point. Once the plugin is ...
1
vote
1answer
230 views

Entry saving in task fails due to required assets/matrix fields being read as blank, even through they are not

I have a task that is used to collate relationship data for a specific entry and save it as JSON to a text field in that entry. Everything is working fine, except for the saving of the entry which ...
1
vote
1answer
102 views

Implication of old task backlog suddenly being released

I have a Craft website that has become quite big with several dozen sections and many templates - my first bigish Craft site - being a local government one with more than a thousand pages, forms and ...
4
votes
1answer
493 views

How can I mitigate caching performance issues with Craft?

I ran into problems with the performance of one of our Craft sites. This showed up as: MySQL running out of memory and crashing, because Apache was using up all the memory in backgrounds tasks, ...
2
votes
1answer
790 views

Problems with tasks and max execution time

We've set up a task that's supposed to run through an external folder with images and resize them into 3 sizes each. This results in about 13000 tasks (one task per image). I thought each task was on ...
1
vote
1answer
131 views

Detect task is finished

Is there a way to detect when a task is finished with js, for example I have a task running I can see the progress bar in the top right corner I would like to attach an event so when the task is done ...
1
vote
0answers
381 views

Debugging Validation Errors In Craft

Is it obvious why the task validation errors are not getting output in my log: public function runStep($step) { try { $entry = craft()->entries->getEntryById($this->_entryIds[...
1
vote
1answer
311 views

Task Validation Debugging

I am having issues debugging craft tasks where the issue is caused by validation errors rather than php syntax / environment issues. How do you debug validation errors in craft tasks?
2
votes
1answer
291 views

Trigger Task Status Icon

I have a plugin that starts a task and subtasks from a CP widget AJAX call. The tasks are running without a hitch, but for some reason on production, the icon does not appear when the tasks start ...
8
votes
1answer
2k views

Documentation on creating tasks

I'm looking to integrate tasks into a plugin I'm building. Whilst I know that the Craft documentation shows the Tasks Service/Model properties/methods in the full class reference, I can't find ...
1
vote
1answer
345 views

Creating Task cause Site/CP to hang

I have created a simple task to automatically create some entries if they don't exist and this all works fine. The only issue I am having is that if the task is still running and I try and load a ...
1
vote
1answer
134 views

How to re-generate titles for all entries in a section?

Having changed the format of a Dynamic Entry Title, how do I get Craft to re-generate them all? I thought a background task would take care of it but nothing happens.
25
votes
1answer
4k views

Generating pending image transforms stuck in process

In the CMS the progress indicator for tasks is stuck and not completing its jobs. What can I do to resolve this?
3
votes
1answer
2k views

Long 'Deleting stale template caches'

Is it common to have a (near)constantly running 'Deleting stale template caches' task ongoing? I commonly log in to see a task still pending several hours after the last change to the site was made, ...
2
votes
1answer
798 views

My tasks don't seem to be running as a background process

I have my plugin working now so that I can email users who's accounts will expire in 7 days time. The users are being selected correctly and the emails are being sent as expected. However, the tasks ...
7
votes
5answers
3k views

Triggering the start of a task from a CRON job

I have a site setup which is for subscribers only. I have added a user expiry date field to the users section and everything is working perfectly on the front end in that I can restrict access to ...