Project

General

Profile

Actions

Defect #1593

closed

AddNewAutomaticRoleTaskExecutor run before IdmRoleTreeNodeDto was saved

Added by Ondřej Kopr over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Radek Tomiška
Category:
Automatic roles
Target version:
Start date:
04/02/2019
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

There is some strange behavior with this LRT and commit before transaction. But this issues was explored by old version.

The AddNewAutomaticRoleTaskExecutor LRT was started and executed before IdmRoleTreeNodeDto was saved. There is screens:

Record in all LRT agenda

LRT detail

Audit detail of IdmRoleTreeNodeDto

Error:

eu.bcvsolutions.idm.core.api.exception.ResultCodeException: Automatic role id is required.
    at eu.bcvsolutions.idm.core.scheduler.task.impl.AddNewAutomaticRoleTaskExecutor.getRoleTreeNode(AddNewAutomaticRoleTaskExecutor.java:160)
    at eu.bcvsolutions.idm.core.scheduler.task.impl.AddNewAutomaticRoleTaskExecutor.getItemsToProcess(AddNewAutomaticRoleTaskExecutor.java:74)
    at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractSchedulableStatefulExecutor.executeProcess(AbstractSchedulableStatefulExecutor.java:126)
    at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractSchedulableStatefulExecutor.process(AbstractSchedulableStatefulExecutor.java:58)
    at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractSchedulableStatefulExecutor.process(AbstractSchedulableStatefulExecutor.java:46)
    at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractLongRunningTaskExecutor.call(AbstractLongRunningTaskExecutor.java:176)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.springframework.security.concurrent.DelegatingSecurityContextRunnable.run(DelegatingSecurityContextRunnable.java:80)
    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:748)

Complete log

2019-03-30 13:55:15.588  INFO 10665 --- [nio-8080-exec-1] e.b.i.c.m.s.i.DefaultEntityEventManager  : Publishing event [AutomaticRoleRequestEvent [type: EXECUTE, content: eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleRequestDto [code= c224d890-deef-4a13-ab74-2b3fa3028e83], properties: {checkRight=true}]]
2019-03-30 13:55:15.588  INFO 10665 --- [nio-8080-exec-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [automatic-role-request-approval-processor] start for [AutomaticRoleRequestEvent [type: EXECUTE, content: eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleRequestDto [code= c224d890-deef-4a13-ab74-2b3fa3028e83], properties: {checkRight=true}]] with order [-1000].
2019-03-30 13:55:15.589  INFO 10665 --- [nio-8080-exec-1] .r.AutomaticRoleRequestApprovalProcessor : None approval process definition was found, request [eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleRequestDto [code= c224d890-deef-4a13-ab74-2b3fa3028e83]] for automatic role is approved.
2019-03-30 13:55:15.589  INFO 10665 --- [nio-8080-exec-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [automatic-role-request-approval-processor] end for [AutomaticRoleRequestEvent [type: EXECUTE, content: eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleRequestDto [code= c224d890-deef-4a13-ab74-2b3fa3028e83], properties: {checkRight=true}]] with order [-1000].
2019-03-30 13:55:15.589  INFO 10665 --- [nio-8080-exec-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [automatic-role-request-realization-processor] start for [AutomaticRoleRequestEvent [type: EXECUTE, content: eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleRequestDto [code= c224d890-deef-4a13-ab74-2b3fa3028e83], properties: {checkRight=true}]] with order [0].
2019-03-30 13:55:15.669  INFO 10665 --- [nio-8080-exec-1] e.b.i.c.m.s.i.DefaultEntityEventManager  : Publishing event [RoleTreeNodeEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto [code= null], properties: {}]]
2019-03-30 13:55:15.669  INFO 10665 --- [nio-8080-exec-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [role-tree-node-save-processor] start for [RoleTreeNodeEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto [code= null], properties: {}]] with order [0].
2019-03-30 13:55:15.747  INFO 10665 --- [nio-8080-exec-1] e.b.i.c.a.e.AbstractEntityEventProcessor : Processor [role-tree-node-save-processor] end for [RoleTreeNodeEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto [code= f5d9b706-4506-46bc-9d69-861c1a36e8ba], properties: {}]] with order [0].
2019-03-30 13:55:15.748  INFO 10665 --- [nio-8080-exec-1] e.b.i.c.m.s.i.DefaultEntityEventManager  : Event [RoleTreeNodeEvent [type: CREATE, content: eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto [code= f5d9b706-4506-46bc-9d69-861c1a36e8ba], properties: {}]] is completed
2019-03-30 13:55:16.614 ERROR 10665 --- [task-executor-2] .c.s.a.s.AbstractLongRunningTaskExecutor : [core:AUTOMATIC_ROLE_TASK_EMPTY:ab09d8c1-ed33-4e36-beed-9cb51f60d014] Automatic role id is required. ({})

eu.bcvsolutions.idm.core.api.exception.ResultCodeException: Automatic role id is required.
        at eu.bcvsolutions.idm.core.scheduler.task.impl.AddNewAutomaticRoleTaskExecutor.getRoleTreeNode(AddNewAutomaticRoleTaskExecutor.java:160)
        at eu.bcvsolutions.idm.core.scheduler.task.impl.AddNewAutomaticRoleTaskExecutor.getItemsToProcess(AddNewAutomaticRoleTaskExecutor.java:74)
        at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractSchedulableStatefulExecutor.executeProcess(AbstractSchedulableStatefulExecutor.java:126)
        at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractSchedulableStatefulExecutor.process(AbstractSchedulableStatefulExecutor.java:58)
        at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractSchedulableStatefulExecutor.process(AbstractSchedulableStatefulExecutor.java:46)
        at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractLongRunningTaskExecutor.call(AbstractLongRunningTaskExecutor.java:176)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.springframework.security.concurrent.DelegatingSecurityContextRunnable.run(DelegatingSecurityContextRunnable.java:80)
        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:748)

