AutoSchedule Project Job Failing

Document ID : KB000109920
Last Modified Date : 07/08/2018
Show Technical Document Details
Issue:
Auto Schedule Project job is failing for an specific project with the following error: 
ERROR 2018-07-27 09:51:36,058 [Dispatch Autoschedule Project : bg@yourBGserver (tenant=clarity)] projmgr.scheduling (clarity:user_name:14590072__C5F102DF-94DE-4C00-95DA-D288B914397B:Autoschedule Project) 
java.lang.NullPointerException
                at com.niku.cse.util.SECalendarUtil.diffWorkday(SECalendarUtil.java:32)
                at com.niku.cse.datamodel.SETask.initSEFloat(SETask.java:158)
                at com.niku.cse.SETaskHandler.initFloatForPriority(SETaskHandler.java:418)
                at com.niku.cse.SETaskHandler.initPrioritySort(SETaskHandler.java:173)
                at com.niku.cse.SETaskHandler.getPrioritySort(SETaskHandler.java:156)
                at com.niku.cse.SEAutoScheduler.forwardPass(SEAutoScheduler.java:296)
                at com.niku.cse.SEAutoScheduler.cpm(SEAutoScheduler.java:228)
                at com.niku.cse.SEAutoScheduler.autoschedule(SEAutoScheduler.java:145)
                at com.niku.projmgr.autoschedule.SEClarityAutoscheduler.autoschedule(SEClarityAutoscheduler.java:309)
                at com.niku.projmgr.autoschedule.SEClarityAutoscheduler.doAutoschedule(SEClarityAutoscheduler.java:783)
                at com.niku.projmgr.autoschedule.SEClarityAutoscheduler.doAutoschedule(SEClarityAutoscheduler.java:91)
                at com.niku.projmgr.autoschedule.jobs.AutoschedulerJob.scheduledEventFired(AutoschedulerJob.java:66)
                at com.niku.njs.Dispatcher$BGTask.run(Dispatcher.java:393)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
ERROR 2018-07-27 09:51:36,058 [Dispatch Autoschedule Project : bg@yourBGserver (tenant=clarity)] projmgr.scheduling (clarity:user_name:14590072__C5F102DF-94DE-4C00-95DA-D288B914397B:Autoschedule Project) ---> could not execute autoschedule job (6169051)
java.lang.Exception: Autoschedule throwable caught: null
                at com.niku.projmgr.autoschedule.SEClarityAutoscheduler.doAutoschedule(SEClarityAutoscheduler.java:799)
                at com.niku.projmgr.autoschedule.SEClarityAutoscheduler.doAutoschedule(SEClarityAutoscheduler.java:91)
                at com.niku.projmgr.autoschedule.jobs.AutoschedulerJob.scheduledEventFired(AutoschedulerJob.java:66)
                at com.niku.njs.Dispatcher$BGTask.run(Dispatcher.java:393)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
                at com.niku.cse.util.SECalendarUtil.diffWorkday(SECalendarUtil.java:32)
                at com.niku.cse.datamodel.SETask.initSEFloat(SETask.java:158)
                at com.niku.cse.SETaskHandler.initFloatForPriority(SETaskHandler.java:418)
                at com.niku.cse.SETaskHandler.initPrioritySort(SETaskHandler.java:173)
                at com.niku.cse.SETaskHandler.getPrioritySort(SETaskHandler.java:156)
                at com.niku.cse.SEAutoScheduler.forwardPass(SEAutoScheduler.java:296)
                at com.niku.cse.SEAutoScheduler.cpm(SEAutoScheduler.java:228)
                at com.niku.cse.SEAutoScheduler.autoschedule(SEAutoScheduler.java:145)
                at com.niku.projmgr.autoschedule.SEClarityAutoscheduler.autoschedule(SEClarityAutoscheduler.java:309)
                at com.niku.projmgr.autoschedule.SEClarityAutoscheduler.doAutoschedule(SEClarityAutoscheduler.java:783)
                ... 6 more
ERROR 2018-07-27 09:51:36,073 [Dispatch Autoschedule Project : bg@yourBGserver (tenant=clarity)] niku.njs (clarity:user_name:14590072__C5F102DF-94DE-4C00-95DA-D288B914397B:Autoschedule Project) Error executing job: 6169051
com.niku.union.utility.MessageKeyException: PRJ-SE04: Could not execute autoschedule job (6169051): Autoschedule throwable caught: null
                at com.niku.projmgr.autoschedule.jobs.AutoschedulerJob.scheduledEventFired(AutoschedulerJob.java:91)
                at com.niku.njs.Dispatcher$BGTask.run(Dispatcher.java:393)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)
Cause:
This error points to a circular dependency that PPM should not have allowed to be created which causes the autoscheduling job to fail.
Resolution:
To find the circular dependency, you need to delete dependencies one task at a time, autoscheduling after each removal, until autoscheduling completed successfully to narrow down which task had the issue.
Or you can run the query below to identify circular dependency:
--if this query fails, it means there is a circular reference.
select *
from
(
SELECT PRNAME, LEVEL lev, SYS_CONNECT_BY_PATH(PRNAME, '//') path
FROM (
select prtask.prid, prtask.prname, prdependency.PRPREDTASKID
from prtask
left join prdependency on prdependency.PRSUCCTASKID = prtask.prid
where prtask.prprojectid = 5359023
) results
START WITH prid is not null
CONNECT BY PRIOR prid = PRPREDTASKID
)
order by 2

--Run this query and look for connect_by_iscycle = 1 which will show you the circular references
select *
from
(
SELECT PRNAME, LEVEL lev, SYS_CONNECT_BY_PATH(PRNAME, '//') path, CONNECT_BY_ISCYCLE
FROM (
select prtask.prid, prtask.prname, prdependency.PRPREDTASKID
from prtask
left join prdependency on prdependency.PRSUCCTASKID = prtask.prid
where prtask.prprojectid = 5359023
) results
START WITH prid is not null
CONNECT BY NOCYCLE PRIOR prid = PRPREDTASKID
)
order by 2