github-integration-plugin icon indicating copy to clipboard operation
github-integration-plugin copied to clipboard

Jobs are stopped being triggered - java.lang.NullPointerException: There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=myorgname,repository=myreponame]

Open liyaka opened this issue 5 years ago • 9 comments

I have all the latest Jenkins github plugins:

GitHub API Plugin 1.95 
GitHub Branch Source Plugin 2.4.1  
 GitHub Integration Plugin  0.2.4 
GitHub plugin 1.29.3 
GitHub Pull Request Builder  1.42.0 

I have several pipeline jobs configured to be triggered on every push on master on GitHub. They worked just fine until lately (unfortunately I can't point to a specific day when it stopped working). I can see this error in system log and in GitHubHookRegisterProblemMonitor page:

Failed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=MYORGNAME,repository=MYREPO]
java.lang.NullPointerException: There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=username=MYORGNAME,repository=MYREPO]
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:231)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:179)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:175)
	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:147)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$1.run(WebhookManager.java:127)
	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:119)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
	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:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

The weird thing is it says [host=github.com,username=MYORGNAME,repository=MYREPO] while username is my organization name instead of the user that has the key defined.

I did all the checks described here: https://support.cloudbees.com/hc/en-us/articles/224621648-GitHub-Webhook-Troubleshooting Please advice how it can be fixed.

liyaka avatar Dec 01 '18 21:12 liyaka

Looks similar to https://issues.jenkins-ci.org/browse/JENKINS-49332

carlpaten avatar Feb 15 '19 20:02 carlpaten

Same exact issue here: same error, and username is also set to our org name.

m-barthelemy avatar Aug 01 '19 08:08 m-barthelemy

Same issue here too.

KarlOfDuty avatar Aug 21 '19 10:08 KarlOfDuty

Same issue, but ours is a bit weird. We've just migrated from bitbucket to github and some how the plugin is getting host=bitbucket.org for some repos. Does anyone know how to fix it?

christiansaiki avatar Dec 23 '19 22:12 christiansaiki

Same issue here too!

ChaiBapchya avatar Feb 13 '20 21:02 ChaiBapchya

Anyone found a solution to it

FAROUG avatar Feb 25 '20 10:02 FAROUG

I manually added a webhook to the repos I was interested in.

KarlOfDuty avatar Feb 25 '20 18:02 KarlOfDuty

@KarlOfDuty could you provide some more information how you added the webhooks manually?

johanneshiry avatar Mar 26 '20 08:03 johanneshiry

github repo settings -> webhooks

KostyaSha avatar Mar 26 '20 08:03 KostyaSha