# Esignet services are going down intermittently and coming up after the restart of esignet

**URL:** <https://community.mosip.io/t/esignet-services-are-going-down-intermittently-and-coming-up-after-the-restart-of-esignet/746>\
**Category:** General\
**Created:** [September 1, 2023, 10:57am UTC](https://community.mosip.io/t/esignet-services-are-going-down-intermittently-and-coming-up-after-the-restart-of-esignet/746 "2023-09-01T10:57:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthiksj](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@karthiksj](https://community.mosip.io/u/karthiksj)\
**Post date:** [September 1, 2023, 10:57am UTC](https://community.mosip.io/t/esignet-services-are-going-down-intermittently-and-coming-up-after-the-restart-of-esignet/746/1 "2023-09-01T10:57:58Z")

</div>

Esignet pod is up always but esignet service is intermittently failing. Below pasted errors we are getting in esignet pods.

{“@timestamp”:“2023-08-25T08:35:45.296Z”,“@version”:“1”,“message”:“send-otp failed with clientId : jlmKETUduKEGEFyqd\_\_CkHSLlsiSE61fKm56Z4ofxks”,“logger\_name”:“io.mosip.authentication.esignet.integration.service.IdaAuthenticatorImpl”,“thread\_name”:“http-nio-8088-exec-6”,“level”:“ERROR”,“level\_value”:40000,“stack\_trace”:“java.security.ProviderException: Initialization failed\n\tat jdk.crypto.cryptoki/sun.security.pkcs11.P11Signature.initialize(P11Signature.java:375)\n\tat jdk.crypto.cryptoki/sun.security.pkcs11.P11Signature.engineInitSign(P11Signature.java:502)\n\tat java.base/java.security.Signature$Delegate.tryOperation(Signature.java:1308)\n\tat java.base/java.security.Signature$Delegate.chooseProvider(Signature.java:1257)\n\tat java.base/java.security.Signature$Delegate.engineInitSign(Signature.java:1354)\n\tat java.base/java.security.Signature.initSign(Signature.java:636)\n\tat org.jose4j.jws.BaseSignatureAlgorithm.initForSign(BaseSignatureAlgorithm.java:93)\n\tat org.jose4j.jws.BaseSignatureAlgorithm.sign(BaseSignatureAlgorithm.java:73)\n\tat org.jose4j.jws.JsonWebSignature.sign(JsonWebSignature.java:164)\n\tat org.jose4j.jws.JsonWebSignature.getDetachedContentCompactSerialization(JsonWebSignature.java:147)\n\tat io.mosip.kernel.signature.service.impl.SignatureServiceImpl.sign(SignatureServiceImpl.java:312)\n\tat io.mosip.kernel.signature.service.impl.SignatureServiceImpl.jwtSign(SignatureServiceImpl.java:277)\n\tat io.mosip.authentication.esignet.integration.service.HelperService.getRequestSignature(HelperService.java:179)\n\tat io.mosip.authentication.esignet.integration.service.HelperService.sendOTP(HelperService.java:154)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:774)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)\n\tat org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)\n\tat io.mosip.authentication.esignet.integration.service.HelperService$$EnhancerBySpringCGLIB$$c6339e5d.sendOTP()\n\tat io.mosip.authentication.esignet.integration.service.IdaAuthenticatorImpl.sendOtp(IdaAuthenticatorImpl.java:211)\n\tat io.mosip.esignet.services.AuthorizationHelperService.delegateSendOtpRequest(AuthorizationHelperService.java:224)\n\tat io.mosip.esignet.services.AuthorizationServiceImpl.sendOtp(AuthorizationServiceImpl.java:135)\n\tat io.mosip.esignet.controllers.AuthorizationController.sendOtp(AuthorizationController.java:54)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)\n\tat org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)\n\tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)\n\tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)\n\tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)\n\tat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:652)\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:733)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat io.mosip.esignet.advice.HeaderValidationFilter.doFilterInternal(HeaderValidationFilter.java:70)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)\n\tat org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationFilter.doFilterInternal(BearerTokenAuthenticationFilter.java:114)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:141)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92)\n\tat org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)\n\tat org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)\n\tat org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178)\n\tat org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)\n\tat org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)\n\tat org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)\n\tat org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)\n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\nCaused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR\_DEVICE\_ERROR\n\tat jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11.C\_SignInit(Native Method)\n\tat jdk.crypto.cryptoki/sun.security.pkcs11.P11Signature.initialize(P11Signature.java:366)\n\t… 125 common frames omitted\n”,“appName”:“esignet”}

---

<div class="post-metadata">

**Author:** ![Anusha\_sunkadh](https://dub1.discourse-cdn.com/flex017/user_avatar/community.mosip.io/anusha_sunkadh/32/30_2.png) [@Anusha\_sunkadh](https://community.mosip.io/u/Anusha_sunkadh)\
**Post date:** [September 11, 2023, 2:22pm UTC](https://community.mosip.io/t/esignet-services-are-going-down-intermittently-and-coming-up-after-the-restart-of-esignet/746/2 "2023-09-11T14:22:35Z")

</div>

HI @karthiksj

1. which HSM is used?

if its softHSM, then it seems like connections are getting dropped. kindly check below:

1. idle connection timeout
2. Enable hsm health check in esignet-default.properties  
[https://github.com/mosip/mosip-config/blob/develop2-v3/esignet-default.properties#L307-L310](https://github.com/mosip/mosip-config/blob/develop2-v3/esignet-default.properties#L307-L310)

---

<div class="post-metadata">

**Author:** ![karthiksj](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@karthiksj](https://community.mosip.io/u/karthiksj)\
**Post date:** [September 11, 2023, 3:29pm UTC](https://community.mosip.io/t/esignet-services-are-going-down-intermittently-and-coming-up-after-the-restart-of-esignet/746/3 "2023-09-11T15:29:30Z")

</div>

> [@Anusha\_sunkadh](#):
>
> idle connection timeout

We are using softhsm:v2 from mosipid. Please find the below updates.

1. 
  1. idle connection timeout - **is this need to add in envoyfilter of keymanger(idle-timeout-inbound-filter)**

2. 
  1. Enable hsm health check in esignet-default.properties  
[https://github.com/mosip/mosip-config/blob/develop2-v3/esignet-default.properties#L307-L310](https://github.com/mosip/mosip-config/blob/develop2-v3/esignet-default.properties#L307-L310) - **Already enabled**

---

<div class="post-metadata">

**Author:** ![sanchi-singh24](https://dub1.discourse-cdn.com/flex017/user_avatar/community.mosip.io/sanchi-singh24/32/538_2.png) [@sanchi-singh24](https://community.mosip.io/u/sanchi-singh24)\
**Post date:** [September 13, 2023, 8:17pm UTC](https://community.mosip.io/t/esignet-services-are-going-down-intermittently-and-coming-up-after-the-restart-of-esignet/746/4 "2023-09-13T20:17:47Z")

</div>

Hi @karthiksj

As I can see you are using the softhsm:v2 from mosipid and with the updates provided by you I will ask our team member @Anusha_sunkadh to guide you further and take this up.

Best Regards,  
Team MOSIP
