Defect #1149
closedCancell full provisioning batch error
100%
Description
IdM Version 8.1.2
I'm trying to cancel provisioning batch on around 14k operations, but long running task is failing.
Deleting one by one is possible as well as when I select up to 100 operations, but cancelling full batch always throw this error:
org.springframework.dao.InvalidDataAccessApiUsageException: The given id must not be null!; nested exception is java.lang.IllegalArgumentException: The given id must not be null!
at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:384)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:227)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:436)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:131)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at com.sun.proxy.$Proxy208.findOne(Unknown Source)
at eu.bcvsolutions.idm.core.api.service.AbstractReadDtoService.getEntity(AbstractReadDtoService.java:275)
at eu.bcvsolutions.idm.core.api.service.AbstractReadDtoService.get(AbstractReadDtoService.java:172)
at eu.bcvsolutions.idm.core.api.service.AbstractReadDtoService$$FastClassBySpringCGLIB$$120a9283.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
at eu.bcvsolutions.idm.acc.service.impl.DefaultSysProvisioningBatchService$$EnhancerBySpringCGLIB$$2b408b7c.get(<generated>)
at eu.bcvsolutions.idm.acc.scheduler.task.impl.CancelProvisioningQueueTaskExecutor.processItem(CancelProvisioningQueueTaskExecutor.java:57)
at eu.bcvsolutions.idm.acc.scheduler.task.impl.CancelProvisioningQueueTaskExecutor.processItem(CancelProvisioningQueueTaskExecutor.java:28)
at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractSchedulableStatefulExecutor.processCandidate(AbstractSchedulableStatefulExecutor.java:168)
at eu.bcvsolutions.idm.core.scheduler.api.service.AbstractSchedulableStatefulExecutor.executeProcess(AbstractSchedulableStatefulExecutor.java:138)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: The given id must not be null!
at org.springframework.util.Assert.notNull(Assert.java:115)
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findOne(SimpleJpaRepository.java:224)
at sun.reflect.GeneratedMethodAccessor550.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:483)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:468)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:440)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
... 31 more
Updated by Ondřej Kopr over 6 years ago
- Assignee changed from Radek Tomiška to Petr Hanák
Please add affected version. Provisioning batch system was changed in last versions.
Updated by Petr Hanák over 6 years ago
- Assignee changed from Petr Hanák to Ondřej Kopr
Updated by Radek Tomiška over 6 years ago
- Category set to Provisioning
- Assignee changed from Ondřej Kopr to Radek Tomiška
Updated by Alena Peterová over 6 years ago
Note: I just tested this in different environment for 2550 records (virtual accounts) in the provisioning queue and it worked well.
I started it from Audit -> Provisioning -> Cancel all operations.
The original error in this ticket happened for accounts on directly connected system. I don't know if this can make any difference...
Updated by Alena Peterová over 6 years ago
One more note: In the same environment as originally, new 5700 provisioning tasks were created (for the same AD system) and cancelling works now. There is only some warning which probably isn't a problem.
WARN 20542 --- [task-executor-4] .a.s.AbstractSchedulableStatefulExecutor : Running stateful tasks outside scheduler is not recommended.
So the reason of the original error is probably connected to debugging and implementing (changed mapping, errors in scripts, deleted contract, identity, role, whatever).
However, it would be nice to fix it.
Updated by Radek Tomiška over 6 years ago
- Status changed from New to In Progress
- Target version set to Lapis (8.2.0)
Updated by Radek Tomiška over 6 years ago
- Status changed from In Progress to Needs feedback
- Assignee changed from Radek Tomiška to Ondřej Kopr
- % Done changed from 0 to 90
I fixed finding batch for system entity in multi thread processing (find versus create vs delete). I created change script to clean up broken provisioning operations (without batch).
Pull request: https://github.com/bcvsolutions/CzechIdMng/pull/33
Could you please do a review?
Updated by Ondřej Kopr over 6 years ago
- Status changed from Needs feedback to Resolved
- % Done changed from 90 to 100
I made review:
the idea with change identifier to systemEntity id is awesome. I try simulate wrong behavior but unsuccessfully (one task generate items to batch and another remove it), new behavior works correctly and well. Thank you for implement this fix.
Updated by Ondřej Kopr over 6 years ago
- Assignee changed from Ondřej Kopr to Radek Tomiška
Updated by Radek Tomiška over 6 years ago
- Status changed from Resolved to Closed
Thx for feedback, i merged it onto develop.