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

Shared libraries stopped loading with git tags. They only now work when I reference a git branch name

      I have a shared library in my Jenkins server that I call "common-pipelines". From within my Jenkinsfile, I will call for a specific tagged version of the common-pipelines shared library to be loaded like this:

      @Library('common-pipelines@v9.4.4') _ 

      I was just alerted that the pipelines are erroring with the following message:

      Please make sure you have the correct access rights
      and the repository exists. 

      However, we aren't sure what changed. After much sanity checking, I was able to determine that this works normally if I call for a branch name rather than a github release (git tag).

      In other words, this works just fine:

       @Library('common-pipelines@myBranchName') _ 

      I am running the latest plugins.

          [JENKINS-52678] Shared libraries stopped loading with git tags. They only now work when I reference a git branch name

          Jon B created issue -

          Jon B added a comment -

          Update: I have been able to determine that this problem emerges when I upgrade from Jenkins 2.130 to Jenkins 2.133

          Jon B added a comment - Update: I have been able to determine that this problem emerges when I upgrade from Jenkins 2.130 to Jenkins 2.133

          Jon B added a comment -

          Confirming that when we downgrade to 2.130, the original working behavior is restored.

          Jon B added a comment - Confirming that when we downgrade to 2.130, the original working behavior is restored.

          Mark Waite added a comment -

          Did plugin versions change when you downgraded to 2.130 or when you upgraded to 2.133? In general, I would not expect a change of Jenkins version number to alter the specific behavior of the Pipeline code which loads library versions by tag or by branch name.

          There was a change in Git plugin 3.9.0 to restore the ability to load Pipeline shared libraries by SHA-1 in addition to loading them by branch name or tag.

          Mark Waite added a comment - Did plugin versions change when you downgraded to 2.130 or when you upgraded to 2.133? In general, I would not expect a change of Jenkins version number to alter the specific behavior of the Pipeline code which loads library versions by tag or by branch name. There was a change in Git plugin 3.9.0 to restore the ability to load Pipeline shared libraries by SHA-1 in addition to loading them by branch name or tag.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Jon B made changes -
          Description Original: I have a shared library in my Jenkins server that I call "common-pipelines". From within my Jenkinsfile, I will call for a specific version of the common-pipelines shared library to be loaded like this:
          {code:java}
          @Library('common-pipelines@v9.4.4') _ {code}
          I was just alerted that the pipelines are erroring with the following message:
          {code:java}
          Please make sure you have the correct access rights
          and the repository exists. {code}
          However, we aren't sure what changed. After much sanity checking, I was able to determine that this works normally if I call for a branch name rather than a github release (git tag).

          In other words, this works just fine:
          {code:java}
           @Library('common-pipelines@myBranchName') _ {code}
          I am running the latest plugins.
          New: I have a shared library in my Jenkins server that I call "common-pipelines". From within my Jenkinsfile, I will call for a specific *_tagged_* version of the common-pipelines shared library to be loaded like this:
          {code:java}
          @Library('common-pipelines@v9.4.4') _ {code}
          I was just alerted that the pipelines are erroring with the following message:
          {code:java}
          Please make sure you have the correct access rights
          and the repository exists. {code}
          However, we aren't sure what changed. After much sanity checking, I was able to determine that this works normally if I call for a branch name rather than a github release (git tag).

          In other words, this works just fine:
          {code:java}
           @Library('common-pipelines@myBranchName') _ {code}
          I am running the latest plugins.

          Jon B added a comment - - edited

          markewaite I am now running "Git plugin 3.9.0" with Jenkins 2.130 and things are working just fine. All of the evidence IMO suggests this breaks as a result of the upgrade to the newer jenkins core.

          Jon B added a comment - - edited markewaite I am now running "Git plugin 3.9.0" with Jenkins 2.130 and things are working just fine. All of the evidence IMO suggests this breaks as a result of the upgrade to the newer jenkins core.
          Mark Waite made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: git-plugin [ 15543 ]
          Jon B made changes -
          Summary Original: Shared libraries stopped loading with git tags. The only now work when I reference a git branch name New: Shared libraries stopped loading with git tags. They only now work when I reference a git branch name
          Oleg Nenashev made changes -
          Component/s New: workflow-cps-global-lib-plugin [ 21714 ]
          Component/s Original: core [ 15593 ]

            Unassigned Unassigned
            piratejohnny Jon B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: