[JIRA] (JENKINS-55388) multibranch pipeline deleting history and building unexpectedly

7 views
Skip to first unread message

jpschewe@mtu.net (JIRA)

unread,
Jan 3, 2019, 7:38:02 AM1/3/19
to jenkinsc...@googlegroups.com
jpschewe created an issue
 
Jenkins / Bug JENKINS-55388
multibranch pipeline deleting history and building unexpectedly
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2019-01-03 12:37
Environment: Jenkins 2.150.1
SLOCCount Plug-in (sloccount): 1.24
PAM Authentication plugin (pam-auth): 1.4
Performance Plugin (performance): 3.14
Task Scanner Plug-in (tasks): 4.53
Timestamper (timestamper): 1.8.10
CVS Plug-in (cvs): 2.14
Javadoc Plugin (javadoc): 1.4
SSH Slaves plugin (ssh-slaves): 1.29.1
Token Macro Plugin (token-macro): 2.5
DRY Plug-in (dry): 3.0.0
FindBugs Plug-in (findbugs): 5.0.0
Mercurial plugin (mercurial): 2.4
Violations plugin (violations): 0.7.11
Email Extension Plugin (email-ext): 2.63
Static Analysis Utilities (analysis-core): 1.95
SSH Agent Plugin (ssh-agent): 1.17
description setter plugin (description-setter): 1.10
GitHub plugin (github): 1.29.3
LDAP Plugin (ldap): 1.20
Xvnc plugin (xvnc): 1.24
Ant Plugin (ant): 1.9
build-name-setter (build-name-setter): 1.6.9
Git plugin (git): 3.9.1
Cobertura Plugin (cobertura): 1.13
Project Description Setter (project-description-setter): 1.2
Cppcheck Plug-in (cppcheck): 1.24
External Monitor Job Type Plugin (external-monitor-job): 1.7
PMD Plug-in (pmd): 4.0.0
Monitoring (monitoring): 1.75.0
SCM API Plugin (scm-api): 2.3.0
Build Timeout (build-timeout): 1.19
Warnings Plug-in (warnings): 5.0.0
JUnit Plugin (junit): 1.26.1
Maven Integration plugin (maven-plugin): 3.2
Mailer Plugin (mailer): 1.22
Credentials Plugin (credentials): 2.1.18
disk-usage plugin (disk-usage): 0.28
SSH Credentials Plugin (ssh-credentials): 1.14
Git client plugin (git-client): 2.7.5
xUnit plugin (xunit): 2.3.1
Pipeline: Input Step (pipeline-input-step): 2.9
Icon Shim Plugin (icon-shim): 2.0.3
Variant Plugin (variant): 1.1
Pipeline: API (workflow-api): 2.33
Docker Commons Plugin (docker-commons): 1.13
JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1
Pipeline: Basic Steps (workflow-basic-steps): 2.13
OWASP Markup Formatter Plugin (antisamy-markup-formatter): 1.5
Durable Task Plugin (durable-task): 1.28
Matrix Project Plugin (matrix-project): 1.13
Pipeline: Milestone Step (pipeline-milestone-step): 1.3.1
Pipeline: Declarative (pipeline-model-definition): 1.3.4
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin (jquery-detached): 1.2.1
Pipeline: Nodes and Processes (workflow-durable-task-step): 2.27
bouncycastle API Plugin (bouncycastle-api): 2.17
Branch API Plugin (branch-api): 2.1.2
jQuery plugin (jquery): 1.12.4-0
Pipeline Graph Analysis Plugin (pipeline-graph-analysis): 1.9
GitHub API Plugin (github-api): 1.95
Pipeline: Shared Groovy Libraries (workflow-cps-global-lib): 2.12
Throttle Concurrent Builds Plug-in (throttle-concurrents): 2.0.1
Pipeline: REST API Plugin (pipeline-rest-api): 2.10
Plain Credentials Plugin (plain-credentials): 1.5
JavaScript GUI Lib: Handlebars bundle plugin (handlebars): 1.1.1
JavaScript GUI Lib: Moment.js bundle plugin (momentjs): 1.1.1
Pipeline (workflow-aggregator): 2.6
Structs Plugin (structs): 1.17
Docker Pipeline (docker-workflow): 1.17
Display URL API (display-url-api): 2.3.0
Pipeline: Step API (workflow-step-api): 2.17
Pipeline: Stage Tags Metadata (pipeline-stage-tags-metadata): 1.3.4
Pipeline: Stage View Plugin (pipeline-stage-view): 2.10
Favorite (favorite): 2.3.2
GIT server Plugin (git-server): 1.7
Pipeline: Multibranch (workflow-multibranch): 2.20
Matrix Authorization Strategy Plugin (matrix-auth): 2.3
Pipeline: SCM Step (workflow-scm-step): 2.7
Pipeline: Groovy (workflow-cps): 2.61
Pipeline: Build Step (pipeline-build-step): 2.7
JIRA plugin (jira): 3.0.5
Credentials Binding Plugin (credentials-binding): 1.17
Blue Ocean (blueocean): 1.9.0
Script Security Plugin (script-security): 1.49
Authentication Tokens API Plugin (authentication-tokens): 1.3
Pipeline: Supporting APIs (workflow-support): 2.24
Pipeline: Declarative Agent API (pipeline-model-declarative-agent): 1.1.1
Pipeline: Stage Step (pipeline-stage-step): 2.3
Pipeline: Model API (pipeline-model-api): 1.3.4
MapDB API Plugin (mapdb-api): 1.0.9.0
WMI Windows Agents Plugin (windows-slaves): 1.4
Pipeline: Declarative Extension Points API (pipeline-model-extensions): 1.3.4
Folders Plugin (cloudbees-folder): 6.7
Pipeline: Job (workflow-job): 2.31
Parameterized Trigger plugin (parameterized-trigger): 2.35.2
Common API for Blue Ocean (blueocean-commons): 1.9.0
GitHub Pipeline for Blue Ocean (blueocean-github-pipeline): 1.9.0
Autofavorite for Blue Ocean (blueocean-autofavorite): 1.2.2
REST API for Blue Ocean (blueocean-rest): 1.9.0
Config API for Blue Ocean (blueocean-config): 1.9.0
GitHub Branch Source Plugin (github-branch-source): 2.4.1
Pipeline: Multibranch with defaults (pipeline-multibranch-defaults): 2.0
Run Condition Plugin (run-condition): 1.2
Command Agent Launcher Plugin (command-launcher): 1.2
Config File Provider Plugin (config-file-provider): 3.4.1
REST Implementation for Blue Ocean (blueocean-rest-impl): 1.9.0
Server Sent Events (SSE) Gateway Plugin (sse-gateway): 1.16
Git Pipeline for Blue Ocean (blueocean-git-pipeline): 1.9.0
Dashboard for Blue Ocean (blueocean-dashboard): 1.9.0
JSch dependency plugin (jsch): 0.1.54.2
Pipeline implementation for Blue Ocean (blueocean-pipeline-api-impl): 1.9.0
JDK Tool Plugin (jdk-tool): 1.2
Blue Ocean Pipeline Editor (blueocean-pipeline-editor): 1.9.0
JWT for Blue Ocean (blueocean-jwt): 1.9.0
i18n for Blue Ocean (blueocean-i18n): 1.9.0
Pub-Sub "light" Bus (pubsub-light): 1.12
Bitbucket Branch Source Plugin (cloudbees-bitbucket-branch-source): 2.2.16
JIRA Integration for Blue Ocean (blueocean-jira): 1.9.0
Jackson 2 API Plugin (jackson2-api): 2.9.8
Pipeline SCM API for Blue Ocean (blueocean-pipeline-scm-api): 1.9.0
Display URL for Blue Ocean (blueocean-display-url): 2.2.0
HTML Publisher plugin (htmlpublisher): 1.17
Bitbucket Pipeline for Blue Ocean (blueocean-bitbucket-pipeline): 1.9.0
Pipeline GitHub Notify Step Plugin (pipeline-githubnotify-step): 1.0.4
Conditional BuildStep (conditional-buildstep): 1.3.6
Build Pipeline Plugin (build-pipeline-plugin): 1.5.8
Web for Blue Ocean (blueocean-web): 1.9.0
Personalization for Blue Ocean (blueocean-personalization): 1.9.0
Events API for Blue Ocean (blueocean-events): 1.9.0
Lockable Resources plugin (lockable-resources): 2.3
Code Coverage API Plugin (code-coverage-api): 1.0.5
Blue Ocean Core JS (blueocean-core-js): 1.9.0
Handy Uri Templates 2.x API Plugin (handy-uri-templates-2-api): 2.1.6-1.0
Trilead API Plugin (trilead-api): 1.0.1
Apache HttpComponents Client 4.x API Plugin (apache-httpcomponents-client-4-api): 4.5.5-3.0
Analysis Model API Plug-in (analysis-model-api): 1.0.0
Design Language (jenkins-design-language): 1.9.0
Warnings Next Generation Plugin (warnings-ng): 1.0.0
Mail Watcher Plugin (mail-watcher-plugin): 1.16
Backup plugin (backup): 1.6.1
JavaNCSS plugin (javancss): 1.1
Hudson Locks and Latches plugin (locks-and-latches): 0.6
Priority: Major Major
Reporter: jpschewe

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?

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

