[JIRA] [git-plugin] (JENKINS-28238) Github Plugin Failing to re-register for hooks

482 views
Skip to first unread message

richard.c.duarte@gmail.com (JIRA)

unread,
May 5, 2015, 11:20:02 AM5/5/15
to jenkinsc...@googlegroups.com
Richard Duarte created an issue
 
Jenkins / Bug JENKINS-28238
Github Plugin Failing to re-register for hooks
Issue Type: Bug Bug
Assignee: Nicolas De Loof
Components: git-plugin, github-plugin
Created: 05/May/15 3:19 PM
Environment: Centos 6.5 x64
Priority: Major Major
Reporter: Richard Duarte

I'm trying to have Jenkins automatically manage github webhooks.

My automated jenkins user has a github oauth token with "repo" and "repo:status" permissions that its using.

I click on "re-register hooks for all jobs" and this is the output from the jenkins log:

May 05, 2015 11:15:48 AM com.cloudbees.jenkins.GitHubPushTrigger$2 run
WARNING: Failed to add GitHub webhook for GitHubRepository[host=github.com,username=DemandCube,repository=NeverwinterDP]
org.kohsuke.github.GHException: Failed to update jenkins hooks
at com.cloudbees.jenkins.GitHubPushTrigger.createJenkinsHook(GitHubPushTrigger.java:182)
at com.cloudbees.jenkins.GitHubPushTrigger.access$700(GitHubPushTrigger.java:55)
at com.cloudbees.jenkins.GitHubPushTrigger$2.run(GitHubPushTrigger.java:165)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.FileNotFoundException:

{"message":"Not Found","documentation_url":"https://developer.github.com/v3"}

at org.kohsuke.github.Requester.handleApiError(Requester.java:494)
at org.kohsuke.github.Requester._to(Requester.java:245)
at org.kohsuke.github.Requester.to(Requester.java:191)
at org.kohsuke.github.GHRepository.createHook(GHRepository.java:880)
at com.cloudbees.jenkins.GitHubPushTrigger.createJenkinsHook(GitHubPushTrigger.java:179)
... 9 more
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/DemandCube/NeverwinterDP/hooks
at sun.reflect.GeneratedConstructorAccessor135.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1675)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1673)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1671)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1244)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.kohsuke.github.Requester.parse(Requester.java:451)
at org.kohsuke.github.Requester._to(Requester.java:224)
... 12 more
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/DemandCube/NeverwinterDP/hooks
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1624)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at org.kohsuke.github.Requester.parse(Requester.java:447)
... 13 more

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

richard.c.duarte@gmail.com (JIRA)

unread,
May 5, 2015, 11:29:01 AM5/5/15
to jenkinsc...@googlegroups.com
Richard Duarte commented on Bug JENKINS-28238
 
Re: Github Plugin Failing to re-register for hooks

Versions running:

GIT Client plugin 1.17.0
GIT plugin: 2.3.5
GitHub API Plugin 1.67
GitHub Plugin 1.11.3

mark.earl.waite@gmail.com (JIRA)

unread,
May 5, 2015, 11:17:01 PM5/5/15
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Change By: Mark Waite
Component/s: git-plugin

lanwen@yandex.ru (JIRA)

unread,
Jul 14, 2015, 10:15:01 AM7/14/15
to jenkinsc...@googlegroups.com
Kirill Merkushev commented on Bug JENKINS-28238
 
Re: Github Plugin Failing to re-register for hooks

User should have admin rights to see and manage hooks

lanwen@yandex.ru (JIRA)

unread,
Jul 14, 2015, 10:21:02 AM7/14/15
to jenkinsc...@googlegroups.com
Kirill Merkushev assigned an issue to Richard Duarte
 
Change By: Kirill Merkushev
Assignee: Nicolas De Loof Richard Duarte

lanwen@yandex.ru (JIRA)

unread,
Jul 14, 2015, 10:22:01 AM7/14/15
to jenkinsc...@googlegroups.com
Kirill Merkushev edited a comment on Bug JENKINS-28238
User should have admin rights to see and manage hooks  (admin:repo_hook)

gentoo.integer@gmail.com (JIRA)

unread,
Jul 15, 2015, 3:39:02 PM7/15/15
to jenkinsc...@googlegroups.com
Kanstantsin Shautsou resolved as Not A Defect
 