Between 13:55:15.748 and 13:55:16.614 is lots of provisioning operation.

Affected version: 8.1.7


Files

003.png (49.1 KB) 003.png Ondřej Kopr, 04/02/2019 10:32 AM
002.png (146 KB) 002.png Ondřej Kopr, 04/02/2019 10:32 AM
001.png (24.1 KB) 001.png Ondřej Kopr, 04/02/2019 10:32 AM
automatic_role_added_twice.png (18.2 KB) automatic_role_added_twice.png Alena Peterová, 05/17/2019 10:50 AM

Related issues

Related to IdStory Identity Manager - Task #1666: Check database transaction isolation when using MSSQLNewOndřej Kopr05/17/2019

Actions
Related to IdStory Identity Manager - Defect #1768: Creating a report ends with an error LONG_RUNNING_TASK_NOT_FOUNDClosedRadek Tomiška07/30/2019

Actions
Actions #2

Updated by Alena Peterová over 5 years ago

Another effect of this behavior (it happens only sometimes):
  • create a new automatic role for an attribute
  • the automatic role is assigned to the users twice (duplicated). According to the audit, it was first added by the logged user, second by the SYSTEM:
Actions #3

Updated by Radek Tomiška over 5 years ago

  • Status changed from New to Needs feedback
  • Assignee changed from Radek Tomiška to Ondřej Kopr
  • Target version set to Quartz (9.6.2)
  • % Done changed from 0 to 90

I changed default state of synchronous LRT to RUNNING - prevent to execute LRT the second time by asynchronous processing.

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/05ce40428a126615f88cd754865c090b2236465c

Test:
https://github.com/bcvsolutions/CzechIdMng/commit/72bbdcac91d2e518ce3b7c14a9b9cfc26a876ca8

Could you do a feedback, please?

Actions #4

Updated by Radek Tomiška over 5 years ago

  • Related to Task #1666: Check database transaction isolation when using MSSQL added
Actions #5

Updated by Ondřej Kopr over 5 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Ondřej Kopr to Radek Tomiška
  • % Done changed from 90 to 100

I checked code and tests and everything there looks great. Thanks for solving this potential big issues. Thank you.

Actions #6

Updated by Radek Tomiška over 5 years ago

  • Status changed from Resolved to Closed
Actions #7

Updated by Radek Tomiška over 5 years ago

  • Related to Defect #1768: Creating a report ends with an error LONG_RUNNING_TASK_NOT_FOUND added
Actions

Also available in: Atom PDF