jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-52513] Failed to add GitHub webhook for GitHubRepositoryName

Open
#1,196 1 comment 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

I've got a weird issue on my Jenkins server. We have a GitHub Organization job in Jenkins which corresponds to a GitHub organization with a variety of public/private repos. When I rescan the organization, I see a slew of errors like this in the Jenkins log, for both the public/private repos:


Failed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=,repository=] java.lang.NullPointerException: There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=,repository=ci-control] 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)

etc...


I have double-checked the access token settings, and the token has all scopes for "repo" (as the documentation says). I have also tried granting permission to the "admin:repo_hook" and "admin:org_hook" scopes, but it didn't make any difference.

The credential for the API token is a username/password, and although the username was blank I tried entering the actual username for the token owner. This also didn't make a difference, and weirdly, in the exception stacktrace in the logfile, it says username= rather than username= as I would have expected.

Finally, I should note – the actual organization scan succeeds. We can build projects, and when we create new branches or pull requests, they get built as expected. It's only the organization scan that throws up a bunch of warnings.

Am I doing something wrong, or is this a legit bug in the plugin? 

---
Originally reported by nre_ableton, imported from: Failed to add GitHub webhook for GitHubRepositoryName


  • status: Open
  • priority: Minor
  • component(s): github-branch-source-plugin
  • resolution: Unresolved
  • votes: 5
  • watchers: 9
  • imported: 2025-12-02

Raw content of original issue

I've got a weird issue on my Jenkins server. We have a GitHub Organization job in Jenkins which corresponds to a GitHub organization with a variety of public/private repos. When I rescan the organization, I see a slew of errors like this in the Jenkins log, for both the public/private repos:


Failed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=<my github org>,repository=<some repo>] java.lang.NullPointerException: There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=<my github org>,repository=ci-control] 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)
etc...


I have double-checked the access token settings, and the token has all scopes for "repo" (as the documentation says). I have also tried granting permission to the "admin:repo_hook" and "admin:org_hook" scopes, but it didn't make any difference.

The credential for the API token is a username/password, and although the username was blank I tried entering the actual username for the token owner. This also didn't make a difference, and weirdly, in the exception stacktrace in the logfile, it says username=<my github org> rather than username=<my github user> as I would have expected.

Finally, I should note – the actual organization scan succeeds. We can build projects, and when we create new branches or pull requests, they get built as expected. It's only the organization scan that throws up a bunch of warnings.

Am I doing something wrong, or is this a legit bug in the plugin? 

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.