Change By: Kanstantsin Shautsou
Status: Open Resolved
Resolution: Not A Defect

gentoo.integer@gmail.com (JIRA)

unread,
Oct 6, 2015, 9:45:02 AM10/6/15
to jenkinsc...@googlegroups.com
Kanstantsin Shautsou resolved as Incomplete
 

No replies, closing.

Change By: Kanstantsin Shautsou
Status: Open Resolved
Resolution: Incomplete

gentoo.integer@gmail.com (JIRA)

unread,
Oct 6, 2015, 9:45:10 AM10/6/15
to jenkinsc...@googlegroups.com
Kanstantsin Shautsou updated an issue
I'm trying to have Jenkins automatically manage github webhooks.

My automated jenkins user has a github oauth token with "repo" and "repo:status"  permissions that its using. 



I click on "re-register hooks for all jobs" and this is the output from the jenkins log:
{code}
{code}

jgangemi@gmail.com (JIRA)

unread,
Nov 4, 2015, 4:01:01 PM11/4/15
to jenkinsc...@googlegroups.com
Jae Gangemi reopened an issue
Change By: Jae Gangemi
Status: Resolved Reopened
Resolution: Incomplete

jgangemi@gmail.com (JIRA)

unread,
Nov 4, 2015, 4:04:02 PM11/4/15
to jenkinsc...@googlegroups.com
Jae Gangemi edited a comment on Bug JENKINS-28238
 
Re: Github Plugin Failing to re-register for hooks
i am having the same problem.

{code}
Nov 04, 2015 8:41:42 PM WARNING org.jenkinsci.plugins.github.webhook.WebhookManager$2 applyNullSafeFailed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=condevops,repository=hello-world-jenkins]
java.lang.NullPointerException: There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=condevops,repository=hello-world-jenkins]
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:231)
at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:151)
at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:147)
at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18)
at com.google.common.collect.Iterators$8.next(Iterators.java:812)
at com.google.common.collect.Iterators$7.computeNext(Iterators.java:648)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at com.google.common.collect.Iterators$7.computeNext(Iterators.java:647)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at com.google.common.collect.Lists.newArrayList(Lists.java:138)
at com.google.common.collect.Lists.newArrayList(Lists.java:119)
at org.jenkinsci.plugins.github.util.FluentIterableWrapper.toList(FluentIterableWrapper.java:137)
at org.jenkinsci.plugins.github.webhook.WebhookManager$1.run(WebhookManager.java:97)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
{code}

this is a brand new jenkins setup w/ the following versions:

{code}
jenkins: 1.636
git plugin: 2.4.0
git
 api: 1.69
git
 client: 1.19.0
github plugin: 1.14.0
{code}

my oauth token has the correct permissions and the verify credentials button indicates everything can connect.

jgangemi@gmail.com (JIRA)

unread,
Nov 4, 2015, 4:04:05 PM11/4/15
to jenkinsc...@googlegroups.com

i am having the same problem.

Nov 04, 2015 8:41:42 PM WARNING org.jenkinsci.plugins.github.webhook.WebhookManager$2 applyNullSafeFailed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=condevops,repository=hello-world-jenkins]
java.lang.NullPointerException: There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=condevops,repository=hello-world-jenkins]
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:231)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:151)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:147)
	at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18)
	at com.google.common.collect.Iterators$8.next(Iterators.java:812)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:648)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:647)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at com.google.common.collect.Lists.newArrayList(Lists.java:138)
	at com.google.common.collect.Lists.newArrayList(Lists.java:119)
	at org.jenkinsci.plugins.github.util.FluentIterableWrapper.toList(FluentIterableWrapper.java:137)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$1.run(WebhookManager.java:97)
	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

this is a brand new jenkins setup w/ the following versions:

jenkins: 1.636
git plugin: 2.4.0
git client: 1.19.0
github plugin: 1.14.0

my oauth token has the correct permissions and the verify credentials button indicates everything can connect.

jgangemi@gmail.com (JIRA)

unread,
Nov 4, 2015, 4:05:03 PM11/4/15
to jenkinsc...@googlegroups.com
Jae Gangemi assigned an issue to Kanstantsin Shautsou
 
Change By: Jae Gangemi
Assignee: Richard Duarte Kanstantsin Shautsou

