Cannot start Jenkins on https - jenkins

I'm trying to switch Jenkins on https port,but i'm receiving the following errors and Jenkins cannot be started
java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory
at winstone.Launcher.spawnListener(Launcher.java:209)
at winstone.Launcher.<init>(Launcher.java:150)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at Main._main(Main.java:312)
at Main.main(Main.java:136)
Caused by: winstone.WinstoneException: Error getting the SSL context object
at winstone.AbstractSecuredConnectorFactory.getSSLContext(AbstractSecuredConnectorFactory.java:216)
at winstone.HttpsConnectorFactory.createConnector(HttpsConnectorFactory.java:56)
at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:41)
at winstone.Launcher.spawnListener(Launcher.java:207)
... 8 more`
Caused by: java.security.UnrecoverableKeyException: Cannot recover key
at sun.security.provider.KeyProtector.recover(Unknown Source)
at sun.security.provider.JavaKeyStore.engineGetKey(Unknown Source)
at sun.security.provider.JavaKeyStore$JKS.engineGetKey(Unknown Source)
at sun.security.provider.KeyStoreDelegator.engineGetKey(Unknown Source)
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineGetKey(Unknown Source)
at java.security.KeyStore.getKey(Unknown Source)
at sun.security.ssl.SunX509KeyManagerImpl.<init>(Unknown Source)
at sun.security.ssl.KeyManagerFactoryImpl$SunX509.engineInit(Unknown Source)
at javax.net.ssl.KeyManagerFactory.init(Unknown Source)
at winstone.AbstractSecuredConnectorFactory.getSSLContext(AbstractSecuredConnectorFactory.java:183)
I created a new keystore and inside the keystore i have imported a p12 certificate.
Probably something is wrong with the keystore? What Jenkins expects in the keystore? Do i need to import a public certificate in the keystore?

I also ran in to the this issue while having 2 different passwords for my p12 and jks. ( I started with a private key and a self signed certificate, then converted my key and cert in to a p12 format store, finally converted p12 to a jks file )
Caused by: winstone.WinstoneException: Error getting the SSL context object
at winstone.AbstractSecuredConnectorFactory.getSSLContext(AbstractSecuredConnectorFactory.java:229)
at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:63)
at winstone.Launcher.spawnListener(Launcher.java:220)
... 8 more Caused by: java.security.UnrecoverableKeyException: Cannot recover key
at sun.security.provider.KeyProtector.recover(KeyProtector.java:315)
at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:143)
at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java:57)
at sun.security.provider.KeyStoreDelegator.engineGetKey(KeyStoreDelegator.java:96)
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineGetKey(JavaKeyStore.java:71)
at java.security.KeyStore.getKey(KeyStore.java:1023)
at sun.security.ssl.SunX509KeyManagerImpl.<init>(SunX509KeyManagerImpl.java:145)
at sun.security.ssl.KeyManagerFactoryImpl$SunX509.engineInit(KeyManagerFactoryImpl.java:70)
at javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:256)
at winstone.AbstractSecuredConnectorFactory.getSSLContext(AbstractSecuredConnectorFactory.java:190)
... 10 more 2021-03-27 05:38:15.911+0000 [id=1] SEVERE winstone.Logger#logInternal: Container startup failed java.security.UnrecoverableKeyException: Cannot recover key
at sun.security.provider.KeyProtector.recover(KeyProtector.java:315)
at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:143)
at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java:57)
I applied the same password for p12 and jks and then attempted and could got rid or this error.

I run into similar problem. I had Jenkins installation on RHEL. When I went through procedure to switch to https, got the same error.
Finally setting the same password to pkcs12 and then jks fixed the problem.

Related

Installation of "JavaScript GUI Lib" plugin fails in Jenkins

I am trying to install JavaScript GUI Lib plugin on jenkins. I am getting the following errors.
java.net.SocketTimeoutException: Read timed out
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1243)
Failed to load http://updates.jenkins-ci.org/download/plugins/ace-editor/1.1/ace-editor.hpi to C:\Program Files (x86)\Jenkins\plugins\ace-editor.jpi.tmp
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1250)
Failed to download from http://updates.jenkins-ci.org/download/plugins/ace-editor/1.1/ace-editor.hpi (redirected to: http://mirror.serverion.com/jenkins/plugins/ace-editor/1.1/ace-editor.hpi)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1284)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1832)"
I checked if I have access to http://updates.jenkins-ci.org/download/plugins/ace-editor/1.1/ace-editor.hpi""using curl. I was able to reach the URL.
Issue is resolved. Looks like there was a problem with restart. I downloaded the plugin and restarted Jenkins and installed it explicitly. It is working now.

Failing Git and Github plugin and its dependency installation in Jenkins

I was trying to install GitHub plugin, but am getting status as failed with error,
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:77)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1139)
Caused: java.io.IOException: Failed to load http://updates.jenkins-ci.org/download/plugins/git/3.9.1/git.hpi to C:\Program Files (x86)\Jenkins\plugins\git.jpi.tmp
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1144)
Caused: java.io.IOException: Failed to download from http://updates.jenkins-ci.org/download/plugins/git/3.9.1/git.hpi (redirected to: http://ftp-nyc.osuosl.org/pub/jenkins/plugins/git/3.9.1/git.hpi)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1178)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1715)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1978)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1689)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:112)
at java.lang.Thread.run(Unknown Source)
I have a working internet connection, but couldn't able to fix the issue.
The issue looks similar to this bug mentioned under the Jenkins Issue. The status shows that this bug is fixed but unreleased.
Check in the comments at the bottom of the page and you can find that it is caused by firewall.

Issue in configuring email in jenkins

I have tried to go through all the solutions provided on stack overflow like adding a skip plugin or adding a certificate in keystore, still test email is failing with the below error, can someone help me with same. I am using a windows machine
Error in jenkins:sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
Caused: sun.security.validator.ValidatorException: PKIX path building failed
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
<snip>
Caused: javax.net.ssl.SSLHandshakeException
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
<snip>
Caused: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
at javax.mail.Service.connect(Service.java:317)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at hudson.tasks.Mailer$DescriptorImpl.doSendTestMail(Mailer.java:585)
<snip>
cmd prompt says Certificate already exists in keystore under alias .
Go to https://<jenkins-url>/systemInfo and look for javax.net.ssl.trustStore.
This should be the truststore where the certificate should be added.
You can open the keystore with keytool or if you prefer a GUI take a look at Keystore Explorer
The default password of the truststore is changeit.

Cannot start jenkins after changed keystore password

I changed my keystore password today to a more secure one and I cannot restart jenkins. The log has the following error:
SEVERE: Container startup failed
java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory
at winstone.Launcher.spawnListener(Launcher.java:207)
at winstone.Launcher.<init>(Launcher.java:149)
at winstone.Launcher.main(Launcher.java:352)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at Main._main(Main.java:246)
at Main.main(Main.java:91)
Caused by: winstone.WinstoneException: Error getting the SSL context object
at winstone.HttpsConnectorFactory.getSSLContext(HttpsConnectorFactory.java:241)
at winstone.HttpsConnectorFactory.createConnector(HttpsConnectorFactory.java:131)
at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:116)
at winstone.Launcher.spawnListener(Launcher.java:205)
... 8 more
Caused by: java.security.UnrecoverableKeyException: Cannot recover key
at sun.security.provider.KeyProtector.recover(KeyProtector.java:328)
at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:146)
at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java:56)
at sun.security.provider.KeyStoreDelegator.engineGetKey(KeyStoreDelegator.java:96)
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineGetKey(JavaKeyStore.java:70)
at java.security.KeyStore.getKey(KeyStore.java:1023)
at sun.security.ssl.SunX509KeyManagerImpl.<init>(SunX509KeyManagerImpl.java:133)
at sun.security.ssl.KeyManagerFactoryImpl$SunX509.engineInit(KeyManagerFactoryImpl.java:70)
at javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:256)
at winstone.HttpsConnectorFactory.getSSLContext(HttpsConnectorFactory.java:210)
I am assuming the password was stored somewhere and now they don't jive...
Turns out something got screwed up with keystore when I used a 3d party utility to combine a couple of certificates and change the password. I cleaned all that up and all is fine again.

Websphere Application server not starting

We have one Websphere Application server instance which went down with OutOfMemory and is not starting after that. The error message in the log below. Any urgent help will be highly appreciated. WAS version is 6.0.2.33
03/04/13 14:16:01:536 BST] 0000000a WsServerImpl E WSVR0009E: Error occurred during startup
META-INF/ws-server-components.xml
[03/04/13 14:16:01:547 BST] 0000000a WsServerImpl E WSVR0009E: Error occurred during startup
com.ibm.ws.exception.ConfigurationError: com.ibm.ws.exception.ConfigurationError: Problem initializing AdminImpl:
at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:180)
at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:133)
at com.ibm.ws.runtime.WsServerImpl.main(WsServerImpl.java:387)
at com.ibm.ws.runtime.WsServer.main(WsServer.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.ibm.ws.bootstrap.WSLauncher.run(WSLauncher.java:219)
at java.lang.Thread.run(Thread.java:568)
Caused by: com.ibm.ws.exception.ConfigurationError: Problem initializing AdminImpl:
at com.ibm.ws.management.component.AdminImpl.initialize(AdminImpl.java:780)
at com.ibm.ws.runtime.component.ContainerImpl.initializeComponent(ContainerImpl.java:1160)
at com.ibm.ws.runtime.component.ContainerImpl.initializeComponents(ContainerImpl.java:1014)
at com.ibm.ws.runtime.component.ServerImpl.initialize(ServerImpl.java:284)
at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:173)
... 10 more
Caused by: com.ibm.ws.exception.ConfigurationWarning: Problem registering JVM MBean.
at com.ibm.ws.management.component.AdminImpl.initialize(AdminImpl.java:405)
... 14 more
Caused by: com.ibm.websphere.management.exception.AdminException: ADMN0005E: The service is unable to activate MBean: type JVM, collaborator com.ibm.ws.management.component.JVMMBean#6da65714, configuration ID JVM, descriptor null.
at com.ibm.ws.management.MBeanFactoryImpl.activateMBean(MBeanFactoryImpl.java:654)
at com.ibm.ws.management.MBeanFactoryImpl.activateMBean(MBeanFactoryImpl.java:400)
at com.ibm.ws.management.component.AdminImpl.initialize(AdminImpl.java:394)
... 14 more
Caused by: com.ibm.websphere.management.exception.DescriptorParseException: ADMN0001W: The service is unable to parse the MBean descriptor file com/ibm/ws/management/descriptor/xml/JVM.xml.
at com.ibm.ws.management.descriptor.MBeanDescriptorLoader.loadDescriptor(MBeanDescriptorLoader.java:164)
at com.ibm.ws.management.descriptor.MBeanDescriptorManager.loadDescriptorFile(MBeanDescriptorManager.java:349)
at com.ibm.ws.management.descriptor.MBeanDescriptorManager.getDescriptor(MBeanDescriptorManager.java:147)
at com.ibm.ws.management.MBeanFactoryImpl.activateMBean(MBeanFactoryImpl.java:427)
... 16 more
Caused by: java.lang.NullPointerException
at javax.management.MBeanNotificationInfo.equals(MBeanNotificationInfo.java:155)
at com.ibm.ws.management.descriptor.MBeanDescriptorLoader.addFeatures(MBeanDescriptorLoader.java:461)
at com.ibm.ws.management.descriptor.MBeanDescriptorLoader.loadParentTypes(MBeanDescriptorLoader.java:434)
at com.ibm.ws.management.descriptor.MBeanDescriptorLoader.endDocument(MBeanDescriptorLoader.java:217)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at com.ibm.ws.management.descriptor.MBeanDescriptorLoader.loadDescriptor(MBeanDescriptorLoader.java:155)
... 19 more
I think your websphere is trying to use SUN JDK/JRE instead of IBM JDK/JRE.
you can delete all instance of Websphere servers and then you need to restart it and synch the node , node agent before to check jdk version in your environment path in the WAS.

Resources