Jenkins-Github/Git - "Error validating repository information. Credentials ok."

Viewed 1962

On Jenkins, While setting up Multibranch setup with "Github" on Jenkins, I get strange error as

Error validating repository information. Credentials ok.

However same credential works for "git" as "Add Source" category but fails for "github" if added as "Add Source". This is actual credential for github and I can login github portal, Not sure what is going on here. Any pointers. Thanks

3 Answers

I faced the same issue. This worked for me : create a Personal Access Token (using the steps described here ), and use your PAT as password in the jenkins credentials branch source. And the github username account (the account you create the PAT with) as username in jenkins.

This is normally caused by the GitHub API "get a repository" failing to retrive your repository:

Caused: org.kohsuke.github.GHFileNotFoundException: https://github.organization.com/api/v3/repos/<user>/<repo> {"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.20/v3/repos/#get"}
    at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:451)
    at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:382)
    at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:326)

Double check your own "cause by" to see if the same API is involved, and if the URL used is correct.

Use github personal access token with required permission(scope) to repository in Github as shown below:

admin:repo_hook, repo 
Related