jgangemi@gmail.com (JIRA)

unread,
Nov 4, 2015, 4:08:01 PM11/4/15
to jenkinsc...@googlegroups.com
 
Re: Github Plugin Failing to re-register for hooks

i am also unable to set the build status at the end of the job

Setting commit status on GitHub for https://github.com/condevops/hello-world-jenkins/commit/9147bf95263836cd6bccfd1e7882ac7498e79ca6
ERROR: Step ‘Set build status on GitHub commit’ aborted due to exception: 
java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
	at org.kohsuke.github.Requester.handleApiError(Requester.java:501)
	at org.kohsuke.github.Requester._to(Requester.java:248)
	at org.kohsuke.github.Requester.to(Requester.java:194)
	at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:829)
	at com.cloudbees.jenkins.GitHubCommitNotifier.updateCommitStatus(GitHubCommitNotifier.java:138)
	at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:90)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
	at hudson.model.Run.execute(Run.java:1766)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:410)
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/condevops/hello-world-jenkins/statuses/9147bf95263836cd6bccfd1e7882ac7498e79ca6
	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:240)
	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:458)
	at org.kohsuke.github.Requester._to(Requester.java:227)
	... 13 more
Finished: FAILURE

lanwen@yandex.ru (JIRA)

unread,
Nov 5, 2015, 3:52:02 AM11/5/15
to jenkinsc...@googlegroups.com

jgangemi@gmail.com (JIRA)

unread,
Nov 5, 2015, 1:32:01 PM11/5/15
to jenkinsc...@googlegroups.com
Jae Gangemi updated an issue
 
Change By: Jae Gangemi
Attachment: ishot-2.png

jgangemi@gmail.com (JIRA)

unread,
Nov 5, 2015, 1:33:01 PM11/5/15
to jenkinsc...@googlegroups.com
Jae Gangemi commented on Bug JENKINS-28238
 
Re: Github Plugin Failing to re-register for hooks

i am using the plugin itself to create the token, so whatever it creates plus i manually add admin:org_hook. see the attached screenshot.

one thing i was just thinking...what access level does this user need to have in github itself?

lanwen@yandex.ru (JIRA)

unread,
Nov 6, 2015, 3:18:01 AM11/6/15
to jenkinsc...@googlegroups.com

user should have admin rights on repo to be able to use this scopes and api calls

jgangemi@gmail.com (JIRA)

unread,
Nov 6, 2015, 10:38:02 AM11/6/15
to jenkinsc...@googlegroups.com

yeah - that's what i'm missing. you'd think github would alert me to that fact, but they don't.

this can be closed. i would like to make the suggestion that you update the wiki page to state that in addition to the hook permission needed, the user itself must also be an owner in github. unfortunate they don't offer another level of privs for this. my jenkins user is a machine user and "owner" isn't appropriate, but that's not your problem.

chad.myers@gmail.com (JIRA)

unread,
Nov 8, 2015, 3:03:02 PM11/8/15
to jenkinsc...@googlegroups.com

I'm getting this error too.

I'm the owner of the org, owner of the repo (repo is private). I granted repo, repo:status, and admin:repo_hook. I noticed that when I generate the token, "repo:status" is removed. I think because repo scope also includes repo:status. I unchecked repo and checked repo:status and then repo:status stayed.

I've tried many different combos of these checkboxes and I get the error in all cases.

I'm wondering if maybe Github changed something on their end and broke this plugin?

One thing I did notice is that in the log it says:

Object is GitHubRepositoryName[host=github.com,username=REDACTED,repository=REDACTED]

The username is my organization since the repository is an organization repo, not a user repo. I don't know if that has any effect on Github API or not.

lanwen@yandex.ru (JIRA)

unread,
Nov 10, 2015, 11:09:02 AM11/10/15
to jenkinsc...@googlegroups.com

Please make sure you able to register hook with help of curl and direct api call

lanwen@yandex.ru (JIRA)

unread,
Dec 17, 2015, 5:47:03 AM12/17/15
to jenkinsc...@googlegroups.com
Kirill Merkushev closed an issue as Cannot Reproduce
 
Change By: Kirill Merkushev
Status: Reopened Closed
Resolution: Cannot Reproduce
Reply all
Reply to author
Forward
0 new messages