Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70

"Previous Build" link can yield server error

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Platform: All, OS: All

      Say I am keeping ten builds of a project active. Right now #70 is done and #71
      is building. If I go to

      http://HOST/job/PRJ/60/

      there is a "Previous Build" link pointing to

      http://HOST/job/PRJ/59/

      But if I click on it I get

      ---%<---
      HTTP Status 404 -

      type Status report

      message

      description The requested resource () is not available.
      Apache Tomcat/5.5.17
      ---%<---

      Hudson should not link to a nonexistent page.

          [JENKINS-70] "Previous Build" link can yield server error

          The code does check for non-existent build. See

          <c:if test="${it.previousBuild!=null}">
          <l:task icon="images/24x24/previous.gif"
          href="${buildUrl.previousBuildUrl}" title="Previous Build" />
          </c:if>
          <c:if test="${it.nextBuild!=null}">
          <l:task icon="images/24x24/next.gif" href="${buildUrl.nextBuildUrl}"
          title="Next Build" />
          </c:if>

          The problem is that sometimes:

          1. user loads a page. This generates to the link to #59, which exists
          2. while the user is looking at the page, more builds happen, and #59
          gets eliminated.
          3. the user clicks the page, trying to load #59
          4. 404 error happens

          I don't think we can fix this.

          Maybe what you are saying is that we want a little more human friendly error
          page for a certain common kind of 404 like this?

          Kohsuke Kawaguchi added a comment - The code does check for non-existent build. See <c:if test="${it.previousBuild!=null}"> <l:task icon="images/24x24/previous.gif" href="${buildUrl.previousBuildUrl}" title="Previous Build" /> </c:if> <c:if test="${it.nextBuild!=null}"> <l:task icon="images/24x24/next.gif" href="${buildUrl.nextBuildUrl}" title="Next Build" /> </c:if> The problem is that sometimes: 1. user loads a page. This generates to the link to #59, which exists 2. while the user is looking at the page, more builds happen, and #59 gets eliminated. 3. the user clicks the page, trying to load #59 4. 404 error happens I don't think we can fix this. Maybe what you are saying is that we want a little more human friendly error page for a certain common kind of 404 like this?

          Jesse Glick added a comment -

          No, the link is really generated for the oldest available build in a project
          which has no builds running. I can reproduce for all of our projects, even after
          Ctrl-R in case there is some cache effect. The check (in
          resources/WEB-INF/side-files/hudson/model/Build/sidepanel.jsp?) does not work,
          apparently.

          Jesse Glick added a comment - No, the link is really generated for the oldest available build in a project which has no builds running. I can reproduce for all of our projects, even after Ctrl-R in case there is some cache effect. The check (in resources/WEB-INF/side-files/hudson/model/Build/sidepanel.jsp?) does not work, apparently.

          Jesse Glick added a comment -

          It seems that the field Run.previousBuild is never set to null. Probably
          Project.removeRun should inform the following Run that its previousBuild is now
          gone?

          Jesse Glick added a comment - It seems that the field Run.previousBuild is never set to null. Probably Project.removeRun should inform the following Run that its previousBuild is now gone?

          Ah! Good catch.

          In fact, I guess this was a kind of memory leak. The build obect is never
          reclaimed. Fixed this in 1.36.

          Kohsuke Kawaguchi added a comment - Ah! Good catch. In fact, I guess this was a kind of memory leak. The build obect is never reclaimed. Fixed this in 1.36.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: