Keymanager hsm error

Hi,

Has anyone else encountered the error below with keymanager,

“} 2024-02-20T21:00:58.209810073Z {”@times

tamp":“2024-02-20T21:00:58.209Z”,“@version”:“1”,“message”:“HHH000412: Hibernate Core {5.2.17.Final}”,“logger_name”:“org.hibernate.Version”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:00:58.211747940Z {“@timestamp”:“2024-02-20T21:00:58.211Z”,“@version”:“1”,“message”:“HHH000206: hibernate.properties not found”,“logger_name”:“org.hibernate.cfg.Environment”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:00:58.320500456Z {“@timestamp”:“2024-02-20T21:00:58.320Z”,“@version”:“1”,“message”:“HCANN000001: Hibernate Commons Annotations {5.0.1.Final}”,“logger_name”:“org.hibernate.annotations.common.Version”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:00:59.247640236Z {“@timestamp”:“2024-02-20T21:00:59.247Z”,“@version”:“1”,“message”:“HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect”,“logger_name”:“org.hibernate.dialect.Dialect”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:00:59.704351069Z {“@timestamp”:“2024-02-20T21:00:59.702Z”,“@version”:“1”,“message”:“HHH000421: Disabling contextual LOB creation as hibernate.jdbc.lob.non_contextual_creation is true”,“logger_name”:“org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:01:01.562937306Z {“@timestamp”:“2024-02-20T21:01:01.562Z”,“@version”:“1”,“message”:“Initialized JPA EntityManagerFactory for persistence unit ‘hibernate’”,“logger_name”:“org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:01:01.911119418Z {“@timestamp”:“2024-02-20T21:01:01.910Z”,“@version”:“1”,“message”:"Exception encountered during context initialization - cancelling refresh attempt: org.springframework

.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘keymanagerServiceImpl’: Unsatisfied dependency expressed through field ‘keyStore’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘keyStoreImpl’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘softhsm.security.pin’ in value "${softhsm.security.pin}"“,“logger_name”:“org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext”,“thread_name”:“main”,“level”:“WARN”,“level_value”:30000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:01:01.911430930Z {”@timestamp":“2024-02-20T21:01:01.911Z”,“@version”:“1”,“message”:“Closing JPA EntityManagerFactory for persistence unit ‘hibernate’”,“logger_name”:“org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:01:01.912961754Z {“@timestamp”:“2024-02-20T21:01:01.912Z”,“@version”:“1”,“message”:“HikariPool-1 - Shutdown initiated…”,“logger_name”:“com.zaxxer.hikari.HikariDataSource”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:01:01.915784131Z {“@timestamp”:“2024-02-20T21:01:01.915Z”,“@version”:“1”,“message”:“HikariPool-1 - Shutdown completed.”,“logger_name”:“com.zaxxer.hikari.HikariDataSource”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:01:01.917730226Z {“@timestamp”:“2024-02-20T21:01:01.917Z”,“@version”:“1”,“message”:“Stopping service [Tomcat]”,“logger_name”:“org.apache.catalina.core.StandardService”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:“kernel-keymanager-service”} 2024-02-20T21:01:01.925061715Z {“@timestamp”:“2024-02-20T21:01:01.924Z”,“@version”:“1”,“message”:"Failed to clear soft references from ObjectStreamClass$Caches for web application [ROO

T]“,“logger_name”:“org.apache.catalina.loader.WebappClassLoaderBase”,“thread_name”:“localhost-startStop-1”,“level”:“WARN”,“level_value”:30000,“stack_trace”:“java.lang.ClassCastException: class java.io.ObjectStreamClass$Caches$1 cannot be cast to class java.util.Map (java.io.ObjectStreamClass$Caches$1 and java.util.Map are in module java.base of loader ‘bootstrap’)\n\tat org.apache.catalina.loader.WebappClassLoaderBase.clearCache(WebappClassLoaderBase.java:2244)\n\tat org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesObjectStreamClassCaches(WebappClassLoaderBase.java:2231)\n\tat org.apache.catalina.loader.WebappClassLoaderBase.clearReferences(WebappClassLoaderBase.java:1603)\n\tat org.apache.catalina.loader.WebappClassLoaderBase.stop(WebappClassLoaderBase.java:1548)\n\tat org.apache.catalina.loader.WebappLoader.stopInternal(WebappLoader.java:452)\n\tat org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)\n\tat org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5437)\n\tat org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)\n\tat org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1428)\n\tat org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1417)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\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 java.base/java.lang.Thread.run(Thread.java:829)\n”,“appName”:“kernel-keymanager-service”} 2024-02-20T21:01:02.000458216Z {”@timestamp":“2024-02-20T21:01:02.000Z”,“@version”:“1”,“message”:“\n\nError starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.”,“logger_name”:“org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener”,“thread_name”:“main”,“level”:“INFO”,“level_value”:20000,“appName”:"kernel-keymanager-serv

ice"} 2024-02-20T21:01:02.003147135Z {“@timestamp”:“2024-02-20T21:01:02.002Z”,“@version”:“1”,“message”:“Application run failed”,“logger_name”:“org.springframework.boot.SpringApplication”,“thread_name”:“main”,“level”:“ERROR”,“level_value”:40000,“stack_trace”:"org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘keymanagerServiceImpl’: Unsatisfied dependency expressed through field ‘keyStore’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘keyStoreImpl’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘softhsm.security.pin’ in value "${softhsm.security.pin}"\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:587)\n\tat org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1348)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:578)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFact

