PGR Creation Failure due to no errors if sequence does not exist #30
Replies: 2 comments 2 replies
-
The issue was with the sequence ID provided in the MDMS data (default configuration) that sequence was not present in the DB and the pidgin failed to raise any exception for that which I feel is a big issue as the API kept sending 200 despite the sequence not existing . as we kept beating around the bush since the exception was not thrown in case the sequence did not exist. Please add exception handling and logging so that people can figure out what is wrong. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/egovernments/DIGIT-DevOps/blob/master/deploy-as-code/helm/charts/core-services/egov-idgen/values.yaml#L45 @nikesh-eGov egovernments/DIGIT-DevOps#850 |
Beta Was this translation helpful? Give feedback.
-
Hi Team,
Once the PGR request steps are completed and when the system is trying to create the PGR request getting a 400 error. Following is the request payload.
Request :
{"service":{"tenantId":"pb.jalandhar","serviceCode":"StreetLightNotWorking","description":"End of the street light","additionalDetail":{},"source":"web","address":{"landmark":"Sample land mmark","city":"Hooghly","district":"Hooghly","region":"Hooghly","state":"Panjab","pincode":"144001","locality":{"code":"JLC476","name":"Main Road Abadpura"},"geoLocation":{}}},"workflow":{"action":"APPLY"},"RequestInfo":{"apiId":"Rainmaker","authToken":"e80964a6-8d82-4bae-9c17-97e6406d396d","userInfo":{"id":93,"uuid":"a08a8568-b929-4861-a721-48a79118d20d","userName":"9999999999","name":"Jithendra","mobileNumber":"9999999999","emailId":"","locale":null,"type":"CITIZEN","roles":[{"name":"Citizen","code":"CITIZEN","tenantId":"pb"}],"active":true,"tenantId":"pb","permanentCity":"pb"}}}
Response :
{"ResponseInfo":null,"Errors":[{"code":"IDGEN ERROR","message":"No ids returned from idgen Service","description":null,"params":null}]}
I further investigated and checked found the following logs on Zuul --> PGR service --> idgen service -->.
Zuul
2022-05-15 13:22:45.235+0000 INFO --- [080-exec-3] o.e.f.p.ResponseEnhancementFilter -- CORRELATION_ID=01033166-130e-4373-8ffe-d36564e2dea5 : Received response code: 400 from upstream URI /pgr-services/v2/request/_create
2022-05-15 13:22:50.727+0000 INFO --- [080-exec-5] o.e.f.pre.AuthPreCheckFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Routing to an endpoint: /pgr-services/v2/request/_create - auth provided
2022-05-15 13:22:50.748+0000 INFO --- [080-exec-5] o.e.f.p.RequestEnrichmentFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Enriched request payload.
2022-05-15 13:22:50.825+0000 INFO --- [080-exec-5] o.e.f.p.ResponseEnhancementFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received response code: 400 from upstream URI /pgr-services/v2/request/_create
PGR Service Logs
2022-05-15 13:22:50.755+0000 INFO --- [080-exec-1] o.e.t.h.filters.TracerFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received request URI: http://pgr-services.egov:8080/pgr-services/v2/request/_create
2022-05-15 13:22:50.758+0000 INFO --- [080-exec-1] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Sending request to http://egov-mdms-service.egov:8080/egov-mdms-service/v1/_search with verb POST
2022-05-15 13:22:50.765+0000 INFO --- [080-exec-1] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received response from http://egov-mdms-service.egov:8080/egov-mdms-service/v1/_search
2022-05-15 13:22:50.766+0000 INFO --- [080-exec-1] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Sending request to http://egov-user.egov:8080/user/_search with verb POST
2022-05-15 13:22:50.798+0000 INFO --- [080-exec-1] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received response from http://egov-user.egov:8080/user/_search
2022-05-15 13:22:50.800+0000 INFO --- [080-exec-1] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Sending request to http://egov-idgen.egov:8080/egov-idgen/id/_generate with verb POST
2022-05-15 13:22:50.822+0000 INFO --- [080-exec-1] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received response from http://egov-idgen.egov:8080/egov-idgen/id/_generate
2022-05-15 13:22:50.823+0000 ERROR --- [080-exec-1] o.egov.tracer.ExceptionAdvise -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Exception caught in tracer
org.egov.tracer.model.CustomException: No ids returned from idgen Service
at org.egov.pgr.service.EnrichmentService.getIdList(EnrichmentService.java:148)
at org.egov.pgr.service.EnrichmentService.enrichCreateRequest(EnrichmentService.java:77)
at org.egov.pgr.service.PGRService.create(PGRService.java:66)
at org.egov.pgr.web.controllers.RequestsApiController.requestsCreatePost(RequestsApiController.java:46)
at sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at io.opentracing.contrib.web.servlet.filter.TracingFilter.doFilter(TracingFilter.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.egov.tracer.http.filters.TracerFilter.doFilter(TracerFilter.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
2022-05-15 13:22:50.824+0000 INFO --- [080-exec-1] o.e.t.h.filters.TracerFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Response code sent: 400
idGEN Logs -
2022-05-15 13:22:50.805+0000 INFO --- [080-exec-6] o.e.t.h.filters.TracerFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received request URI: http://egov-idgen.egov:8080/egov-idgen/id/_generate
2022-05-15 13:22:50.810+0000 INFO --- [080-exec-6] o.e.m.s.MdmsClientService -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : MdmsClientService masterDetails:{common-masters=[MasterDetail(name=IdFormat, filter=[?(@.idname=='pgr.servicerequestid')])], tenant=[MasterDetail(name=tenants, filter=[?(@.code=='pb.jalandhar')])]}
2022-05-15 13:22:50.810+0000 INFO --- [080-exec-6] o.e.m.s.MdmsClientService -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : mdmsCriteriaReq:MdmsCriteriaReq(requestInfo=RequestInfo(apiId=Rainmaker, ver=null, ts=null, action=null, did=null, key=null, msgId=null, authToken=null, correlationId=e245ceb5-9979-4b6b-97b9-096b95d5f41d, userInfo=User(id=93, userName=null, name=null, type=null, mobileNumber=null, emailId=null, roles=null)), mdmsCriteria=MdmsCriteria(tenantId=pb.jalandhar, moduleDetails=[ModuleDetail(moduleName=common-masters, masterDetails=[MasterDetail(name=IdFormat, filter=[?(@.idname=='pgr.servicerequestid')])]), ModuleDetail(moduleName=tenant, masterDetails=[MasterDetail(name=tenants, filter=[?(@.code=='pb.jalandhar')])])]))
2022-05-15 13:22:50.811+0000 INFO --- [080-exec-6] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Sending request to http://egov-mdms-service.egov:8080/egov-mdms-service/v1/_search with verb POST
2022-05-15 13:22:50.818+0000 INFO --- [080-exec-6] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received response from http://egov-mdms-service.egov:8080/egov-mdms-service/v1/_search
2022-05-15 13:22:50.822+0000 INFO --- [080-exec-6] o.e.t.h.filters.TracerFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Response code sent: 200
As I have seen a call to the egov-user service I have checked the logs of the egov-user service logs as well and could find the following.
egov-user logs -
2022-05-15 13:22:50.770+0000 INFO --- [080-exec-8] o.e.t.h.filters.TracerFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received request URI: http://egov-user.egov:8080/user/_search
2022-05-15 13:22:50.771+0000 INFO --- [080-exec-8] o.e.u.w.c.UserController -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received User search Request UserSearchRequest(requestInfo=null, id=null, uuid=[a08a8568-b929-4861-a721-48a79118d20d], userName=null, name=null, mobileNumber=null, aadhaarNumber=null, pan=null, emailId=null, fuzzyLogic=false, active=true, tenantId=pb, pageSize=0, pageNumber=0, sort=[name], userType=CITIZEN, roleCodes=null)
2022-05-15 13:22:50.775+0000 INFO --- [080-exec-8] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Sending request to http://egov-mdms-service.egov:8080/egov-mdms-service/v1/_search with verb POST
2022-05-15 13:22:50.777+0000 INFO --- [080-exec-8] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received response from http://egov-mdms-service.egov:8080/egov-mdms-service/v1/_search
2022-05-15 13:22:50.778+0000 ERROR --- [080-exec-8] o.e.e.util.JacksonUtils -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Cannot find value for path : address
2022-05-15 13:22:50.778+0000 INFO --- [080-exec-8] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Sending request to http://egov-enc-service.egov:8080/egov-enc-service/crypto/v1/_decrypt with verb POST
2022-05-15 13:22:50.786+0000 INFO --- [080-exec-8] o.e.t.h.RestTemplateLoggingInterceptor -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Received response from http://egov-enc-service.egov:8080/egov-enc-service/crypto/v1/_decrypt
2022-05-15 13:22:50.795+0000 INFO --- [080-exec-8] o.e.t.k.KafkaTemplateLoggingInterceptors -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Sending message to topic: enc-user-audit-data, partition: null with key: 53581ab1-f1d5-40ae-bfb9-2034b0a0320a .
2022-05-15 13:22:50.798+0000 INFO --- [080-exec-8] o.e.t.h.filters.TracerFilter -- CORRELATION_ID=e245ceb5-9979-4b6b-97b9-096b95d5f41d : Response code sent: 200
Please let me know how to proceed further and resolve this error.
Beta Was this translation helpful? Give feedback.
All reactions