[JIRA] (JENKINS-54403) Job fail when GitHub tag was recreated

2 views
Skip to first unread message

n.shchipachev@anchorfree.com (JIRA)

unread,
Nov 1, 2018, 12:05:02 PM11/1/18
to jenkinsc...@googlegroups.com
Nikita Shchipachev created an issue
 
Jenkins / Bug JENKINS-54403
Job fail when GitHub tag was recreated
Issue Type: Bug Bug
Assignee: Unassigned
Components: github-branch-source-plugin
Created: 2018-11-01 16:04
Environment: Jenkins ver. 2.144
GitHub Authentication plugin 0.29
GitHub Branch Source Plugin 2.4.1
GitHub API Plugin 1.92
GitHub plugin 1.29.3
Priority: Minor Minor
Reporter: Nikita Shchipachev

Hi!

I noticed that a job which based on some GitHub tag become broken after re-tag (deleting of the tag on GitHub, creation of a GitHub tag with the same name).
After this related builds falls with messages like this:

Started by user Some User
06:27:03 Connecting to https://api.github.com using some-user/****** (Jenkins Global credentials)
java.io.FileNotFoundException: https://api.github.com/repos/Organization/repository/git/refs/tags/some-tag
	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
	at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
	at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
	at org.kohsuke.github.Requester.parse(Requester.java:617)
	at org.kohsuke.github.Requester.parse(Requester.java:599)
	at org.kohsuke.github.Requester._to(Requester.java:277)
Caused: org.kohsuke.github.GHFileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3/git/refs/#get-a-reference"}
	at org.kohsuke.github.Requester.handleApiError(Requester.java:691)
	at org.kohsuke.github.Requester._to(Requester.java:298)
	at org.kohsuke.github.Requester.to(Requester.java:239)
	at org.kohsuke.github.GHRepository.getRef(GHRepository.java:870)
	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1457)
	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:583)
	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:95)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

At the same time I'm able to retrieve tag's SHA from mentioned GitHub API URI using the same credentials. So it looks like github_branch_source_plugin specific issue.

"Scan Repository Now" doesn't help here. The job for recreated tag still will be failed even if previously I confirmed that the tag had been deleted in Jenkins UI after deleting in GitHub and then successfully created in Jenkins after creation in GitHub.

Any jobs that related to tags which were created only one time works fine.

Steps to reproduce:

  • "New Item" -> "GitHub Organization";
  • For a repo in GitHub organization create a tag which will bring a job in Jenkins;
  • Delete the tag in GitHub;
  • Create a tag with the same name as deleted;
  • Trigger related Jenkins job.
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

campbell.allen@gmail.com (JIRA)

unread,
Nov 15, 2018, 5:30:01 AM11/15/18
to jenkinsc...@googlegroups.com
Cam Allen commented on Bug JENKINS-54403
 
Re: Job fail when GitHub tag was recreated

I'm seeing the same issue described above. Deleting and adding a new tag causes a failure to fetch the ref (cached) from github.

campbell.allen@gmail.com (JIRA)

unread,
Nov 15, 2018, 6:43:02 AM11/15/18
to jenkinsc...@googlegroups.com

Removing the cache file for the corresponding tag ref from the  'org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache' directory allows the job to run again.

In my case the 404 response from github was cached in the offending cache file before removing, after re-running the job it contains a 200 response encrypted body by the look. I'm not sure how it pulls the ref out of this response, maybe it doesn't. 

Manually cleaning up the cache file is not an ideal solution, hopefully this can help with a fix.

yoanlin93@gmail.com (JIRA)

unread,
Dec 26, 2018, 6:28:02 AM12/26/18
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Jun 18, 2019, 5:42:02 PM6/18/19
to jenkinsc...@googlegroups.com

Cam Allen, Yo-An Lin

Could you try the patched version of the github-branch-source-plugin linked in the description of https://issues.jenkins-ci.org/browse/JENKINS-57411 ? 

I'm wondering if perhaps the using a more recent version of okhttp3 will address these issues with the cache. 

 

 

sokratisg@hotmail.com (JIRA)

unread,
Nov 29, 2019, 9:30:02 AM11/29/19
to jenkinsc...@googlegroups.com

Thanks Cam Allen for the suggested fix! Clearing the cache directory indeed allowed jenkins to start building for that re-created tag.
I am on github-branch-source-plugin rel. 2.5.8

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages