[JIRA] (JENKINS-38341) Can't get plugins list and can't install plugins from update center

26 views
Skip to first unread message

xifeng.zou@wendaoec.com (JIRA)

unread,
Sep 19, 2016, 5:38:02 AM9/19/16
to jenkinsc...@googlegroups.com
Xifeng Zou created an issue
 
Jenkins / Bug JENKINS-38341
Can't get plugins list and can't install plugins from update center
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: Screen Shot 2016-09-19 at 3.42.04 PM.png
Components: core
Created: 2016/Sep/19 9:37 AM
Environment: Ubuntu 16.04.1 LTS
Oracle JRE 1.7.0_25, OpenJDK8
Jenkins 2.7.4 LTS and Jenkins 2.22
Priority: Blocker Blocker
Reporter: Xifeng Zou

Maybe this issue is related to JDK-4620571 : urlconnection following redirect uses protocol of original request

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:

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)

I tried to check the update site url with shell

curl http://updates.jenkins-ci.org/update-center.json&#63;id=default\&version=2.7.4

. The response is a 301 redirect. After another two 302 redirects, I got the final update site url:

https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/stable-2.7/update-center.json

The entire network flow of update site:

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

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:

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)

I opened scm-api.jpi.tmp, it was a html file:

<!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>

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

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

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

http://updates.jenkins-ci.org/download/plugins/scm-api/1.3/scm-api.hpi

There will be two 302 redirects, the final url is

https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/scm-api/1.3/scm-api.hpi

The entire network flow of a plugin:

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

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.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

xifeng.zou@wendaoec.com (JIRA)

unread,
Sep 19, 2016, 5:42:01 AM9/19/16
to jenkinsc...@googlegroups.com
Xifeng Zou updated an issue
Change By: Xifeng Zou
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}
{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

After that I checked the update site json content. The "scm-api" plugin's url is

There will be two 302 redirects, the final url is


The entire network flow of a plugin:
{quote}
{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.

xifeng.zou@wendaoec.com (JIRA)

unread,
Sep 19, 2016, 10:15:01 AM9/19/16
to jenkinsc...@googlegroups.com
Xifeng Zou commented on Bug JENKINS-38341
 
Re: Can't get plugins list and can't install plugins from update center

Jenkins update site can be visited with https. I changed the default update site protocol from http to https, plugins list can be fetched. But plugins url in the update-center.json are still http, install plugins failed.

billhoo@126.com (JIRA)

unread,
Sep 21, 2016, 6:01:01 AM9/21/16
to jenkinsc...@googlegroups.com
Bill Hoo commented on Bug JENKINS-38341

Same issue as Zou said since I update Jenkins to 2.7.4 LTS.

dbeck@cloudbees.com (JIRA)

unread,
Sep 27, 2016, 4:39:02 PM9/27/16
to jenkinsc...@googlegroups.com
Daniel Beck resolved as Not A Defect
 

Temporary problem with misconfigured Chinese mirror which we've since removed.

Change By: Daniel Beck
Status: Open Resolved
Resolution: Not A Defect

fbcyborg@gmail.com (JIRA)

unread,
Jan 21, 2017, 6:18:01 AM1/21/17
to jenkinsc...@googlegroups.com
Flavio B commented on Bug JENKINS-38341
 
Re: Can't get plugins list and can't install plugins from update center

Hi,
I see this bug status as resolved but I am still facing this issue with 2.32.1 LTS and I am not able to change the url to HTTPS.
Basically I try to change from http to https in JENKINS_HOME/hudson.model.UpdateCenter.xml but the following file still have http urls: JENKINS_HOME/updates/default.json.
I tried to find and replace all http values with https, but this file gets updated automatically and http is there once more.

Is there some workaround for this?

dbeck@cloudbees.com (JIRA)

unread,
Jan 21, 2017, 6:57:03 AM1/21/17
to jenkinsc...@googlegroups.com

Flavio B Your description looks like an unrelated issue. In fact, it doesn't look like a bug at all: HTTP URLs are provided by the official Jenkins update site, so of course updating the local metadata cache will override whatever you put into this file. You may need to look into hosting your own update site. Please note that asking how to do that is beyond the scope of this issue tracker, and best asked e.g. on the jenkinsci-users mailing list.

Reply all
Reply to author
Forward
0 new messages