Windows Server 2016: Task Scheduler "Launch task ... same task is already running"

David Marino 136 Reputation points
2021-03-24T16:27:08.89+00:00

Environment: VM Windows server 2016, x64 base, 8GB Mem
Utility App: Console .Net 4.6.1
App Function: Alerts if files not received on time; otherwise it does nothing
Task Job Configuration: Runs every hour (11 minutes after the hr.) / indefinitely, all week
Task is run under a Service ID with the highest privileges
Task is configured to force stop after 30 minutes; this job doesn't run more than 2 minutes.

  1. I consistently see "Launch" errors due the system "seeing" an instance of the job already running.
    a. I logged on with the Service ID, and via the Task Mgr. I saw the .EXE come into view and disappeared after 2 minutes. This is the expected results.
    b. The Task history indicates that job completes successfully.
    c. In the code, I explicitly relinquished all resources and explicitly exited the app; System.Environment.Exit(0) to see if this made any difference; it did not.
    d. I deleted the task on the test server, and created it again with the same name. The system saw the previous task iteration’s history
    e. This issue seemed to manifested after we moved to Server 2016 from 2008 R2
    f. Since this is an innocuous app, I moved it to prod, creating the task job from scratch. Test & Prod server are similarly created. The issue started to appear after 24 hours in prod
    g. Only two tasks in PROD exhibit this system, and they have 2 different code base
    As far as I can tell the app is functioning as expected despite the "Launch" errors. Although due to how the app works, I’m not 100% sure that the app was active to determine whether or not the files were in the folder. I’m considering to set the task scheduler kill the running instance as a work around, but I would like to get to the root of the issue.

Note:

  1. I'm not a server admin, I'm in an application support / dev role. The server admin dept. was kind enough to leave me to my own devices to solve this issue
  2. I have the same issue on the test server, but the code doesn’t explicitly exit the app. I'm not sure if this is the right forum, but the MS forum seem to indicate this is the forum for Task Scheduler issues.

I greatly appreciate any guidance on how best go about troubleshooting this issue.

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,053 questions
0 comments No comments
{count} votes

Accepted answer
  1. Carl Fan 6,836 Reputation points
    2021-03-25T08:21:51+00:00

    Hi,
    It may happen that a task that runs as scheduled task simply does not terminate. Try changing few options in task scheduler to check.
    Please refer to the information below.
    https://superuser.com/questions/1106016/task-launch-failed-instance-already-running
    Hope this helps and please help to accept as Answer if the response is useful.
    Best Regards,
    Carl


0 additional answers

Sort by: Most helpful