1

I am following the "Getting Started" guide from the Jenkins documentation; however, I have not been able to get Jenkins to run properly. When I run the command java -jar jenkins.war --httpPort=8080 I get a series of warnings/errors and Jenkins will not run as expected. I am not able to install any plugins or complete the very next step of the getting started guide.

The first warning I receive is for deleting a temp file. It appears to fail because there is no file at that location.

Jan 27, 2018 11:58:13 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file 
/var/folders/mg/r5m253mx4hz75sk1f_gn5xg80000gn/T/winstone/jenkins.war

The next warning I get is a Jetty warning. I have no idea what the issue is here, as I am not familiar with Jetty.

Jan 27, 2018 11:58:16 PM 
org.eclipse.jetty.server.handler.ContextHandler setContextPath
WARNING: Empty contextPath

The next warning is,

Jan 27, 2018 11:58:34 PM jenkins.slaves.DeprecatedAgentProtocolMonitor 
initializerCheck
WARNING: This Jenkins instance uses deprecated Remoting protocols: CLI-
connect,CLI2-connect,JNLP-connect,JNLP2-connectIt may impact stability 
of the instance. If newer protocol versions are supported by all system 
components (agents, CLI and other clients), it is highly recommended to 
disable the deprecated protocols.

And finally, I get a lengthy stacktrace regarding some type of Hudson or certification issue.

Jan 27, 2018 11:58:37 PM hudson.model.UpdateCenter updateDefaultSite
WARNING: Upgrading Jenkins. Failed to update the default Update Site 
'default'. Plugin upgrades may fail.
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 sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at hudson.model.DownloadService.loadJSON(DownloadService.java:167)
    at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:190)
    at hudson.model.UpdateCenter.updateDefaultSite(UpdateCenter.java:2194)
    at jenkins.install.SetupWizard.init(SetupWizard.java:184)
    at jenkins.install.InstallState$3.initializeState(InstallState.java:105)
    at jenkins.model.Jenkins.setInstallState(Jenkins.java:1037)
    at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:98)
    at jenkins.model.Jenkins.<init>(Jenkins.java:927)
    at hudson.model.Hudson.<init>(Hudson.java:86)
    at hudson.model.Hudson.<init>(Hudson.java:82)
    at hudson.WebAppMain$3.run(WebAppMain.java:233)
Caused by: sun.security.validator.ValidatorException: PKIX path 
building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to 
find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
    at sun.security.validator.Validator.validate(Validator.java:260)
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
    ... 23 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:146)
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131)
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
    ... 29 more

As I said, I am following their instructions word for word and they're very simple, but it just won't work. Any help that you can provide would be much appreciated. Thanks.

O'Malley
  • 11
  • 3

1 Answers1

1

It can depend on your exact setup and OS: this was seen for instance in a docker setup, with jenkinsci/docker issue 422, although this Dockerfile works.

The issue includes:

I was facing the same problem and I fixed it by removing option '--preferedClassLoader' in environment variable JENKINS_ARGS.

That being said, your local Jenkins instance might want to connect to https site (for instance to check for plugins update).
If that is the case, you would need to import the certificate of the remote site into your JDK keystore.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • It's trying to hit http://localhost:8080/pluginManager/checkUpdatesServer when I check for available plugins. Shouldn't it be checking an actual updates server? – O'Malley Jan 28 '18 at 09:04
  • Also, where are the Jenkins environment variables you mentioned located? – O'Malley Jan 28 '18 at 09:14
  • @O'Malley That is when Jenkins is installed as a service, in the wrapper script. See for example: https://stackoverflow.com/a/16401585/6309 – VonC Jan 28 '18 at 09:22
  • @O'Malley checkUpdateServer is what the PluginManager does: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/PluginManager.java#L1635-L1656, which should have a default: https://github.com/jenkinsci/jenkins/blob/4d60ca6de64ddd9acee6a3fabd77ea4bf7ee8eeb/core/src/main/java/hudson/model/UpdateCenter.java#L160-L164 – VonC Jan 28 '18 at 09:28
  • Thanks, @VonC I'll check these out. – O'Malley Jan 28 '18 at 18:47