Cannot get alias from keymanager when first sync happens in reg-client

Hi ,
When the reg-client invoque the sync-data to get get certificate from the key-manager when KM want to validate the certificate I get this error

2022-11-22 18:48:34,141 ERROR [Thread-9] i.m.r.u.a.ResponseSignatureAdvice : KER-KMS-012 --> Key Generation Process is not completed.
io.mosip.kernel.keymanagerservice.exception.KeymanagerServiceException: KER-KMS-012 --> Key Generation Process is not completed.
	at io.mosip.kernel.keymanagerservice.service.impl.KeymanagerServiceImpl.getCertificateFromHSM(KeymanagerServiceImpl.java:167)
	at io.mosip.kernel.keymanagerservice.service.impl.KeymanagerServiceImpl.getCertificateFromDBStore(KeymanagerServiceImpl.java:316)
	at io.mosip.kernel.keymanagerservice.service.impl.KeymanagerServiceImpl.getCertificate(KeymanagerServiceImpl.java:654)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	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.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
	at com.sun.proxy.$Proxy146.getCertificate(Unknown Source)
	at io.mosip.registration.util.advice.ResponseSignatureAdvice.isResponseSignatureValid(ResponseSignatureAdvice.java:191)
	at io.mosip.registration.util.advice.ResponseSignatureAdvice.responseSignatureValidation(ResponseSignatureAdvice.java:141)

this method causes the exception

KeyPairGenerateResponseDto certificateDto = keymanagerService
.getCertificate(RegistrationConstants.RESPONSE_SIGNATURE_PUBLIC_KEY_APP_ID,
      Optional.of(RegistrationConstants.RESPONSE_SIGNATURE_PUBLIC_KEY_REF_ID));

What HSM are you using? Looks like the certificate that we are trying to obtain is in the middle of the process.

If softhsm can you clean up the keymanager database and softhsm.