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

Global Pipeline shared library fails after upgrading Jenkins to 2.426.3

XMLWordPrintable

      Can no longer use global pipeline libraries with p4 plugin Version: 1.14.4 and Jenkins Version: 2.426.3.

      Interestingly, I was not able to reproduce the issue when I tested it at Jenkins 2.387.3. I have been able to reproduce the issue after upgrading Jenkins to 2.426.3. So, it seems that this issue could be something to do with Jenkins version.

      ===
      P4 Task: attempt: 1
      ERROR: P4: Task Exception: java.io.UncheckedIOException: java.nio.file.NoSuchFileException: /var/lib/jenkins/jobs/StreamAtChange/builds/30/libs
      ERROR: Maximum checkout retry attempts reached, aborting
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: Loading libraries failed

      1 error

      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1107)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293)
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox$Scope.parse(GroovySandbox.java:163)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:190)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:175)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:568)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:518)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:336)
      at hudson.model.ResourceController.execute(ResourceController.java:101)
      at hudson.model.Executor.run(Executor.java:442)
      Finished: FAILURE

      ===

       

      [Reproduction]

      1. Add following file to Perforce at '//depot/myLibrary/src/org/foo/lib.groovy':

      package org.foo;

      def testFunc ()

      {   echo "HELLO" }

      return this;

       

      2. Add a Global Library (modern SCM > Helix Library) called 'test' (see pipeline_lib_01.png and pipeline_lib_02.png).

      3. Add following file to Perforce at '//stream/main/Jenkinsfile' (see pipeline_project_config.png if using 'Pipeline script from SCM')

      @Library('test@now')
      import org.foo.lib.*

      pipeline {
      agent any
      stages {
      stage("Repro") {
      steps {
      script

      { def z = new org.foo.lib() z.testFunc() }


      }
      }
      }
      }

            Unassigned Unassigned
            s3037560 Kevin Park
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: