12

We have a number of Windows Scheduled tasks that run on one Server 2008 Webserver (not R2) which is in a cluster.

We recently moved from an original webserver Cluster to a new webserver Cluser (Server 2008 - not R2).

The new webserver (in the cluster) running the Windows Tasks is setup the same as on the original we believe.

BUT we now find that on the new Windows Server the Windows Task Scheduler seems to want to instantly start each task three times.

If we set the option to queue up a new task we get:

Event ID 324 Task Scheduler queued instance "{9a1a8411-b042-45ff-8e6b-89874df230d7}" of task "\Client Reporting" and will launch it as soon as instance "{2bcc3df6-ea3b-4453-90c2-75b8b1946388}" completes.

If we set the option to stop an existing task we get:

Event ID 323 Task Scheduler stopped instance "{e685a910-b32b-414e-85fd-96bbe54314a2}" of task "\Client Reporting" in order to launch new instance "{4db66265-1f51-4ede-8535-ac7c3cb5c4c1}" .

Ticked settings:

  • Allow task to be run on demand.

  • Run task as soon as possible after a scheduled start is missed.

  • Stop the task if running for longer than 1 hour.

  • If the running task does not end when requested force it to stop.

  • Start the task only if the computer is on AC power.

  • Stop the task if the computer switches to battery power.

Selected option: If the task is already running - stop the existing instance.

Note: We moved the tasks from one server to another in the cluster to see if it the Task Scheduler on the particular server we'd picked causing the problem. Same behaviour.

Could it be something to do with the build of the new servers?

We have very similar tasks set up on another server cluster that work OK without all this multiple starting. Comparing those tasks to the ones here - there does not seem to be anything obviously different in terms of settings available to us through the options within the Task Scheduler.

Trigger: The task is scheduled to be triggered daily, once an hour - and to be stopped if it exceeds this time.

Action: Runs a .bat file.

What could be causing this/where we can look to see what logic is causing the tasks to start multiple times in this way?

1

6 Answers 6

4

This is the issue described in KB2617046: if you disable and then enable a scheduled task, duplicate triggers are created. The task properties still shows only one trigger, but you can see that the task is triggered multiple times simultaneously in the task history.

There is a hotfix available from Microsoft. The hotfix says it is for Vista, but it works on Server 2008 SP2. After applying the hotfix, you have to disable and then re-enable the trigger on your task (closing the trigger properties window in between to apply the changes) in order to get rid of the duplicates.

5
  • 2
    Link broken as of June 2017, searching for KB gives this new link: Duplicate triggers are generated incorrectly in scheduled tasks in Windows Vista or in Windows Server 2008 Jun 21, 2017 at 8:45
  • 1
    I am experiencing a similar issue in Windows Server 2016, where I can see that the task is started and ran correctly + several dozens of attempts to run again. Unfortunately, all above links are broken. It is properly set and it will run only once at the set interval, but it also floods the history with warnings. Any idea if Windows Server 2016 has a similar issue and fix? Thanks.
    – Alexei
    Apr 8, 2019 at 12:18
  • I'm having a similar problem @Alexei - did you ever find a fix? Jan 13, 2021 at 17:06
  • @RichardWard I do not remember being able to fix this. What version of Windows Server are you using? I am wondering if this is not fixed in a recent Windows Server version.
    – Alexei
    Jan 13, 2021 at 19:24
  • @Alexei 2016, but I couldn't tell you the pack or patch off the top of my head. Jan 14, 2021 at 10:51
1

We managed to stop Windows Task Scheduler starting up multiple processes by ticking the option "If the task fails, restart every:" with the defaults of "1 minute" and "Attempt to restart up to: 3 times".

This seemed counter-intuitive as

  1. the tasks did not appear to be failing (the actions they perform got run multiple times)

and 2. the tasks already seemed to be deciding to start three times anyway.

Also - we have these same tasks setup on Test webservers and have not needed to tick this option.

0

For whatever reason I can't add a comment to your answer, however it is likely "failing" because the task is returning a exit code other than 0. You can fix this by scheduling a script to run instead of the actual task process. You would have the script run the actual task process, and after it completed check the exit code of the process against a list of known success codes. If it is a success, have the script exit with code 0 and if it was not a success, pass the failure exit code. This way you still retain the ability of task scheduler to rerun the task in case is actually fails.

Unfortunately it is not uncommon for processes which successfully executed to return exit codes other than 0. You would need to check the documentation (or ask the developer) about what the various exit codes are.

2
  • 50 rep is needed to comment on others' questions and answers...
    – EEAA
    Oct 13, 2013 at 3:05
  • Thanks EEAA. And to follow up on my post it seems Pual is all ready runing a batch script. Without knowing what is in his script, and what exit code it is returning it is hard to say why it is returning a code other than 0, but my comment/answer should still be correct, the Task Scheduler is assuming it will return exit code 0 when it isnt.
    – Matt
    Oct 13, 2013 at 3:21
0

I faced this issue on WinServer2008 R2 a couple of months ago. I tried many solutions but nothing solved the issue.

the following seems to solve the issue : On Task Scheduler Application : select the task : then from the right menu click 'End', it will ask you 'Do you want to end all instances of this task?' click 'Yes'.

I hope this will solve your issue.

0

Over 10 years later... We found the same issue as OP described, but in our case it was a simple matter of running the job itself manually to see if it actually works in the first place!

It turned out it didn't and aborted with a bad JSON formatted file error. There was no need to create a separate BAT/CMD script to run the EXE. We just fixed the error in the program and JSON file, and it worked fine without multiple running issues as described.

Have to keep in mind, that the Task Scheduler will try and run itself again and again, if the original program you're calling fails with an error.

-1

The same issue was happeing here any task gets in queue so browsed all the task which were running or in queue end them all and restarted the server it was fixed

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .