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

multibranch pipeline deleting history and building unexpectedly

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Environment:
    • Similar Issues:

      Description

      I have a multibranch pipeline setup with a Jenkinsfile. I have a release branch (current-release) that isn't updated very often. Every once in a while, around a month or so, Jenkins decides to delete all of the previous builds of the branch and build the branch again. The build number starts at 1 again.

      I checked my repository scan log and it had already turned over since the build, so I don't know what was in there. The most recent build said it started because of branch indexing.

      I have "Discard old items" set to 1 days. My understanding this is just for deleting old branches.

      I'm using a github repository as my source with push notifications turned on.

      In my jenkins stdout/stderr log I see the following. The build occurred at 12:51pm. Could this cleanup possibly have deleted information for the wrong branch?

      INFO: ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?
      Jan 02, 2019 12:33:29 PM jenkins.branch.WorkspaceLocatorImpl getWorkspaceRoot
      WARNING: JENKINS-2111 path sanitization ineffective when using legacy Workspace Root Directory ?${ITEM_ROOTDIR}/workspace?; switch to ?${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}? as in JENKINS-8446 / JENKINS-21942
      Jan 02, 2019 12:33:32 PM jenkins.branch.WorkspaceLocatorImpl getWorkspaceRoot
      WARNING: JENKINS-2111 path sanitization ineffective when using legacy Workspace Root Directory ?${ITEM_ROOTDIR}/workspace?; switch to ?${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}? as in JENKINS-8446 / JENKINS-21942
      Jan 02, 2019 12:33:32 PM jenkins.branch.WorkspaceLocatorImpl$Deleter$CleanupTask run
      INFO: deleting obsolete workspace C:\Users\fll\jenkins\workspace\SW_issue_675_group-name-location on fll-build
      Jan 02, 2019 12:33:32 PM jenkins.branch.MultiBranchProject$BranchIndexing run
      INFO: FLL-SW #20190102.123300 branch indexing action completed: SUCCESS in 32 sec
      Jan 02, 2019 12:34:09 PM jenkins.branch.WorkspaceLocatorImpl$Deleter$CleanupTask run
      INFO: deleting obsolete workspace C:\Users\fll\jenkins\workspace\SW_issue_675_group-name-location@tmp on fll-build
      Jan 02, 2019 12:51:02 PM com.squareup.okhttp.internal.Platform$JdkWithJettyBootPlatform getSelectedProtocol
      

      The question is why is my build history getting deleted?

       

        Attachments

          Activity

          Hide
          jpschewe jpschewe added a comment -

          More information. Found something else that is odd.

          On scan shows

              Checking branch current-release
                ‘Jenkinsfile’ found
              Met criteria
          No changes detected: current-release (still at d79cc62c7dc3e036229e8bd1adc5a8aab7f9aa57)
          

          The next scan shows

              Checking branch current-release
                ‘Jenkinsfile’ not found
              Does not meet criteria
          

          and this is the one that also says at the bottom that current-release is being removed.

           

          I haven't made any changes to the current release branch and it does in fact have a Jenkinsfile as can be seen by the next scan that says

              Checking branch current-release
                ‘Jenkinsfile’ found
              Met criteria
          Scheduled build for branch: current-release 

          The repository for this Jenkins job is at https://github.com/jpschewe/fll-sw/

          The last commit was February 4, 2019. This particular reset of the history was on June 3, 2019. I think I've had a reset between those two dates, but not since I started monitoring the scan log in May.

           

          Show
          jpschewe jpschewe added a comment - More information. Found something else that is odd. On scan shows Checking branch current-release ‘Jenkinsfile’ found Met criteria No changes detected: current-release (still at d79cc62c7dc3e036229e8bd1adc5a8aab7f9aa57) The next scan shows Checking branch current-release ‘Jenkinsfile’ not found Does not meet criteria and this is the one that also says at the bottom that current-release is being removed.   I haven't made any changes to the current release branch and it does in fact have a Jenkinsfile as can be seen by the next scan that says Checking branch current-release ‘Jenkinsfile’ found Met criteria Scheduled build for branch: current-release The repository for this Jenkins job is at https://github.com/jpschewe/fll-sw/ The last commit was February 4, 2019. This particular reset of the history was on June 3, 2019. I think I've had a reset between those two dates, but not since I started monitoring the scan log in May.  
          Hide
          sg Sudheer Gundanna added a comment - - edited

          This happened again today [July-18-2019]for me. Master branch all previous builds were removed and started building from #1.  Is there any resolution for this issue?  this is so frustrating. It has happened 5 times before.

          Jenkins version we are using is 2.164.2

          GitHub plugin: 1.29.4

          Show
          sg Sudheer Gundanna added a comment - - edited This happened again today [July-18-2019] for me. Master branch all previous builds were removed and started building from #1.  Is there any resolution for this issue?  this is so frustrating. It has happened 5 times before. Jenkins version we are using is 2.164.2 GitHub plugin: 1.29.4
          Hide
          suganyaravikumar Suganya Ravikumar added a comment -

          Is this related to JENKINS-54126?

          Show
          suganyaravikumar Suganya Ravikumar added a comment - Is this related to  JENKINS-54126 ?
          Hide
          rompic Roman Pickl added a comment -

          I see this (or something related) for all branches. once in a while jenkins throws away everything (maybe after a problem with scanning our local github) and restarts all builds.

          Show
          rompic Roman Pickl added a comment - I see this (or something related) for all branches. once in a while jenkins throws away everything (maybe after a problem with scanning our local github) and restarts all builds.
          Hide
          morganr87 Morgan Robertson added a comment -
          Show
          morganr87 Morgan Robertson added a comment - This seems very similar to  https://issues.jenkins-ci.org/browse/JENKINS-55220

            People

            • Assignee:
              Unassigned
              Reporter:
              jpschewe jpschewe
            • Votes:
              17 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated: