Clarity

 View Only
  • 1.  Processes Not Starting

    Posted Jul 03, 2015 07:07 AM

    Since we upgraded our Dev environment processes are not starting. They are getting into the Queue but they don't start.

     

    Has anyone encountered this issue before?



  • 2.  Re: Processes Not Starting

    Posted Jul 03, 2015 07:17 AM

    I see the following in the bg log file:

     

    ERROR 2015-07-03 07:09:06,522 [Process Loader (tenant=clarity)] bpm.engine (clarity:process_admin:199910840__96C7437D-931B-4DD1-B8DC-647C763E8A4D:none)

    com.niku.bpm.BpmException: loadProcessInstances - Missmatched Process Threads. threadIndex: 5 threadRows.length: 10

    dbResults size: 5

      DBResultSet: 0 No of rows: 9

        Row: 0 No of columns: 9

          Column Name: start_step_id Value: 5116915

          Column Name: initiated_type_code Value: BPM_PIT_USER

          Column Name: initiated_by Value: 1

          Column Name: status_code Value: BPM_PIS_RUNNING

          Column Name: process_instance_id Value: 7585236

          Column Name: end_step_id Value: 5116916

          Column Name: process_version_id Value: 5107397

          Column Name: process_code Value: ret_proj_create_proc_14

          Column Name: src_step_action_result_id Value: -1

        Row: 1 No of columns: 9

          Column Name: start_step_id Value: 5116915

          Column Name: initiated_type_code Value: BPM_PIT_USER

          Column Name: initiated_by Value: 1

          Column Name: status_code Value: BPM_PIS_RUNNING

          Column Name: process_instance_id Value: 7585239

          Column Name: end_step_id Value: 5116916

          Column Name: process_version_id Value: 5107397

          Column Name: process_code Value: ret_proj_create_proc_14

          Column Name: src_step_action_result_id Value: -1

        Row: 2 No of columns: 9

          Column Name: start_step_id Value: 5116915

          Column Name: initiated_type_code Value: BPM_PIT_USER

          Column Name: initiated_by Value: 1

          Column Name: status_code Value: BPM_PIS_RUNNING

          Column Name: process_instance_id Value: 7585245

          Column Name: end_step_id Value: 5116916

          Column Name: process_version_id Value: 5107397

          Column Name: process_code Value: ret_proj_create_proc_14

          Column Name: src_step_action_result_id Value: -1

        Row: 3 No of columns: 9

          Column Name: start_step_id Value: 5006371

          Column Name: initiated_type_code Value: BPM_PIT_USER

          Column Name: initiated_by Value: 5566443

          Column Name: status_code Value: BPM_PIS_RUNNING

          Column Name: process_instance_id Value: 7585340

          Column Name: end_step_id Value: 5006375

          Column Name: process_version_id Value: 5001272

          Column Name: process_code Value: ili_idea_hl_app4

          Column Name: src_step_action_result_id Value: -1

        Row: 4 No of columns: 9

          Column Name: start_step_id Value: 5006653

          Column Name: initiated_type_code Value: BPM_PIT_USER

          Column Name: initiated_by Value: 5504434

          Column Name: status_code Value: BPM_PIS_RUNNING

          Column Name: process_instance_id Value: 7585418

          Column Name: end_step_id Value: 5006654

          Column Name: process_version_id Value: 5001307

          Column Name: process_code Value: ili_br_est_app_proc11

          Column Name: src_step_action_result_id Value: -1

        Row: 5 No of columns: 9

          Column Name: start_step_id Value: 5132918

          Column Name: initiated_type_code Value: BPM_PIT_USER

          Column Name: initiated_by Value: 5060372

          Column Name: status_code Value: BPM_PIS_RUNNING

          Column Name: process_instance_id Value: 7587134

          Column Name: end_step_id Value: 5132920

          Column Name: process_version_id Value: 5123398

          Column Name: process_code Value: kk_ret_part_time_approval_proc

          Column Name: src_step_action_result_id Value: -1

        Row: 6 No of columns: 9



  • 3.  Re: Processes Not Starting

    Posted Jul 03, 2015 07:53 AM

    Have you tried restarting the bg ?

     

    NJ



  • 4.  Re: Processes Not Starting

    Posted Jul 03, 2015 07:56 AM

    Yes we restarted the bg service but got the same issue when we tried again.



  • 5.  Re: Processes Not Starting

    Broadcom Employee
    Posted Jul 03, 2015 08:25 AM

    Hi Colin,

     

    From the error it looks like the treads have issue

    com.niku.bpm.BpmException: loadProcessInstances - Missmatched Process Threads. threadIndex: 5 threadRows.length: 10


    So couple of things


    1. What is the count of completed process you have?

    2. SQL to check for orphans...

     

     

    select COUNT(*) from (select object_instance_id from cmn_sec_assgnd_obj_perm p

        where p.object_ID = 50680

        minus

        select ID from BPM_RUN_PROCESSES) q

     

    Let me know to suggest further.

     

    Regards

    Suman Pramanik

     




  • 6.  Re: Processes Not Starting
    Best Answer

    Posted Jul 03, 2015 08:30 AM

    This kind of issue might occur due to orphan process instances. Run the following query to determine which process or processes are causing the mismatched threads error. There may be processes listed in the mismatched threads errors that are not actually a problem.

     

    SELECT process_instance_id, id as thread_id, parent_step_instance_id,

    join_step_instance_id

    FROM bpm_run_threads threads

    WHERE threads.process_instance_id not in

    ( Select pi.id from bpm_run_processes pi, bpm_def_process_versions v,

    bpm_def_processes bdp

    WHERE pi.process_version_id = v.id

    AND v.process_id = bdp.id

    )

     

    Let me know if you are getting any rows after running the above query.

     

    Thanks,

    Abhisek Dhar



  • 7.  Re: Processes Not Starting

    Posted Jul 03, 2015 09:24 AM

    Suman - in answer to your questions:

     

    1. The number of completed processes is 499199

     

     

    2. That SQL statement is giving the following error messages:

     

     

    Msg 102, Level 15, State 1, Line 3

    Incorrect syntax near 'minus'.

    Msg 102, Level 15, State 1, Line 4

    Incorrect syntax near ')'.

     

    Abhisek, when I run the query I see the following results:
    orphan_process_instance.PNG



  • 8.  Re: Processes Not Starting

    Broadcom Employee
    Posted Jul 03, 2015 09:26 AM

    Hi Colin,

     

    My bad i missed you are on MS SQL, here is the new

     

    select

      COUNT(*)

    from

      ( select

          object_instance_id

        from

          cmn_sec_assgnd_obj_perm p

        where p.object_ID = 50680

        and object_instance_id is not null

        except

        select ID from BPM_RUN_PROCESSES

      ) q

     

     

    Ok, Can you run the delete process instance job and get it cleaned. 499199 is lot.

     

     

    Regards

    Suman Pramanik



  • 9.  Re: Processes Not Starting

    Posted Jul 03, 2015 09:31 AM

    Thank you Suman.

     

    Here are the results:

     

    select.PNG



  • 10.  Re: Processes Not Starting

    Broadcom Employee
    Posted Jul 03, 2015 09:38 AM

    Ah, its coming from older version due to a known bug CLRT-57954 but please run the delete process instance job and then run the select query and then delete the orphan using the delete statement.

     

    Here's the delete

     

     

    Begin

      LOOP

        Delete from cmn_sec_assgnd_obj_perm

        where object_ID = 50680

        and object_instance_id IN (

        select object_instance_id from cmn_sec_assgnd_obj_perm p

        where p.object_ID = 50680

        minus

        select ID from BPM_RUN_PROCESSES)

        AND ROWNUM <= 100000;

        EXIT WHEN SQL%ROWCOUNT = 0;

        COMMIT;

      END LOOP;

    END; 

     

    Have a great weekend.

     

    Regards

    Suman Pramanik



  • 11.  Re: Processes Not Starting

    Posted Jul 06, 2015 07:29 AM

    Hi guys,

     

    we were able to determine that we had an orphaned process.

    SELECT * FROM bpm_run_processes

    WHERE  process_version_id NOT IN (SELECT id

               FROM   bpm_def_process_versions)

     

    We stopped the bg service

     

    Then deleted the orphaned process.

     

    DELETE FROM bpm_run_processes

    WHERE  process_version_id NOT IN (SELECT id

               FROM   bpm_def_process_versions)

     

    Restarted the bg service.

     

    Processes are now running again as expected.

     

    Many thanks for the kind tips and advice - much appreciated as always.