java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Can't download plugins - HTTP 302 redirect
    via by Corey Wei,
  • Maybe this issue is related to [JDK-4620571 : urlconnection following redirect uses protocol of original request|http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4620571] [http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4620571] I installed Jenkins 2.7.4 LTS from ubuntu apt repository following the offical installation guide. Then I navigated to the jenkins webapp url. After filled in initial admin password, loading indicator was shown for some time, and I got a message "This Jenkins instance appears to be offline." I am sure the network connection is fine and not behind any proxy. I skipped proxy configuration. Jenkins runs fine, but when I opened plugins manager, no plugins found. Since I have been worked with Hudson (before Jenkins split from Hudson) for quite long time I knew some problem occured. When I checked log file, I got following log entry: {quote} WARNING: Upgrading Jenkins. Failed to update the default Update Site 'default'. Plugin upgrades may fail. java.io.IOException: Could not find JSON in http://updates.jenkins-ci.org/update-center.json?id=default&version=2.7.4 at hudson.model.DownloadService.loadJSON(DownloadService.java:174) at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:176) at hudson.model.UpdateCenter.updateDefaultSite(UpdateCenter.java:2181) at jenkins.install.SetupWizard.init(SetupWizard.java:170) at jenkins.install.InstallState$3.initializeState(InstallState.java:105) at jenkins.model.Jenkins.setInstallState(Jenkins.java:970) at jenkins.install.InstallUtil.proceedToNextStateFrom(InstallUtil.java:94) at jenkins.model.Jenkins.<init>(Jenkins.java:887) at hudson.model.Hudson.<init>(Hudson.java:85) at hudson.model.Hudson.<init>(Hudson.java:81) at hudson.WebAppMain$3.run(WebAppMain.java:227) {quote} I tried to check the update site url with shell {quote}curl http://updates.jenkins-ci.org/update-center.json\?id=default\&version=2.7.4{quote}. The response is a 301 redirect. After another two 302 redirects, I got the final update site url: {quote}https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/stable-2.7/update-center.json{quote} The entire network flow of update site: {quote} http://updates.jenkins-ci.org/update-center.json?id=default&version=2.7.4 301 http://updates.jenkins-ci.org/stable-2.7/update-center.json 302 http://mirrors.jenkins-ci.org/updates/stable-2.7/update-center.json 302 https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/stable-2.7/update-center.json {quote} Then I changed the default update site url to this mirror url, I could get plugins list now. But when I tried to install some plugins, failed. I checked the log file and found following message: {quote} SEVERE: Failed to install SCM API Plugin java.io.IOException: Downloaded file /var/lib/jenkins/plugins/scm-api.jpi.tmp does not match expected SHA-1, expected 'GSoCVeUDmMHHd4hvIx6GHlvzA1g=', actual 'NUD1ONAUpGfIc3Hk0DiYO5HhS48=' at hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:1799) at hudson.model.UpdateCenter.access$1100(UpdateCenter.java:147) at hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:1950) at hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1194) at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1669) at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1864) at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1640) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110) at java.lang.Thread.run(Thread.java:745) {quote} I opened scm-api.jpi.tmp, it was a html file: {quote} <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>Found</h1> <p>The document has moved <a href="https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/scm-api/1.3/scm-api.hpi">here</a>.</p> </body></html> {quote} I can't figure out what happened. So I uninstalled 2.7.4, and installed 2.22 from apt reposity, the problem is still there. And I tried to install jenkins web app into tomcat 8.55, the problem is not resolved. I also tried openjdk8, before that oracle jdk 1.7.0_25 was used. Today, I cloned the source code from github, tried to add some log with bq. hudson.model.DownloadService.loadJSON(URL src) around line 170. I found that when using default update site url URLConnection stopped to follow the last 302 redirect to bq. https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json After that I checked the update site json content. The "scm-api" plugin's url is bq. http://updates.jenkins-ci.org/download/plugins/scm-api/1.3/scm-api.hpi There will be two 302 redirects, the final url is bq. https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/scm-api/1.3/scm-api.hpi The entire network flow of a plugin: {quote} http://updates.jenkins-ci.org/download/plugins/scm-api/1.3/scm-api.hpi 302 http://mirrors.jenkins-ci.org/plugins/scm-api/1.3/scm-api.hpi 302 https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/scm-api/1.3/scm-api.hpi {quote} After searching, I found the JDK issue record mentioned at the beginning. I'm not sure whether it is the reason. Maybe, Jenkins update site should enforce https. I want to change update-center.json with all the url directly pointed to the mirror site, and deployed to an internal server, but jenkins refused to accept it since the checksum digest is changed. So there is no work around for me.
    via by Xifeng Zou,
    • java.io.IOException: Downloaded file /home/deploy/.jenkins2/plugins/git-server.jpi.tmp does not match expected SHA-1, expected 'LoG8X55ycVzgPjwTtCA/iKb7lvw=', actual 'Lbk3pB/mu/UlYJO4o2ttQkZ+mvs=' at hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:1799) at hudson.model.UpdateCenter.access$1100(UpdateCenter.java:147) at hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:1950) at hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1194) at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1669) at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1864) at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1640) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor2 times, last one,
    Unknown visitor
    Unknown visitor2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    davidvanlaatumdavidvanlaatum
    14 times, last one,
    18 more bugmates