Scheduled Jobs Stuck Running

  • Updated

This article describes an issue where a scheduled job gets stuck running and fails to run properly moving forward. The article will provide steps to resolve the issue.

Note: If this site is on DXC, the customer will have to engage a managed service resource to assist in executing steps below.

For the case of discussion we will use the "Automatic Emptying of Trash" job as an example.

  1. Identify the name of the scheduled job that is stuck running. The Name of the job exists in the database.

    All scheduled jobs appear in the CMS database in the dbo.tblScheduledItem table. The Name column is the actual name of the job.

    SELECT * from dbo.tblScheduledItem
    WHERE Name = 'Automatic Emptying of Trash'
    jobs.PNG 
  2. A resource with the appropriate access must stop the app services connected to this database (both the main app service and scheduler). 

  3. A resource with database access will have to mark the job as stopped and disabled with one of the the following scripts.

    Note: isRunning is the job running and Enabled is if it is marked to auto run on a schedule.

    UPDATE dbo.tblScheduledItem
    SET IsRunning = 0, Enabled = 0
    WHERE Name = 'Automatic Emptying of Trash'

  4. Restart the app services.

  5. After the site has started, confirm that the following query returns 0. 

    SELECT IsRunning
    FROM dbo.tblScheduledItem
    WHERE Name = 'Automatic Emptying of Trash'

  6. The customer can then run the job once manually to confirm it works.
  7. Once that manual job completes, the customer will re enable the scheduled job in the CMS.