33

I got very strange behavior that has never happened before, when I try to configure the GitHub server in Jenkins general configuration to set up webhooks auto.

The drop down menu doesn't display my registered credentials. I was always be able to do that, but suddenly I don't know what's happening. I tried to uninstall the plugin, restarting Jenkins, kill the Jenkins Docker container and configure all the stuff again ... still I got the same issue.

Enter image description here

There is no other option other than none, and when I add new credentials I still get None as the only option...

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ZEE
  • 5,669
  • 4
  • 35
  • 53
  • What happens when you click on the "Add" button? Have you tried adding other credentials? – Hubert Grzeskowiak Apr 08 '16 at 13:27
  • 1
    yes this is what I can't understand when I add new ones I still get none as the only option – ZEE Apr 08 '16 at 13:28
  • Github plugin only accepts plain text credentials (https://wiki.jenkins-ci.org/display/JENKINS/Plain+Credentials+Plugin). Have you created one manually or via the Advanced... options? – Hilborn Apr 08 '16 at 13:28
  • I created them with the add – ZEE Apr 08 '16 at 13:29
  • You need a personal access token from Github, you can create one with these instructions: https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Plugin#GitHubPlugin-AutomaticMode%28Jenkinsmanageshooksforjobsbyitself%29 – Hilborn Apr 08 '16 at 13:34
  • I did i get this over and over again Can't create GH token - {"message":"Validation Failed","errors":[{"resource":"OauthAccess","code":"already_exists","field":"description"}],"documentation_url":"https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization"} – ZEE Apr 08 '16 at 13:34
  • already exist and in the drope down menu I have NONE !! – ZEE Apr 08 '16 at 13:35
  • 1
    You can remove your token from https://github.com/settings/tokens and let the plugin generate a new one – Hilborn Apr 08 '16 at 13:36
  • 1
    I'm glad this solved your issue :) Haha I actually had this exact same problem yesterday when setting up the Github plugin in my Jenkins service – Hilborn Apr 08 '16 at 13:48

1 Answers1

20

The issue is that the GitHub plugin only accepts plain text credentials.

The GitHub access token can be created manually, or automatically via the Advanced... options as described here.

In case you already have an access token in GitHub (you'll get an error in Jenkins), you can remove it in Github. Then you can let Jenkins generate the token and select it in the Credentials menu.

Nathan Smith
  • 683
  • 1
  • 10
  • 24
Hilborn
  • 755
  • 9
  • 14
  • 1
    If you have to add the plain text credentials by hand, what do you put in the "secret" line. Does it have the userid and token in there? – Lee Meador Dec 12 '17 at 18:33
  • I was NOT able to see my credentials with a manually create a token. I only saw them when I created them automatically using the method described in the link shared by @Hilborn – Matt Parrilla Feb 15 '19 at 21:35
  • this doens't seem to be a thing anymore – jackie Mar 14 '22 at 22:36