ory.java:199)\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)\n\tat org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:327)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)\n\tat io.mosip.kernel.keymanagerservice.KeymanagerBootApplication.main(KeymanagerBootApplication.java:28)\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.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)\n\tat org.springframework.boot.loader.Launcher.launch(Launcher.java:87)\n\tat org.springframework.boot.loader.Launcher.launch(Launcher.java:50)\n\tat org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:593)\nCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘keyStoreImpl’: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘softhsm.security.pin’ in value "${softhsm.secur

ity.pin}"\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:379)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1348)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:578)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)\n\tat org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065)\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584)\n\t… 27 common frames omitted\nCaused by: java.lang.IllegalArgumentException: Could not resolve placeholder ‘softhsm.security.pin’ in value "${softhsm.security.pin}"\n\tat org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:172)\n\tat org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:160)\n\tat org.springframework.util.PropertyPlaceholderHelper.rep

lacePlaceholders(PropertyPlaceholderHelper.java:124)\n\tat org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:237)\n\tat org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:211)\n\tat org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:228)\n\tat org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:88)\n\tat org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)\n\tat org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:531)\n\tat org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:137)\n\tat org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:133)\n\tat org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85)\n\tat org.springframework.core.env.PropertySourcesPropertyResolver.getPropertyAsRawString(PropertySourcesPropertyResolver.java:74)\n\tat org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:151)\n\tat org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124)\n\tat org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:237)\n\tat org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:211)\n\tat org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:839)\n\tat org.springframework.beans

.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1086)\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1065)\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:584)\n\tat org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91)\n\tat org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:373)\n\t… 38 common frames omitted\n",“appName”:“kernel-keymanager-service”}

Hi @alex-mbolonzi

I will ask our team to look into the error logs shared by you.

Best RegardS,
Team MOSIP

Hi @alex-mbolonzi

‘softhsm.security.pin’ placeholder is missing in keymanager docker environment variables. Please provide this environment variable with softHSM PIN or realHSM password as value to the variable to start the keymanager service with no issues.

Thanks.

Hi @mahammedtaheer,

Thank you for reaching out, the PIN was being set. I managed to resolve the issue by updating the config for kernel-default.properties from softhsm.kernel.pin=${softhsm.security.pin} to softhsm.kernel.pin=${softhsm-kernel.security-pin}

I noticed that was what was defined in the config-server.

Thanks,

1 Like