Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51685

/var/lib/jenkins/init.groovy.d/create-github-oauth.groovy fails on initialisation

XMLWordPrintable

      After upgrading Jenkins to ver. 2.126 the 

      /var/lib/jenkins/init.groovy.d/create-github-oauth.groovy fails with the below error:

       
      Jun 04, 2018 12:07:19 PM WARNING jenkins.util.groovy.GroovyHookScript execute
      Failed to run script file:/var/lib/jenkins/init.groovy.d/create-github-oauth.groovy groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.jenkinsci.plugins.GithubSecurityRealm(java.lang.String, java.lang.String, java.lang.String, java.lang.String) at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1732) at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1532) at org.codehaus.groovy.runtime.callsite.MetaClassConstructorSite.callConstructor(MetaClassConstructorSite.java:49) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:271) at create-github-oauth.run(create-github-oauth.groovy:6) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:136) at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:127) at jenkins.util.groovy.GroovyHookScript.run(GroovyHookScript.java:110) at hudson.init.impl.GroovyInitScript.init(GroovyInitScript.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296) at jenkins.model.Jenkins$5.runTask(Jenkins.java:1068) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) 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)

       

      also the multibranch pipeline jobs using Jenkins scripted pipeline stopped working:

       

      They fail at start with:

       

      Started by user *****************
      java.io.FileNotFoundException: https://api.github.com/
      at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
      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:612)
      at org.kohsuke.github.Requester.parse(Requester.java:594)
      at org.kohsuke.github.Requester._to(Requester.java:272)
      Caused: org.kohsuke.github.GHFileNotFoundException: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}
      at org.kohsuke.github.Requester.handleApiError(Requester.java:686)
      at org.kohsuke.github.Requester._to(Requester.java:293)
      at org.kohsuke.github.Requester.to(Requester.java:234)
      at org.kohsuke.github.GitHub.checkApiUrlValidity(GitHub.java:703)
      at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.checkApiUrlValidity(GitHubSCMSource.java:1351)
      at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1404)
      at jenkins.scm.api.SCMSource.fetch(SCMSource.java:566)
      at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:95)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:298)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE

       

      NOTE: Please note that the GitHub creds have not changed and they work just fine in other manually created jobs.

       

            sag47 Sam Gleske
            cb_tes_global Constantin Bugneac
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: