We are running different Multibranch Pipelines with git (Bitbucket) since almost 2 years now.

      Unfortunately jobs (aka branches) do disappear randomly. It feels like the the number of losses is increasing and our workaround (see first comment) is too complicated to keep up.

      Even worse it looks like develop and master are the most likely to disappear.

      We are not sure what causes the losses. It feels pretty randomly.

      The Scan Multibranch Pipeline Log says Detected unsupported subitem:

      [Mon Dec 17 10:28:18 CET 2018] Starting branch indexing...

      Connecting to https://bitbucket.org using *****

      Repository type: Git

      Looking up sj/sj-mobile-ios for pull requests

       

        0 pull requests were processed

      Connecting to https://bitbucket.org using ******

      Repository type: Git

      Looking up sj/sj-mobile-ios for branches

      Checking branch develop from sj/sj-mobile-ios

            'Jenkinsfile' found

          Met criteria

      Detected unsupported subitem sj-mobile-ios » develop, skipping

      Checking branch master from sj/sj-mobile-ios

            'Jenkinsfile' found

          Met criteria

      Detected unsupported subitem sj-mobile-ios » master, skipping

      Checking branch stash/iapPromotion from sj/sj-mobile-ios

            'Jenkinsfile' not found

          Skipped

       

        3 branches were processed

      Looking up sj/sj-mobile-ios for pull requests

       

        0 pull requests were processed

      [Mon Dec 17 10:28:21 CET 2018] Finished branch indexing. Indexing took 3.4 sec

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@65a9d08a[sj-ios/ffffeeeea.j2i0s0od1eao.innnntttt], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@4f2f2fc0[sj-ios/rrrreeeel.vled0mqc8i7t.2----3333], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@72d388bb[sj-ios/rrrreeeel.r1m7pv7ujr6o.5----1111], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@29a3274d[sj-ios/rrrreeeel.tgai4liiqai5.3----1111], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@63eb56a6[sj-ios/ffffeeeea.fqa397lnq84t.aggggyyyy], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@2548a24e[sj-ios/rrrreeeel.0d0a3oaeksil.5----2222], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@52e05031[sj-ios/PR-130], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@69b325d6[sj-ios/rrrreeeel.2s6jniopvdin.1----7777], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@1ffba7d3[sj-ios/rrrreeeel.c8v76qkpj7f5.1----4444], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@1c6e3ff6[sj-ios/rrrreeeel.tndhtl2k8ai1.1----6666], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@734db299[sj-ios/rrrreeeel.9dgfoipjl376.2----2222], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@f3b27ec[sj-ios/PR-129], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@22f40536[sj-ios/rrrreeeel.i2j4g40joneo.1----5555], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@2928d02b[sj-ios/ffffeeeea.i5k5i2srbpsp.nkkkkssss], skipping

      Detected unsupported subitem org.jenkinsci.plugins.workflow.job.WorkflowJob@5795381d[sj-ios/rrrreeeel.akouhq90ivkl.1----3333], skipping

      Finished: SUCCESS

       

      You can still see the job if you navigate to /project/job/develop/ but its not working anymore. Somehow the config.xml gets reseted to

      <?xml version='1.1' encoding='UTF-8'?>
      <flow-definition plugin="workflow-job@2.30">
      <actions/>
      <keepDependencies>false</keepDependencies>
      <properties/>
      <triggers/>
      <disabled>false</disabled>
      </flow-definition>

       

      We are thankful for your help.

       

       

      We are running Jenkins on AWS Bitnami Installation on Apache Tomcat Version 8.0.47

      See also screenshots of Project Configuration and Bitbuckets Webhooks.

      OS: 

      os.name Linux
      os.version 4.9.0-5-amd64

      VM:

      java.vendor Oracle Corporation
      java.vendor.url http://java.oracle.com/
      java.vendor.url.bug http://bugreport.sun.com/bugreport/
      java.version 1.8.0_151
      java.vm.info mixed mode
      java.vm.name Java HotSpot(TM) 64-Bit Server VM
      java.vm.specification.name Java Virtual Machine Specification
      java.vm.specification.vendor Oracle Corporation
      java.vm.specification.version 1.8
      java.vm.vendor Oracle Corporation
      java.vm.version 25.151-b12

       

      Installed Plugins:

      ace-editor 1.1 true
      amazon-ecr 1.6 true
      amazon-ecs 1.18 true
      analysis-core 1.95 true
      ansicolor 0.5.3 true
      ant 1.9 true
      antisamy-markup-formatter 1.5 true
      apache-httpcomponents-client-4-api 4.5.5-3.0 true
      authentication-tokens 1.3 true
      aws-credentials 1.24 true
      aws-java-sdk 1.11.457 true
      bitbucket 1.1.8 true
      bitbucket-build-status-notifier 1.4.1 true
      bitbucket-scm-trait-commit-skip 0.1.1 true
      bouncycastle-api 2.17 true
      branch-api 2.1.2 true
      build-monitor-plugin 1.12+build.201809061734 true
      build-timeout 1.19 true
      checkstyle 3.50 true
      cloudbees-bitbucket-branch-source 2.2.15 true
      cloudbees-folder 6.7 true
      cobertura 1.13 true
      code-coverage-api 1.0.5 true
      command-launcher 1.2 true
      copyartifact 1.41 true
      credentials 2.1.18 true
      credentials-binding 1.17 true
      display-url-api 2.3.0 true
      docker-build-publish 1.3.2 true
      docker-commons 1.13 true
      docker-workflow 1.17 true
      dry 2.50 true
      durable-task 1.28 true
      email-ext 2.63 true
      external-monitor-job 1.7 true
      git 3.9.1 true
      git-client 2.7.4 true
      git-parameter 0.9.6 true
      git-server 1.7 true
      github 1.29.3 true
      github-api 1.95 true
      github-branch-source 2.4.1 true
      github-organization-folder 1.6 true
      gradle 1.29 true
      handlebars 1.1.1 true
      handy-uri-templates-2-api 2.1.6-1.0 true
      icon-shim 2.0.3 true
      jackson2-api 2.9.7.1 true
      javadoc 1.4 true
      jdk-tool 1.2 true
      jquery 1.12.4-0 true
      jquery-detached 1.2.1 true
      jsch 0.1.54.2 true
      junit 1.26.1 true
      ldap 1.20 true
      locale 1.4 true
      lockable-resources 2.3 true
      log-parser 2.0 true
      mailer 1.22 true
      mapdb-api 1.0.9.0 true
      matrix-auth 2.3 true
      matrix-project 1.13 true
      maven-plugin 3.2 true
      mercurial 2.4 true
      momentjs 1.1.1 true
      multiple-scms 0.6 true
      notification 1.13 true
      pam-auth 1.4 true
      pipeline-aws 1.35 true
      pipeline-build-step 2.7 true
      pipeline-github-lib 1.0 true
      pipeline-graph-analysis 1.9 true
      pipeline-input-step 2.8 true
      pipeline-milestone-step 1.3.1 true
      pipeline-model-api 1.3.3 true
      pipeline-model-declarative-agent 1.1.1 true
      pipeline-model-definition 1.3.3 true
      pipeline-model-extensions 1.3.3 true
      pipeline-rest-api 2.10 true
      pipeline-stage-step 2.3 true
      pipeline-stage-tags-metadata 1.3.3 true
      pipeline-stage-view 2.10 true
      pipeline-utility-steps 2.2.0 true
      plain-credentials 1.4 true
      pmd 3.50 true
      pyenv-pipeline 2.0.1 true
      resource-disposer 0.12 true
      s3 0.11.2 true
      scm-api 2.3.0 true
      script-security 1.49 true
      sloccount 1.24 true
      ssh-agent 1.17 true
      ssh-credentials 1.14 true
      ssh-slaves 1.29.1 true
      structs 1.17 true
      subversion 2.12.1 true
      timestamper 1.8.10 true
      token-macro 2.5 true
      trilead-api 1.0.1 true
      warnings 4.68 true
      windows-slaves 1.3.1 true
      workflow-aggregator 2.6 true
      workflow-api 2.33 true
      workflow-basic-steps 2.13 true
      workflow-cps 2.61 true
      workflow-cps-global-lib 2.12 true
      workflow-durable-task-step 2.26 true
      workflow-job 2.30 true
      workflow-multibranch 2.20 true
      workflow-scm-step 2.7 true
      workflow-step-api 2.17 true
      workflow-support 2.23 true
      ws-cleanup 0.36 true

          [JENKINS-55220] Multibranch Pipeline jobs get randomly lost

          Jonas Büth added a comment -

          Our workaround for this:

          1. shutdown jenkins
          2. copy job config.xml from working branch to missing branch
          3. rename branch in copied config.xml
          4. start jenkins

          Jonas Büth added a comment - Our workaround for this: shutdown jenkins copy job config.xml from working branch to missing branch rename branch in copied config.xml start jenkins

          Vivek Pandey added a comment -

          cornr Possibly same issue as in https://issues.jenkins-ci.org/browse/JENKINS-55068? PR https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/159 has been merged but not yet released in bitbucket-branch-source plugin.

          Vivek Pandey added a comment - cornr Possibly same issue as in https://issues.jenkins-ci.org/browse/JENKINS-55068? PR https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/159 has been merged but not yet released in bitbucket-branch-source plugin.

          potential fix should be available in 2.2.16.
          Should appear in the update center in a few hours.

          Joseph Petersen (old) added a comment - potential fix should be available in 2.2.16. Should appear in the update center in a few hours.

          Jonas Büth added a comment -

          Thank you so much!

          Jonas Büth added a comment - Thank you so much!

          Vivek Pandey added a comment -

          cornr Please confirm using bitbucket-branch-source 2.2.16 fixes this issue.

          Vivek Pandey added a comment - cornr Please confirm using bitbucket-branch-source 2.2.16 fixes this issue.

          Jonas Büth added a comment -

          vivek I have installed the update but can only confirm the fix after a while when no more loses appear.

          Jonas Büth added a comment - vivek I have installed the update but can only confirm the fix after a while when no more loses appear.

          Jonas Büth added a comment -

          vivek unfortunately I must say our issue is not fixed. After the holidays I saw develop and master branch disappearing. When I scan the logs I saw Unotherized Access when Jenkins connected to Bitbucket. I fixed this by login as our jenkins user on bitbucket. But the missing branch configurations are still damaged.

          Maybe there is another case like https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/159

          Jonas Büth added a comment - vivek unfortunately I must say our issue is not fixed. After the holidays I saw develop and master branch disappearing. When I scan the logs I saw Unotherized Access when Jenkins connected to Bitbucket. I fixed this by login as our jenkins user on bitbucket. But the missing branch configurations are still damaged. Maybe there is another case like https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/159

          Jonas Büth added a comment -

          We keep losing Branches [sigh].

          Also we see spanning folders within the branches folder.

          For example:

           

          drwxr-xr-x  2 tomcat tomcat 4096 Jan 16 03:51 ffffeeeea.5nf2j28q5cs3.orrrrtttt
          drwxr-xr-x  2 tomcat tomcat 4096 Jan 16 04:00 ffffeeeea-5n.v9hmtv.s3-orrrrtttt
          

          These folders contain both a nextBuildNumber and a config.xml which looks like this:

          <?xml version='1.1' encoding='UTF-8'?>
          <flow-definition plugin="workflow-job@2.31">
            <actions/>
            <displayName>feature/credential_management_api_support</displayName>
            <keepDependencies>false</keepDependencies>
            <properties/>
            <triggers/>
            <disabled>false</disabled>
          </flow-definition>
          

           

          Unfortunately this folders are only created for the branches which do not disappear.

           

          Jonas Büth added a comment - We keep losing Branches  [sigh] . Also we see spanning folders within the branches folder. For example:   drwxr-xr-x  2 tomcat tomcat 4096 Jan 16 03:51 ffffeeeea.5nf2j28q5cs3.orrrrtttt drwxr-xr-x  2 tomcat tomcat 4096 Jan 16 04:00 ffffeeeea-5n.v9hmtv.s3-orrrrtttt These folders contain both a nextBuildNumber and a config.xml which looks like this: <?xml version= '1.1' encoding= 'UTF-8' ?> <flow-definition plugin= "workflow-job@2.31" >   <actions/>   <displayName>feature/credential_management_api_support</displayName>   <keepDependencies> false </keepDependencies>   <properties/>   <triggers/>   <disabled> false </disabled> </flow-definition>   Unfortunately this folders are only created for the branches which do not disappear.  

          cornr I suggest you dedicate time to debug the issue, I am only a maintainer of the plugin, I do not work with Bitbucket directly anymore so it requires more time than I can afford to debug issues. I rely on the community to solve any issues they might experience.

          If you need guidance on how to get started, please ask away. I suggest you look here: https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial 

          Joseph Petersen (old) added a comment - cornr I suggest you dedicate time to debug the issue, I am only a maintainer of the plugin, I do not work with Bitbucket directly anymore so it requires more time than I can afford to debug issues. I rely on the community to solve any issues they might experience. If you need guidance on how to get started, please ask away. I suggest you look here: https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial  

          rsandell added a comment - - edited

          Do you see any warnings in the system log relating to JEP-200 ?

          When you say that the config.xml gets reset to the "empty" example have you verified that the once before had more in them and then got reset to the "empty" state or perhaps have they always been like that since creation?

          rsandell added a comment - - edited Do you see any warnings in the system log relating to JEP-200 ? When you say that the config.xml gets reset to the "empty" example have you verified that the once before had more in them and then got reset to the "empty" state or perhaps have they always been like that since creation?

          Eric Maras added a comment -

          I am experiencing issues as well. I have been able to reproduce this. Every time I change a multibranch config file all of my branch pipelines seem to disappear. This was not happening every time before but now it is consistently happening. Deleting a lot of branches in Bitbucket seems to cause this issue for me as well. 

          Eric Maras added a comment - I am experiencing issues as well. I have been able to reproduce this. Every time I change a multibranch config file all of my branch pipelines seem to disappear. This was not happening every time before but now it is consistently happening. Deleting a lot of branches in Bitbucket seems to cause this issue for me as well. 

          Eric Maras added a comment -

          I think I may have found the issue. I am not sure why my browser auto-fill thought the "Marker File" field is a username field, but it has been putting my username in that field every time I edited a configuration file. I am thinking this may be the case for others as well and could be an issue. How this was causing all branch pipelines to disappear for me I still do not understand. This issue could be different from the one this ticket is meant to address. Apologies if that is the case.

          Eric Maras added a comment - I think I may have found the issue. I am not sure why my browser auto-fill thought the "Marker File" field is a username field, but it has been putting my username in that field every time I edited a configuration file. I am thinking this may be the case for others as well and could be an issue. How this was causing all branch pipelines to disappear for me I still do not understand. This issue could be different from the one this ticket is meant to address. Apologies if that is the case.

          I see this happening with github as well, so not just related to bitbucket.

          Could be indeed related to unauthorized user and then the branches get cleaned.

          Matthieu Brucher added a comment - I see this happening with github as well, so not just related to bitbucket. Could be indeed related to unauthorized user and then the branches get cleaned.

          Jonas Büth added a comment -

          I think we might found an answer (or problem causer). In our case we automatically restarted Jenkins once a day in either in the shut down or boot up process branches went missing.
          The amount of missing branches declined significantly after keeping the Jenkins running all the time.

          Jonas Büth added a comment - I think we might found an answer (or problem causer). In our case we automatically restarted Jenkins once a day in either in the shut down or boot up process branches went missing. The amount of missing branches declined significantly after keeping the Jenkins running all the time.

          Nuno Costa added a comment - - edited

          This is happening to me today, although is not showing any errors. The Scan log shows that is not detecting jenkinsfile on a specific branch but the file is there. Other branches with jenkinsfile are been shown in the log.

          I had this happening a few weeks ago and without any change from our part, it reenabled the branch.

          We are using bitbucket.org Team.

          Using jenkins 2.164.2 and nginx, both as containers.

          UPDATE: My issue was that the project was configured in a way that when a PR was opened, the branch just "disappeared" from the UI. After the PR merge, the branch would "reappear".

          Review your project configurations in Jenkins and check the behaviour when PR's are present.

          Nuno Costa added a comment - - edited This is happening to me today, although is not showing any errors. The Scan log shows that is not detecting jenkinsfile on a specific branch but the file is there. Other branches with jenkinsfile are been shown in the log. I had this happening a few weeks ago and without any change from our part, it reenabled the branch. We are using bitbucket.org Team. Using jenkins 2.164.2 and nginx, both as containers. UPDATE: My issue was that the project was configured in a way that when a PR was opened, the branch just "disappeared" from the UI. After the PR merge, the branch would "reappear". Review your project configurations in Jenkins and check the behaviour when PR's are present.

          We see this with GitHub, multi-branch pipelines & Jenkins version 2.193.  Happy to provide any further details to assist in narrowing it down.

          Morgan Robertson added a comment - We see this with GitHub, multi-branch pipelines & Jenkins version 2.193.  Happy to provide any further details to assist in narrowing it down.

          We are encountering something very similar, however we haven't had our jobs disappear [yet?]. What we have seen are runs that fail early on because they are trying to serialize to an invalid folder, one that's different from the folder used by other runs of the same branch. It looks like we might both be encountering a related defect, because I noticed that our branch name was occasionally getting "extra mangled", similar to an instance found in this issue:

          feature/credential_management_api_support -> ffffeeeea-5n.v9hmtv.s3-orrrrtttt

          ...whereas our branch name went from rwu/DO-5104_extract-run-tests-job to rrwwuu_25.6kcpi1bhuh8u.s-jjoobb (which doesn't exist as a folder, causing a "FileNotFoundException"), instead of the usual rwu-DO-5104.qemgq5.un-tests-job, which exists as a folder.

          Notice the similarities: in both our case and the reporter's the branch name's letters are repeated. (the "fea" part of "feature" became "ffffeeeea" and the "rwu" part became "rrwwuu")

          Both the mangled and "extra-mangled" names can be explained by the NameMangler class, sort of: I haven't figured out in what cases the NameMangler class gets a value with repeated letters, yet. It seems to hinge on different instances of WorkflowRun getting different values when calling WorkflowRun#getRootDir(); I'll keep digging.

          Olivier Dagenais added a comment - We are encountering something very similar, however we haven't had our jobs disappear [yet?]. What we have seen are runs that fail early on because they are trying to serialize to an invalid folder, one that's different from the folder used by other runs of the same branch. It looks like we might both be encountering a related defect, because I noticed that our branch name was occasionally getting "extra mangled", similar to an instance found in this issue: feature/credential_management_api_support -> ffffeeeea-5n.v9hmtv.s3-orrrrtttt ...whereas our branch name went from rwu/DO-5104_extract-run-tests-job to rrwwuu_25.6kcpi1bhuh8u.s- jjoobb (which doesn't exist as a folder, causing a "FileNotFoundException"), instead of the usual rwu-DO-5104 .qemgq5.un-tests-job , which exists as a folder. Notice the similarities: in both our case and the reporter's the branch name's letters are repeated. (the "fea" part of "feature" became "ffffeeeea" and the "rwu" part became "rrwwuu") Both the mangled and "extra-mangled" names can be explained by the NameMangler class, sort of: I haven't figured out in what cases the NameMangler class gets a value with repeated letters, yet. It seems to hinge on different instances of WorkflowRun getting different values when calling WorkflowRun#getRootDir() ; I'll keep digging.

          Dave Nichols added a comment - - edited

          Also having this issue with Gitlab, multibranch pipelines, and Jenkins 2.150.2.

          Jenkins is running as a container with nginx.

           

          Also not 100% on this but I don't think all of the branches disappeared, only a subset disappeared and I can't find a reason why only those.

          Dave Nichols added a comment - - edited Also having this issue with Gitlab, multibranch pipelines, and Jenkins 2.150.2. Jenkins is running as a container with nginx.   Also not 100% on this but I don't think all of the branches disappeared, only a subset disappeared and I can't find a reason why only those.

          Jeremy Page added a comment - - edited

          We have branches disappear when there is a PR pending for them using Github.

          Sorry for the confusion, I did not know how to configure the job properly. Thank you morganr87

          Jeremy Page added a comment - - edited We have branches disappear when there is a PR pending for them using Github. Sorry for the confusion, I did not know how to configure the job properly. Thank you morganr87

          jeremyinnc, Are you sure that's just not what you have the 'Discover Branches' option set to on your multi-branch job config?  Make sure it's not on 'Exclude branches that are also filed as PRs' (I think it's the default).

          Morgan Robertson added a comment - jeremyinnc , Are you sure that's just not what you have the 'Discover Branches' option set to on your multi-branch job config?  Make sure it's not on 'Exclude branches that are also filed as PRs' (I think it's the default).

          Can everyone that is impacted by this click the 'Vote for this issue' button so this gets attention? Thanks.

          Morgan Robertson added a comment - Can everyone that is impacted by this click the ' Vote for this issue ' button so this gets attention? Thanks.

          dpn982

          We are having random branches disappearance in our Jenkins too (Jenkins ver. 2.190.3 standalone on CentOS machine).

          This is screenshot from Scan GitLab Project Log:

          But we have master branch and Jenkinsfile there. I don't know why Jenkins counting this branch as orphaned and don't see anything in logs and in Multibranch pipeline events section.

           

          Konstantin Grammatikati added a comment - dpn982 We are having random branches disappearance in our Jenkins too (Jenkins ver. 2.190.3 standalone on CentOS machine). This is screenshot from  Scan GitLab Project Log : But we have master branch and Jenkinsfile there. I don't know why Jenkins counting this branch as orphaned and don't see anything in logs and in Multibranch pipeline events section.  

          Josh Watson added a comment - - edited

          Also getting this with Jenkins running on Centos 7, using nginx as a proxy. The jobs are triggered from other multi-branch pipelines (from subversion (still using it in 2019!) ) and I'm seeing mangled branches being created, for example branches/4.0 mutates from branches-4-0.v5ktnf to bbrraanncchh.lphb61._252-F44–00

          A workaround for this case (reusable job) is to remove the mangled branch after it fails and link it back to the correct branch. The job then works. I haven't restarted Jenkins since doing this

          Josh Watson added a comment - - edited Also getting this with Jenkins running on Centos 7, using nginx as a proxy. The jobs are triggered from other multi-branch pipelines (from subversion (still using it in 2019!) ) and I'm seeing mangled branches being created, for example branches/4.0 mutates from branches-4-0.v5ktnf to bbrraanncchh.lphb61._252-F44–00 A workaround for this case (reusable job) is to remove the mangled branch after it fails and link it back to the correct branch. The job then works. I haven't restarted Jenkins since doing this

          Morgan Robertson added a comment - - edited

          Morgan Robertson added a comment - - edited The following are issues that I believe are duplicates or are related to this: https://issues.jenkins-ci.org/browse/JENKINS-55388 https://issues.jenkins-ci.org/browse/JENKINS-57848 https://issues.jenkins-ci.org/browse/JENKINS-57398 https://issues.jenkins-ci.org/browse/JENKINS-57381

          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).

          Morgan Robertson added a comment - 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).

          Malte Onnen added a comment -

          We're having this issue with Jenkins 2.222.3, Branch API 2.5.6 working with RhodeCode (hosted internally). It seems to happen more often on Jobs that are not really active in development, but resetting a master-branch seems to always be a bad idea.

          Malte Onnen added a comment - We're having this issue with Jenkins 2.222.3, Branch API 2.5.6 working with RhodeCode (hosted internally). It seems to happen more often on Jobs that are not really active in development, but resetting a master-branch seems to always be a bad idea.

          Just happened to me today, I like morganr87's proposal, but I think it would be even better to have a different retention policy for specific branches.

          E.g.:
          Default retention policy: <what we have now>

          Additional retention policy for branch <enter a name>: <additional retention policy>

          Marcello Romani added a comment - Just happened to me today, I like morganr87 's proposal, but I think it would be even better to have a different retention policy for specific branches. E.g.: Default retention policy: <what we have now> Additional retention policy for branch <enter a name>: <additional retention policy>

          Any update on this issue?  Anyone working on it or have any workarounds?

          We are using Github Enterprise 3.3.1 on-prem and using the github-branch-source plugin to manage the creation of Jenkins pipeline jobs.

          It seems anytime our Github Enterprise server is down due to maintenance or problems, we end up with a small percentage of missing branch jobs, deleted build history and reset build numbers.

          All because it was unable to find the Jenkinsfile when the Organization Scan runs while Github down for maintenance or having issues.  We have Organization Scans set to run once per day and the logs indicated that it had run during the maintenance window

           

          Jenkins version:  2.319.2
          github-branch-source: 2.11.4
          github-api: 1.301-378.v9807bd746da5    
          branch-api: 2.7.0

          John Lengeling added a comment - Any update on this issue?  Anyone working on it or have any workarounds? We are using Github Enterprise 3.3.1 on-prem and using the github-branch-source plugin to manage the creation of Jenkins pipeline jobs. It seems anytime our Github Enterprise server is down due to maintenance or problems, we end up with a small percentage of missing branch jobs, deleted build history and reset build numbers. All because it was unable to find the Jenkinsfile when the Organization Scan runs while Github down for maintenance or having issues.  We have Organization Scans set to run once per day and the logs indicated that it had run during the maintenance window   Jenkins version:  2.319.2 github-branch-source: 2.11.4 github-api: 1.301-378.v9807bd746da5     branch-api: 2.7.0

          Nikolas Falco added a comment - - edited

          Is this bug still present in the latest plugin version?

           

          It's not clear why there are post also from other branch source plugin

          Nikolas Falco added a comment - - edited Is this bug still present in the latest plugin version?   It's not clear why there are post also from other branch source plugin

            nfalco Nikolas Falco
            cornr Jonas Büth
            Votes:
            24 Vote for this issue
            Watchers:
            33 Start watching this issue

              Created:
              Updated: