Project

General

Profile

Actions

Defect #3051

closed

Add and remove contract supervisor throws null pointer (contract slice synchronization)

Added by Ondřej Kopr about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Roman Kučera
Category:
Contractual relationship
Target version:
Start date:
02/09/2022
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

On project exits daily synchronization of contract slices. After finishing synchronization is executed clear dirty states as standalone LRT. This LRT process changes on slices and processor (ContractGuaranteeSaveProvisioningProcessor) for executing save on contract supervisor throw null pointer.

There is something strange with process order inside clear dirty state or somewhere. Because in clear dirty state was in one run added and then immediately removed one supervisor.

Also events queue process this events in wrong order because for another entities queue works perfectly and there is process delete first (because ContractGuaranteeSaveProvisioningProcessor throws null pointer).

Stack trace from event:

java.lang.NullPointerException
    at eu.bcvsolutions.idm.acc.event.processor.contract.ContractGuaranteeSaveProvisioningProcessor.process(ContractGuaranteeSaveProvisioningProcessor.java:66)
    at eu.bcvsolutions.idm.core.api.event.AbstractEntityEventProcessor.onApplicationEvent(AbstractEntityEventProcessor.java:239)
    at eu.bcvsolutions.idm.core.api.event.AbstractEntityEventProcessor$$FastClassBySpringCGLIB$$df69624d.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at eu.bcvsolutions.idm.acc.event.processor.contract.ContractGuaranteeSaveProvisioningProcessor$$EnhancerBySpringCGLIB$$7e3750ae.onApplicationEvent(<generated>)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:372)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.process(DefaultEntityEventManager.java:251)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.process(DefaultEntityEventManager.java:178)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager$$FastClassBySpringCGLIB$$1694e58f.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager$$EnhancerBySpringCGLIB$$d91e28b8.process(<generated>)
    at eu.bcvsolutions.idm.core.model.event.processor.event.EntityEventExecuteProcessor.process(EntityEventExecuteProcessor.java:52)
    at eu.bcvsolutions.idm.core.api.event.AbstractEntityEventProcessor.onApplicationEvent(AbstractEntityEventProcessor.java:239)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:372)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.process(DefaultEntityEventManager.java:251)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager.process(DefaultEntityEventManager.java:178)
    at eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager$2.run(DefaultEntityEventManager.java:616)
    at eu.bcvsolutions.idm.core.config.DelegatingTransactionContextRunnable.run(DelegatingTransactionContextRunnable.java:39)
    at org.springframework.security.concurrent.DelegatingSecurityContextRunnable.run(DelegatingSecurityContextRunnable.java:84)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

We made little audit analyze for this user. All contracts and slices is now removed and user is in disabled state - this is correct from HR was sent nothing - contract end.

For classic update and create this error doesnt occur. Even when one contract is deleted. But this scenario removes last contract - slices.


Files

e-event.png (50.1 KB) e-event.png Ondřej Kopr, 02/09/2022 07:25 AM
e-audit.png (65.1 KB) e-audit.png Ondřej Kopr, 02/09/2022 07:25 AM
e-audit-contract.png (77.3 KB) e-audit-contract.png Ondřej Kopr, 02/09/2022 07:29 AM
e-audit-slice.png (116 KB) e-audit-slice.png Ondřej Kopr, 02/09/2022 07:29 AM
e-event-detail.png (120 KB) e-event-detail.png Ondřej Kopr, 02/09/2022 07:37 AM
Actions #2

Updated by Ondřej Kopr about 2 years ago

Event detail (will be removed from environment):

Actions #3

Updated by Ondřej Kopr about 2 years ago

  • Subject changed from Add and remove contract supervisor throws null pointer to Add and remove contract supervisor throws null pointer (contract slice synchronization)
Actions #4

Updated by Peter Štrunc about 2 years ago

  • Target version set to 12.2.0
Actions #5

Updated by Roman Kučera about 2 years ago

  • Sprint set to Sprint 12.2-1 (Feb 18 - Mar 02)
  • Assignee set to Roman Kučera
Actions #6

Updated by Roman Kučera about 2 years ago

  • Status changed from New to In Progress
Actions #7

Updated by Roman Kučera about 2 years ago

  • % Done changed from 0 to 40

I looked into code. As it looks from first observation this bug is fixed from version 11.

I will try to replicate this behavior on 10.8.4 locally, then I will try to do the same on IdM > 11 for confirmation.

According to stack trace, the null pointer is thrown on LOG line, because contract is null
LOG.debug("Publish change for identity [{}], contract guarantee will be added.", contract.getIdentity());

Actions #8

Updated by Roman Kučera about 2 years ago

  • Target version changed from 12.2.0 to 10.8.5
  • % Done changed from 40 to 80

I tried to replicate this behavior locally and everything works, so was probably some strange "one time" event bug

I briefly checked ClearDirtyStateForContractSliceTaskExecutor, but did not found anything suspicious.

After discussion with Ondra I'll fix this null pointer for IdM LTS 10 and that will be it.

Actions #9

Updated by Roman Kučera about 2 years ago

  • % Done changed from 80 to 90
Actions #10

Updated by Roman Kučera about 2 years ago

  • Status changed from In Progress to Needs feedback
Actions #11

Updated by Roman Kučera about 2 years ago

  • Sprint changed from Sprint 12.2-1 (Feb 18 - Mar 02) to Sprint 12.2-2 (Mar 02 - Mar 16)
Actions #12

Updated by Roman Kučera about 2 years ago

  • Assignee changed from Roman Kučera to Tomáš Doischer
Actions #13

Updated by Tomáš Doischer about 2 years ago

  • Status changed from Needs feedback to In Progress
  • Assignee changed from Tomáš Doischer to Roman Kučera

LGTM, thank you for the fix! I'll leave merging the branch up to you.

Actions #14

Updated by Roman Kučera about 2 years ago

  • Status changed from In Progress to Resolved
Actions #15

Updated by Roman Kučera almost 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 90 to 100

Hotfix already released

Actions

Also available in: Atom PDF