• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core

      In Winstone 0.9.x we used to explode war under $JENKINS_HOME/war. When we moved to Jetty-based Winstone 2.0, this code was gone and now Jetty explodes war in /tmp/jetty-0.0.0.0-8080-jenkins.war-any.

      This tends to be problematic because various distros periodically clean up files under /tmp based on their modification dates. When exploded war files disappear from under us, all sorts of strange errors happen.

      We should resurrect the old behaviour and explode the war file under $JENKINS_HOME.

          [JENKINS-22442] Jetty exploding war to /tmp is a bad idea

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          src/java/winstone/HostConfiguration.java
          http://jenkins-ci.org/commit/winstone/ec38d13bcacb4007a797771188360d8a33c9c9fc
          Log:
          [FIXED JENKINS-22442]

          Jetty doesn't let us control where the files are to be exploded, so do
          the extraction by ourselves.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: src/java/winstone/HostConfiguration.java http://jenkins-ci.org/commit/winstone/ec38d13bcacb4007a797771188360d8a33c9c9fc Log: [FIXED JENKINS-22442] Jetty doesn't let us control where the files are to be exploded, so do the extraction by ourselves.

          I thought I've filed this somewhere but can't find it, so here it is again.

          Kohsuke Kawaguchi added a comment - I thought I've filed this somewhere but can't find it, so here it is again.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          war/pom.xml
          http://jenkins-ci.org/commit/jenkins/d927a0c8bea678eb6d179edd786b004bb47a18c5
          Log:
          [FIXED JENKINS-22442]

          Avoid extracting war file under /tmp. When jar files and resource files disappear from under
          us, all sorts of strange errors happen.

          Compare: https://github.com/jenkinsci/jenkins/compare/1b65fbb502c9...d927a0c8bea6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html war/pom.xml http://jenkins-ci.org/commit/jenkins/d927a0c8bea678eb6d179edd786b004bb47a18c5 Log: [FIXED JENKINS-22442] Avoid extracting war file under /tmp. When jar files and resource files disappear from under us, all sorts of strange errors happen. Compare: https://github.com/jenkinsci/jenkins/compare/1b65fbb502c9...d927a0c8bea6

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3270
          [FIXED JENKINS-22442] (Revision d927a0c8bea678eb6d179edd786b004bb47a18c5)

          Result = SUCCESS
          kohsuke : d927a0c8bea678eb6d179edd786b004bb47a18c5
          Files :

          • changelog.html
          • war/pom.xml

          dogfood added a comment - Integrated in jenkins_main_trunk #3270 [FIXED JENKINS-22442] (Revision d927a0c8bea678eb6d179edd786b004bb47a18c5) Result = SUCCESS kohsuke : d927a0c8bea678eb6d179edd786b004bb47a18c5 Files : changelog.html war/pom.xml

          The fix went into 1.558. I have that running here and it is now unpacking the WAR file into /var/cache/jenkins/war as per the --webroot setting.

          Richard Mortimer added a comment - The fix went into 1.558. I have that running here and it is now unpacking the WAR file into /var/cache/jenkins/war as per the --webroot setting.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          war/pom.xml
          http://jenkins-ci.org/commit/jenkins/f01a7c2c0ef3cc41ac9513dfbf77c67e65e039be
          Log:
          [FIXED JENKINS-22442]

          Avoid extracting war file under /tmp. When jar files and resource files disappear from under
          us, all sorts of strange errors happen.

          (cherry picked from commit d927a0c8bea678eb6d179edd786b004bb47a18c5)

          Conflicts:
          changelog.html

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: war/pom.xml http://jenkins-ci.org/commit/jenkins/f01a7c2c0ef3cc41ac9513dfbf77c67e65e039be Log: [FIXED JENKINS-22442] Avoid extracting war file under /tmp. When jar files and resource files disappear from under us, all sorts of strange errors happen. (cherry picked from commit d927a0c8bea678eb6d179edd786b004bb47a18c5) Conflicts: changelog.html

          Bhagyesh Shah added a comment -

          whats the resolution of this issue? I tried with 1.558 too, please help with steps to do

          Bhagyesh Shah added a comment - whats the resolution of this issue? I tried with 1.558 too, please help with steps to do

          Daniel Beck added a comment -

          bhagyesh12: You need to pass the option --webroot=path/to/where/to/extract to the java -jar jenkins.war call as already explained by Richard Mortimer two comments above yours.

          Daniel Beck added a comment - bhagyesh12 : You need to pass the option --webroot=path/to/where/to/extract to the java -jar jenkins.war call as already explained by Richard Mortimer two comments above yours.

          Bhagyesh Shah added a comment -

          @Daniel, I tried doing that already, it did not help me. Can you please tell me whats the ideal directory for webroot .. is it <user-home>/.jenkins/war ? I am using Solaris 10 and Java version is 1.6.0_65

          Bhagyesh Shah added a comment - @Daniel, I tried doing that already, it did not help me. Can you please tell me whats the ideal directory for webroot .. is it <user-home>/.jenkins/war ? I am using Solaris 10 and Java version is 1.6.0_65

            Unassigned Unassigned
            kohsuke Kohsuke Kawaguchi
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: