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

Unable to invoke private library

XMLWordPrintable

      I am trying to invoke a private github repository as pipeline library for a multi-branch pipeline. 

      As my repository does not allow anonymous access (and there is no option to provide credentials at the plugin for this when you specify the version) I'm getting an error that it cannot verify the version, as shown in the logs below. After this, I'm getting the "WorkflowScript: Loading libraries failed" without specific reason why. Please note that I've successfully load public libraries which allow anonymous access in my Jenkins instance.

      Please can you help?

       

      Started by user me
      09:38:30 Connecting to https://api.github.com using myuser/****** (myuser_personal_token)
      Obtained Jenkinsfile from 464647899
      Loading library myorg/myrepo@master
      09:38:31 GitHub API Usage: Current quota has 53 remaining (0 under budget). Next quota of 60 in 59 min
      java.io.FileNotFoundException: https://api.github.com/repos/myorg/myrepo
      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":"Not Found","documentation_url":"https://developer.github.com/v3/repos/#get"}
      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.getRepository(GitHub.java:443)
      at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1159)
      at jenkins.scm.api.SCMSource.fetch(SCMSource.java:598)
      at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:80)
      at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:153)
      at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:134)
      at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:129)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:419)

      GitHub has been notified of this commit’s build result

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: Loading libraries failed

      1 error

      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:129)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:419)
      Finished: FAILURE

            Unassigned Unassigned
            elntagka Eleni Ntagka
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: