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

Deleting & remaking a tag makes Jenkins stop building the tag forever with GitHub Branch Source

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major

      Issue:
       
      When I click Jenkins reports a tag that exists as "Not Found" and failing the build with this message:
       
      12:52:41 Branch indexing
      19:52:41 [2019-06-24T19:52:41.964Z] Connecting to https://api.github.com using dev-rafabuildadmin/****** (github dev-rafabuildadmin user (required to publish build/deploy status))
      12:52:42 java.io.FileNotFoundException: https://api.github.com/repos/rafastealth/ios-patient-client/git/refs/tags/0.0.4
      12:52:42     at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
      12:52:42     at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
      12:52:42     at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
      12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:625)
      12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:607)
      12:52:42     at org.kohsuke.github.Requester._to(Requester.java:285)
      12:52:42 Caused: org.kohsuke.github.GHFileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3/git/refs/#get-a-reference"}
      12:52:42     at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
      12:52:42     at org.kohsuke.github.Requester._to(Requester.java:306)
      12:52:42     at org.kohsuke.github.Requester.to(Requester.java:247)
      12:52:42     at org.kohsuke.github.GHRepository.getRef(GHRepository.java:891)
      12:52:42     at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1521)
      12:52:42     at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
      12:52:42     at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:98)
      12:52:42     at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
      12:52:42     at hudson.model.ResourceController.execute(ResourceController.java:97)
      12:52:42    at hudson.model.Executor.run(Executor.java:429)
      12:52:42 Finished: FAILURE
       
      See "github_tag.png" for proof the tag does indeed exist. I've tried re-indexing, but the issue never resolves.
       
      Repro Steps:
       

      • Set up tags to build with your repo (see tag_setup.png)
      • Create a tag (say, 0.0.4) in your git repo and push it up to origin. This will cause it to auto build.
      • In git, delete the tag and push that deletion up to Github. 
      • In Jenkins, in the job made by the tag, click "Build Now" - It should fail to find the tag
      • In git, tag a new commit with the same tag name (0.0.4) as above and push it up to Github.
      • In Jenkins, in the job made by the tag, click "Build Now" - Note that Jenkins still can't find the tag even though it exists.
         
         

        1. plugin_installed.png
          plugin_installed.png
          62 kB
        2. error_message.png
          error_message.png
          449 kB
        3. tag_setup.png
          tag_setup.png
          49 kB
        4. github_tag.png
          github_tag.png
          31 kB

          [JENKINS-58172] Deleting & remaking a tag makes Jenkins stop building the tag forever with GitHub Branch Source

          Ethan Diamond created issue -
          Ethan Diamond made changes -
          Description Original: *Issue:*
           
          When I click Jenkins reports a tag that exists as "Not Found" and failing the build with this message:
           
          12:52:41 Branch indexing
          19:52:41 [2019-06-24T19:52:41.964Z] Connecting to https://api.github.com using dev-rafabuildadmin/****** (github dev-rafabuildadmin user (required to publish build/deploy status))
          12:52:42 java.io.FileNotFoundException: https://api.github.com/repos/rafastealth/ios-patient-client/git/refs/tags/0.0.4
          12:52:42     at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
          12:52:42     at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
          12:52:42     at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
          12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:625)
          12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:607)
          12:52:42     at org.kohsuke.github.Requester._to(Requester.java:285)
          12:52:42 Caused: org.kohsuke.github.GHFileNotFoundException: \{"message":"Not Found","documentation_url":"https://developer.github.com/v3/git/refs/#get-a-reference"}
          12:52:42     at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
          12:52:42     at org.kohsuke.github.Requester._to(Requester.java:306)
          12:52:42     at org.kohsuke.github.Requester.to(Requester.java:247)
          12:52:42     at org.kohsuke.github.GHRepository.getRef(GHRepository.java:891)
          12:52:42     at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1521)
          12:52:42     at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
          12:52:42     at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:98)
          12:52:42     at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
          12:52:42     at hudson.model.ResourceController.execute(ResourceController.java:97)
          12:52:42    at hudson.model.Executor.run(Executor.java:429)
          12:52:42 Finished: FAILURE
           
          See "github_tag.png" for proof the tag does indeed exist. I've tried re-indexing, but the issue never resolves.
           
          *Repro Steps:*
           
          - Set up tags to build with your repo (see tag_setup.png)
          - Create a tag (say, 0.0.4) in your git repo and push it up to origin. This will cause it to auto build.
          - In git, delete the tag and push that deletion up to Github.
          - In git, tag a new commit with the same tag name (0.0.4) as above and push it up to Github.
          - In Jenkins, in the job made by the tag, click "Build Now"
           
           
          New: *Issue:*
            
           When I click Jenkins reports a tag that exists as "Not Found" and failing the build with this message:
            
           12:52:41 Branch indexing
           19:52:41 [2019-06-24T19:52:41.964Z] Connecting to [https://api.github.com|https://api.github.com/] using dev-rafabuildadmin/****** (github dev-rafabuildadmin user (required to publish build/deploy status))
           12:52:42 java.io.FileNotFoundException: [https://api.github.com/repos/rafastealth/ios-patient-client/git/refs/tags/0.0.4]
           12:52:42     at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
           12:52:42     at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
           12:52:42     at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
           12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:625)
           12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:607)
           12:52:42     at org.kohsuke.github.Requester._to(Requester.java:285)
           12:52:42 Caused: org.kohsuke.github.GHFileNotFoundException: \{"message":"Not Found","documentation_url":"https://developer.github.com/v3/git/refs/#get-a-reference"}
           12:52:42     at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
           12:52:42     at org.kohsuke.github.Requester._to(Requester.java:306)
           12:52:42     at org.kohsuke.github.Requester.to(Requester.java:247)
           12:52:42     at org.kohsuke.github.GHRepository.getRef(GHRepository.java:891)
           12:52:42     at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1521)
           12:52:42     at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
           12:52:42     at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:98)
           12:52:42     at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
           12:52:42     at hudson.model.ResourceController.execute(ResourceController.java:97)
           12:52:42    at hudson.model.Executor.run(Executor.java:429)
           12:52:42 Finished: FAILURE
            
           See "github_tag.png" for proof the tag does indeed exist. I've tried re-indexing, but the issue never resolves.
            
           *Repro Steps:*
            
           - Set up tags to build with your repo (see tag_setup.png)
           - Create a tag (say, 0.0.4) in your git repo and push it up to origin. This will cause it to auto build.
           - In git, delete the tag and push that deletion up to Github.
           - In git, tag a new commit with the same tag name (0.0.4) as above and push it up to Github.
           - In Jenkins, in the job made by the tag, click "Build Now"
           - Note that Jenkins can't find the tag
            
            
          Mark Waite made changes -
          Component/s New: github-branch-source-plugin [ 20858 ]
          Component/s Original: git-plugin [ 15543 ]
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

          Mark Waite added a comment -

          Changed the assigned project from the git plugin to the github branch source plugin since the github branch source plugin is in the stack trace rather than the git plugin. The git plugin does not use the GitHub API's. It uses calls to either command line git or to JGit, without invoking any hosting provider specific APIs.

          You may also want to refer to the comments in JENKINS-55284. They describe why it is considered bad practice in git to create a new tag at a new location which uses the same tag name as an existing tag. Once a tag name has been used and cloned outside the original repository, it is usually best to consider that tag "consumed" and to never create or modify it again.

          Mark Waite added a comment - Changed the assigned project from the git plugin to the github branch source plugin since the github branch source plugin is in the stack trace rather than the git plugin. The git plugin does not use the GitHub API's. It uses calls to either command line git or to JGit, without invoking any hosting provider specific APIs. You may also want to refer to the comments in JENKINS-55284 . They describe why it is considered bad practice in git to create a new tag at a new location which uses the same tag name as an existing tag. Once a tag name has been used and cloned outside the original repository, it is usually best to consider that tag "consumed" and to never create or modify it again.
          Mark Waite made changes -
          Summary Original: Deleting a remaking a tag makes Jenkins stop building the tag forever New: Deleting & remaking a tag makes Jenkins stop building the tag forever with GitHub Branch Source

          Liam Newman added a comment -

          Liam Newman added a comment - ethanjdiamond Please take a look at https://github.com/jenkinsci/github-branch-source-plugin/pull/229 . Try this patched hpi to see if fixes you issue: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/github-branch-source/2.5.4-rc850.6b329ab1a13f/
          Liam Newman made changes -
          Assignee New: Liam Newman [ bitwiseman ]
          Ethan Diamond made changes -
          Description Original: *Issue:*
            
           When I click Jenkins reports a tag that exists as "Not Found" and failing the build with this message:
            
           12:52:41 Branch indexing
           19:52:41 [2019-06-24T19:52:41.964Z] Connecting to [https://api.github.com|https://api.github.com/] using dev-rafabuildadmin/****** (github dev-rafabuildadmin user (required to publish build/deploy status))
           12:52:42 java.io.FileNotFoundException: [https://api.github.com/repos/rafastealth/ios-patient-client/git/refs/tags/0.0.4]
           12:52:42     at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
           12:52:42     at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
           12:52:42     at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
           12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:625)
           12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:607)
           12:52:42     at org.kohsuke.github.Requester._to(Requester.java:285)
           12:52:42 Caused: org.kohsuke.github.GHFileNotFoundException: \{"message":"Not Found","documentation_url":"https://developer.github.com/v3/git/refs/#get-a-reference"}
           12:52:42     at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
           12:52:42     at org.kohsuke.github.Requester._to(Requester.java:306)
           12:52:42     at org.kohsuke.github.Requester.to(Requester.java:247)
           12:52:42     at org.kohsuke.github.GHRepository.getRef(GHRepository.java:891)
           12:52:42     at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1521)
           12:52:42     at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
           12:52:42     at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:98)
           12:52:42     at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
           12:52:42     at hudson.model.ResourceController.execute(ResourceController.java:97)
           12:52:42    at hudson.model.Executor.run(Executor.java:429)
           12:52:42 Finished: FAILURE
            
           See "github_tag.png" for proof the tag does indeed exist. I've tried re-indexing, but the issue never resolves.
            
           *Repro Steps:*
            
           - Set up tags to build with your repo (see tag_setup.png)
           - Create a tag (say, 0.0.4) in your git repo and push it up to origin. This will cause it to auto build.
           - In git, delete the tag and push that deletion up to Github.
           - In git, tag a new commit with the same tag name (0.0.4) as above and push it up to Github.
           - In Jenkins, in the job made by the tag, click "Build Now"
           - Note that Jenkins can't find the tag
            
            
          New: *Issue:*
            
           When I click Jenkins reports a tag that exists as "Not Found" and failing the build with this message:
            
           12:52:41 Branch indexing
           19:52:41 [2019-06-24T19:52:41.964Z] Connecting to [https://api.github.com|https://api.github.com/] using dev-rafabuildadmin/****** (github dev-rafabuildadmin user (required to publish build/deploy status))
           12:52:42 java.io.FileNotFoundException: [https://api.github.com/repos/rafastealth/ios-patient-client/git/refs/tags/0.0.4]
           12:52:42     at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
           12:52:42     at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
           12:52:42     at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
           12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:625)
           12:52:42     at org.kohsuke.github.Requester.parse(Requester.java:607)
           12:52:42     at org.kohsuke.github.Requester._to(Requester.java:285)
           12:52:42 Caused: org.kohsuke.github.GHFileNotFoundException: \{"message":"Not Found","documentation_url":"https://developer.github.com/v3/git/refs/#get-a-reference"}
           12:52:42     at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
           12:52:42     at org.kohsuke.github.Requester._to(Requester.java:306)
           12:52:42     at org.kohsuke.github.Requester.to(Requester.java:247)
           12:52:42     at org.kohsuke.github.GHRepository.getRef(GHRepository.java:891)
           12:52:42     at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1521)
           12:52:42     at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
           12:52:42     at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:98)
           12:52:42     at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293)
           12:52:42     at hudson.model.ResourceController.execute(ResourceController.java:97)
           12:52:42    at hudson.model.Executor.run(Executor.java:429)
           12:52:42 Finished: FAILURE
            
           See "github_tag.png" for proof the tag does indeed exist. I've tried re-indexing, but the issue never resolves.
            
           *Repro Steps:*
            
           - Set up tags to build with your repo (see tag_setup.png)
           - Create a tag (say, 0.0.4) in your git repo and push it up to origin. This will cause it to auto build.
           - In git, delete the tag and push that deletion up to Github. 
           - In Jenkins, in the job made by the tag, click "Build Now" - It should fail to find the tag
           - In git, tag a new commit with the same tag name (0.0.4) as above and push it up to Github.
           - In Jenkins, in the job made by the tag, click "Build Now" - Note that Jenkins still can't find the tag even though it exists.
            
            
          Ethan Diamond made changes -
          Attachment New: error_message.png [ 47803 ]

            bitwiseman Liam Newman
            ethanjdiamond Ethan Diamond
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: