Pre-registration Sync - data not reflecting on registration client
Issue Description:
On click of Download Pre-Registration Data in Registration Client, System getting following error.
ERROR LOG
UNKNOWN ERROR >> https://api-internal.techno-associates.live/preregistration/v1/sync/64059843683546/10006?version=1.2.0.1-SNAPSHOT {}
org.springframework.web.client.HttpClientErrorException: 404 null
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:94)
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:79)
at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:766)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:724)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:698)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:619)
at io.mosip.registration.util.restclient.RestClientUtil.invokeURL(RestClientUtil.java:68)
at io.mosip.registration.util.restclient.RestClientUtil$$FastClassBySpringCGLIB$$6aaee7db.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:100)
at io.mosip.registration.util.advice.RestClientAuthAdvice.addAuthZToken(RestClientAuthAdvice.java:76)
at jdk.internal.reflect.GeneratedMethodAccessor347.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at io.mosip.registration.util.restclient.RestClientUtil$$EnhancerBySpringCGLIB$$f7ace7bc.invokeURL(<generated>)
at io.mosip.registration.util.restclient.ServiceDelegateUtil.get(ServiceDelegateUtil.java:148)
at io.mosip.registration.util.restclient.ServiceDelegateUtil$$FastClassBySpringCGLIB$$30e4b842.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at io.mosip.registration.util.restclient.ServiceDelegateUtil$$EnhancerBySpringCGLIB$$8a77adbf.get(<generated>)
at io.mosip.registration.service.sync.impl.PreRegistrationDataSyncServiceImpl.downloadAndSavePacket(PreRegistrationDataSyncServiceImpl.java:241)
at io.mosip.registration.service.sync.impl.PreRegistrationDataSyncServiceImpl.getPreRegistration(PreRegistrationDataSyncServiceImpl.java:221)
at io.mosip.registration.service.sync.impl.PreRegistrationDataSyncServiceImpl.getPreRegistration(PreRegistrationDataSyncServiceImpl.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy225.getPreRegistration(Unknown Source)
at io.mosip.registration.controller.GenericController$1$1.lambda$call$0(GenericController.java:256)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
2022-10-17 17:03:54,870 ERROR [JavaFX Application Thread] i.m.r.s.s.i.PreRegistrationDataSyncServiceImpl : Failed to fetch pre-reg packet
java.lang.reflect.UndeclaredThrowableException: null
at io.mosip.registration.util.restclient.RestClientUtil$$EnhancerBySpringCGLIB$$f7ace7bc.invokeURL(<generated>)
at io.mosip.registration.util.restclient.ServiceDelegateUtil.get(ServiceDelegateUtil.java:148)
at io.mosip.registration.util.restclient.ServiceDelegateUtil$$FastClassBySpringCGLIB$$30e4b842.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
at io.mosip.registration.util.restclient.ServiceDelegateUtil$$EnhancerBySpringCGLIB$$8a77adbf.get(<generated>)
at io.mosip.registration.service.sync.impl.PreRegistrationDataSyncServiceImpl.downloadAndSavePacket(PreRegistrationDataSyncServiceImpl.java:241)
at io.mosip.registration.service.sync.impl.PreRegistrationDataSyncServiceImpl.getPreRegistration(PreRegistrationDataSyncServiceImpl.java:221)
at io.mosip.registration.service.sync.impl.PreRegistrationDataSyncServiceImpl.getPreRegistration(PreRegistrationDataSyncServiceImpl.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy225.getPreRegistration(Unknown Source)
at io.mosip.registration.controller.GenericController$1$1.lambda$call$0(GenericController.java:256)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: io.mosip.registration.exception.RegBaseCheckedException: UNKNOWN_ERROR --> 404 null
at io.mosip.registration.util.advice.RestClientAuthAdvice.addAuthZToken(RestClientAuthAdvice.java:86)
at jdk.internal.reflect.GeneratedMethodAccessor347.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
... 32 common frames omitted
Issue Analysis :
For GET api '/preregistration/v1/sync/
' is belongs to prereg-datasync service. but during the issue occurrence, request routed to prereg-application service instead of prereg-datasync service in Prereg namespace.
In Detail Analysis, country is not using ingress gateway instead of that they used Internal & External Load balancer. Also they have configured that if any request contains '/preregistration/v1/
' then request will directly routing to prereg-application. So when regclient triggered '/preregistration/v1/sync/
'. request directly routed to application service and got below Error
{"@timestamp":"2022-10-17T09:53:04.149Z","level":"ACCESS","level_value":70000,"traceId":"229ce6040ac197fc","statusCode":404,"req.requestURI":"/preregistration/v1/sync/64059843683546/10006","bytesSent":177,"timeTaken":0.640,"appName":"pre-registration-application-service","req.userAgent":"Java/11.0.8","req.xForwardedFor":"192.168.0.101","req.referer":"-","req.method":"GET","req.remoteHost":"10.42.2.0"}
Resolution :
Team has configured ‘/preregistration/v1/sync/’ in External & Internal load balancer and pointed to prereg-datasync service. Hence issue has been resolved.