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

Ancestry Maximum Age strategy causing "Couldn't find any revision to build"


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None
    • Ubuntu 20.04.4 LTS
      Jenkins 2.346.1
      openjdk version "1.8.0_312"
      OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)
      OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)

      I have several jobs that specify Strategy for choosing what to build / Ancestry / Maximum Age of Commit. This is to prevent old heads unnecessarily building or dangerously deploying.

      Since a recent upgrade to Jenkins and/or the git plugin, jobs that have this config are refusing to rebuild any commit that has already built, irrespective of the age of commit.

      For example, a job that run on a daily basis (it is date-dependent and should start failing when some data is out-of-date), will build a given commit once, but will start failing on subsequent days with a log similar to below:


      Building in workspace /var/lib/jenkins/workspace/XXX
      The recommended git tool is: NONE
      using credential XXX
       > git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/XXX/.git # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url XXX.git # timeout=10
      Fetching upstream changes from XXX.git
       > git --version # timeout=10
       > git --version # 'git version 2.37.0'
      using GIT_SSH to set credentials 
       > git fetch --tags --force --progress -- XXX.git +refs/heads/*:refs/remotes/origin/* # timeout=10
      Seen branch in repository origin/HEAD
      Seen branch in repository origin/master
      Seen branch in repository origin/v10
      Seen 3 remote branches
       > git show-ref --tags -d # timeout=10
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      Finished: FAILURE 


      Branch specifier in this example is set to **

      Another case uses refs/tags/release.*

      What I've tried:

      • Recreating the job — same outcome
      • Removing the git strategy — works as expected but liable to start building everything (e.g. every tag) so not a good strategy
      • Commit in ancestry — same outcome
      • Deleting the previous build for the commit — will rebuild, but only good as a manual intervention
      • Deleting the workspace — same outcome



      • In one job I only need to run the regular rebuild on master, so created a duplicate job that specifies master (allowing me to delete the Max Age strategy)
      • Another job that matches by tag, I can manually delete previous build information if I need to rebuild from the same commit. Removing the Max Age strategy isn't possible because old release tags would start deploying to production :-o


      Could be related to https://issues.jenkins.io/browse/JENKINS-43220

            Unassigned Unassigned
            idacrobert Robert Churchill
            0 Vote for this issue
            2 Start watching this issue