[ 
https://issues.apache.org/jira/browse/FINERACT-1945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17735431#comment-17735431
 ] 

Francis Guchie edited comment on FINERACT-1945 at 6/20/23 7:45 PM:
-------------------------------------------------------------------

[~bgowda]  [~ikimbrah] 
We have to look into this I have noticed one job failing for the last one month 
and I cannot explain why it is failing.
When i trigger it on its own it runs just fine.
when i leave it to run as per the scheduler. This error tells us that another 
job is locking the access 

I get the error below 
*org.springframework.dao.CannotAcquireLockException:* 
*StatementCallback; SQL [UPDATE m_loan as ml ,  (select loan.id  FROM 
m_loan_arrears_aging laa INNER JOIN  m_loan loan on laa.loan_id = loan.id  
INNER JOIN m_product_loan mpl on mpl.id = loan.product_id AND 
mpl.overdue_days_for_npa is not null WHERE loan.loan_status_id = 300 and 
laa.overdue_since_date_derived < DATE_SUB(CURDATE(), INTERVAL 
COALESCE(mpl.overdue_days_for_npa, 0) day) group by loan.id) as sl  SET 
ml.is_npa = true where ml.id=sl.id ];* 
*(conn=49120) Lock wait timeout exceeded;* 
*try restarting transaction;* 
*nested exception is java.sql.SQLTransientConnectionException: (conn=49120) 
Lock wait timeout exceeded; try restarting transaction*
      *at 
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(267)*
      *at 
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(70)*
      *at org.springframework.jdbc.core.JdbcTemplate.translateException(1541)*
      *at org.springframework.jdbc.core.JdbcTemplate.execute(393)*
      *at org.springframework.jdbc.core.JdbcTemplate.update(558)*
      *at 
org.apache.fineract.scheduledjobs.service.ScheduledJobRunnerServiceImpl.updateNPA(207)*
      *at 
org.apache.fineract.scheduledjobs.service.ScheduledJobRunnerServiceImpl$$FastClassBySpringCGLIB$$80bbf4b3.invoke(-1)*
      *at org.springframework.cglib.proxy.MethodProxy.invoke(218)*
      *at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(793)*
      *at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(163)*
      *at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(763)*
      *at 
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(123)*
      *at 
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(388)*
      *at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(119)*
      *at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(186)*
      *at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(763)*
      *at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(708)*
      *at* 

A deeper search shows that this job has been running in duplicates for a while 
see image below

!image-2023-06-20-19-45-07-790.png!


was (Author: francisguchie):
[~bgowda]  [~ikimbrah] 
We have to look into this I have noticed one job failing for the last one month 
and I cannot explain why it is failing.
When i trigger it on its own it runs just fine.
when i leave it to run as per the schedular, 

I get the error below 
*org.springframework.dao.CannotAcquireLockException:* 
*StatementCallback; SQL [UPDATE m_loan as ml ,  (select loan.id  FROM 
m_loan_arrears_aging laa INNER JOIN  m_loan loan on laa.loan_id = loan.id  
INNER JOIN m_product_loan mpl on mpl.id = loan.product_id AND 
mpl.overdue_days_for_npa is not null WHERE loan.loan_status_id = 300 and 
laa.overdue_since_date_derived < DATE_SUB(CURDATE(), INTERVAL 
COALESCE(mpl.overdue_days_for_npa, 0) day) group by loan.id) as sl  SET 
ml.is_npa = true where ml.id=sl.id ];* 
*(conn=49120) Lock wait timeout exceeded;* 
*try restarting transaction;* 
*nested exception is java.sql.SQLTransientConnectionException: (conn=49120) 
Lock wait timeout exceeded; try restarting transaction*
      *at 
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(267)*
      *at 
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(70)*
      *at org.springframework.jdbc.core.JdbcTemplate.translateException(1541)*
      *at org.springframework.jdbc.core.JdbcTemplate.execute(393)*
      *at org.springframework.jdbc.core.JdbcTemplate.update(558)*
      *at 
org.apache.fineract.scheduledjobs.service.ScheduledJobRunnerServiceImpl.updateNPA(207)*
      *at 
org.apache.fineract.scheduledjobs.service.ScheduledJobRunnerServiceImpl$$FastClassBySpringCGLIB$$80bbf4b3.invoke(-1)*
      *at org.springframework.cglib.proxy.MethodProxy.invoke(218)*
      *at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(793)*
      *at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(163)*
      *at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(763)*
      *at 
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(123)*
      *at 
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(388)*
      *at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(119)*
      *at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(186)*
      *at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(763)*
      *at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(708)*
      *at* 

> UI Shows Duplicate Scheduler Jobs - a reason some jobs are failing
> ------------------------------------------------------------------
>
>                 Key: FINERACT-1945
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1945
>             Project: Apache Fineract
>          Issue Type: Bug
>    Affects Versions: 1.7.3
>            Reporter: Francis Guchie
>            Priority: Major
>         Attachments: image-2023-06-20-19-40-27-163.png, 
> image-2023-06-20-19-45-07-790.png
>
>
> Jobs are failing to run and I think it is the Jobs that are duplicated on the 
> UI. 
> Something to consider trouble shooting 
> !image-2023-06-20-19-40-27-163.png!
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to