andrew.bayer@gmail.com (JIRA)

unread,
Jan 17, 2019, 12:19:02 PM1/17/19
to jenkinsc...@googlegroups.com
Andrew Bayer updated an issue
Change By: Andrew Bayer
Component/s: branch-api-plugin
Component/s: workflow-multibranch-plugin
Component/s: pipeline

hai@bodidata.com (JIRA)

unread,
Feb 10, 2019, 11:09:02 PM2/10/19
to jenkinsc...@googlegroups.com

hai@bodidata.com (JIRA)

unread,
Feb 10, 2019, 11:10:59 PM2/10/19
to jenkinsc...@googlegroups.com
Hai Nguyen commented on Bug JENKINS-55388
 
Re: multibranch pipeline deleting history and building unexpectedly

I had the same bug too, I don't remember the multi branch plugin version at the first time I saw this bug, but that's when I'm using Blue Ocean 1.0.0, and now, I'm using Blue Ocean 1.7.0 and this one is still happening. 

This morning, all my repositories and all branches in each repository are starting again from build #1, all at the same time, all history is also deleted. This is not the first time I have this problem. Usually this happens when I change my configuration (like only build branches that match my wildcard), but also so many times it starts building unexpectedly like now.

hai@bodidata.com (JIRA)

unread,
Feb 10, 2019, 11:11:02 PM2/10/19
to jenkinsc...@googlegroups.com

