download-slave.sh creates empty slave.jar if download fails

Bug #1221648 reported by Jean-Baptiste Lallement
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jenkins (Ubuntu)
New
Undecided
Unassigned

Bug Description

download-slave.sh creates empty slave.jar if download fails for some reason (name resolution or network error for example) Thus the slave fails to starts with the following error in upstart job log file:

-----
Downloading slave.jar from http://10.97.0.1:8080/...
Error: Invalid or corrupt jarfile /var/run/jenkins/slave.jar
-----

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: jenkins-slave 1.509.2+dfsg-1
ProcVersionSignature: Ubuntu 3.11.0-4.9-generic 3.11.0-rc7
Uname: Linux 3.11.0-4-generic x86_64
ApportVersion: 2.12.1-0ubuntu3
Architecture: amd64
Date: Fri Sep 6 11:41:44 2013
MarkForUpload: True
PackageArchitecture: all
SourcePackage: jenkins
UpgradeStatus: Upgraded to saucy on 2012-01-31 (583 days ago)
modified.conffile..etc.default.jenkins.slave: [modified]
mtime.conffile..etc.default.jenkins.slave: 2013-06-04T11:35:22.211561

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Proposition of patch to debian/bin/download-slave.sh

--- download-slave.sh 2013-09-06 11:54:16.017977718 +0200
+++ download-slave.sh.new 2013-09-06 11:51:43.541982223 +0200
@@ -13,7 +13,7 @@
 wget -q -O ${SLAVE_JAR} ${JENKINS_URL}/jnlpJars/slave.jar

 # Check to make sure slave.jar was downloaded.
-if [ -f ${SLAVE_JAR} ]
+if [ -s ${SLAVE_JAR} ]
 then
        exit 0
 else

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.