-
Bug
-
Resolution: Fixed
-
Blocker
-
None
-
Jenkins 1.642
openjdk version "1.8.0_66-internal"
Ubuntu 15.10
I get an IOException when trying to fetch the latest update center data.
java.io.IOException: Could not find JSON in http://updates.jenkins-ci.org/update-center.json?id=default&version=1.642
at hudson.model.DownloadService.loadJSON(DownloadService.java:170)
at hudson.model.UpdateSite.updateDirectlyNow(UpdateSite.java:173)
at hudson.PluginManager.doCheckUpdatesServer(PluginManager.java:959)
...
Trying wget on the same host to download the data from works fine:
$ wget -v "http://updates.jenkins-ci.org/update-center.json?id=default&version=1.642" --2016-02-05 12:08:23-- http://updates.jenkins-ci.org/update-center.json?id=default&version=1.642 Resolving updates.jenkins-ci.org (updates.jenkins-ci.org)... 199.193.196.24 Connecting to updates.jenkins-ci.org (updates.jenkins-ci.org)|199.193.196.24|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: http://mirrors.jenkins-ci.org/updates/1.642/update-center.json [following] --2016-02-05 12:08:23-- http://mirrors.jenkins-ci.org/updates/1.642/update-center.json Resolving mirrors.jenkins-ci.org (mirrors.jenkins-ci.org)... 199.193.196.24 Connecting to mirrors.jenkins-ci.org (mirrors.jenkins-ci.org)|199.193.196.24|:80... connected. HTTP request sent, awaiting response... 302 Found Location: ftp://ftp.halifax.rwth-aachen.de/jenkins/updates/1.642/update-center.json [following] --2016-02-05 12:08:23-- ftp://ftp.halifax.rwth-aachen.de/jenkins/updates/1.642/update-center.json => ‘update-center.json’ Resolving ftp.halifax.rwth-aachen.de (ftp.halifax.rwth-aachen.de)... 137.226.34.46, 2a00:8a60:e012:a00::21 Connecting to ftp.halifax.rwth-aachen.de (ftp.halifax.rwth-aachen.de)|137.226.34.46|:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD (1) /jenkins/updates/1.642 ... done. ==> SIZE update-center.json ... 996252 ==> PASV ... done. ==> RETR update-center.json ... done. Length: 996252 (973K) (unauthoritative) update-center.json 100%[=================================================================================================================>] 972.90K --.-KB/s in 0.1s 2016-02-05 12:08:24 (6.36 MB/s) - ‘update-center.json’ saved [996252]
The DownloadService seems to use plain JDK HTTP client (HttpURLConnection). To debug the download, I ran the following snippet in Script Console:
con = new URL("http://updates.jenkins-ci.org/update-center.json").openConnection() println con.class.name println con.responseCode println con.instanceFollowRedirects println con.inputStream.text println con.getHeaderFieldKey(5) println con.getHeaderField(5)
the output is:
sun.net.www.protocol.http.HttpURLConnection 302 true <!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="ftp://ftp.halifax.rwth-aachen.de/jenkins/updates/current/update-center.json">here</a>.</p> <hr> <address>Apache/2.2.14 (Ubuntu) Server at mirrors.jenkins-ci.org Port 80</address> </body></html> Location ftp://ftp.halifax.rwth-aachen.de/jenkins/updates/current/update-center.json
So I think the JDK is not following redirects to FTP URLs.