vivek.pandey@gmail.com (JIRA)

unread,
Feb 27, 2019, 7:15:02 PM2/27/19
to jenkinsc...@googlegroups.com

jpschewe@mtu.net (JIRA)

unread,
Mar 13, 2019, 2:17:02 PM3/13/19
to jenkinsc...@googlegroups.com
jpschewe commented on Bug JENKINS-55388
 
Re: multibranch pipeline deleting history and building unexpectedly

I just had a build do this again. I looked at the scan repository log and it said no changes for the branch. However it could be that the scanning happened after the build started. Is there some logging I can turn on to see the results of all scans over time and catch the error?

technolengy@gmail.com (JIRA)

unread,
Apr 25, 2019, 11:01:03 AM4/25/19
to jenkinsc...@googlegroups.com

we are also seeing this happen randomly among multibranch pipeline builds as well. For branches where we make use of the build history, it can be extremely frustrating to restore/recover.

jpschewe@mtu.net (JIRA)

unread,
Jun 7, 2019, 6:19:03 AM6/7/19
to jenkinsc...@googlegroups.com
jpschewe commented on Bug JENKINS-55388

I found a clue. I've been capturing the git index log and found a message in the log just before the the branch was rebuilt.

[Mon Jun 03 10:39:07 EDT 2019] Finished branch indexing. Indexing took 7.5 sec
Evaluating orphaned items in FLL-SW
Will remove current-release as it is too old
Finished: SUCCESS
 

 

What is this message about the branch being too old? I want the branch jobs to stay around forever, unless the branch is deleted.

 

jpschewe@mtu.net (JIRA)

unread,
Jun 7, 2019, 7:02:02 AM6/7/19
to jenkinsc...@googlegroups.com
jpschewe commented on Bug JENKINS-55388

I'm using the github plugin for the source. For the others seeing this issue are you also using the github plugin for the source?

jpschewe@mtu.net (JIRA)

unread,
Jun 7, 2019, 7:17:02 AM6/7/19
to jenkinsc...@googlegroups.com
jpschewe commented on Bug JENKINS-55388

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.

 

sudheermg@yahoo.com (JIRA)

unread,
Jul 18, 2019, 4:01:03 PM7/18/19
to jenkinsc...@googlegroups.com

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

sudheermg@yahoo.com (JIRA)

unread,
Jul 18, 2019, 4:07:02 PM7/18/19
to jenkinsc...@googlegroups.com
Sudheer Gundanna edited a comment on Bug JENKINS-55388
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

suganyaravi@hotmail.com (JIRA)

unread,
Jul 22, 2019, 7:50:02 PM7/22/19
to jenkinsc...@googlegroups.com

roman@pickl.eu (JIRA)

unread,
Jan 2, 2020, 3:46:04 AM1/2/20
to jenkinsc...@googlegroups.com

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.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

morgan@resapphealth.com.au (JIRA)

unread,
Feb 3, 2020, 7:41:04 PM2/3/20
to jenkinsc...@googlegroups.com

morgan@resapphealth.com.au (JIRA)

unread,
Apr 22, 2020, 6:27:03 PM4/22/20
to jenkinsc...@googlegroups.com

Do we all have the 'Discard old items' item enabled in Jenkins?  I have a suspicion that what's happening is that GitHub or Bitbucket or whatever git service we use occasionally fails to properly respond to the Jenkins poll request and then Jenkins removes the branch due to the 'Discard old items' option.  I'm going to try disabling this.

If so, two potential fixes:

  • Allow certain branches to be excepted from the 'Discard old items' job.
  • Make every Bitbucket / GitHub / etc. reliably respond to requests (hah).
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages