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

Every second build fails on "No such property" which supposed to be detected during first build

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • pipeline
    • None
    • Jenkins 2.440.1 LTS
      Pipeline: Job 1400.v7fd111b_ec82f

      On our jenkins we have set of pipeline-type jobs, which are being installed using JCaC (we have everything defined in our main jenkins.yaml file). Most of jobs have cron schedule and are executed on daily basis. Every job has a following logic to allow aborting first build for parameters update, defined within first stage/step:

      def call() {
          // Aborts build if it is the first and not the multibranch one
          if ((env.BUILD_NUMBER == "1") && (!env.BRANCH_NAME)) {
              currentBuild.displayName = "#${env.BUILD_NUMBER}: ABORTED for Parameters update"
              abortBuild BUILD_ABORT_MESSAGE: 'Aborting run #1 to update job Parameters from Jenkinsfile.'
          }
      } 

      After installation of fresh Jenkins instance (we are always installing fresh Jenkins, not upgrading existing instance), we are triggering every build to allow parameter update & abort.

      Since Jenkins 2.440.1 LTS (it was working as expected for previous LTS versions) we started observing that triggering & aborting first build for parameter update is not enough . 

      Every second builds starts failing on "No such property error":

      Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 8dc19676-0405-409e-9ffd-dc89f335506a
      groovy.lang.MissingPropertyException: No such property: PACKAGE_MAJOR_VERSION for class: groovy.lang.Binding
      	at groovy.lang.Binding.getVariable(Binding.java:63)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:285)
      	at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:375)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:379)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:355)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:355)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:355)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:355)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
      	at org.jenkinsci.plugins.workflow.cps.LoggingInvoker.getProperty(LoggingInvoker.java:121)
      	at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
      	at WorkflowScript.run(WorkflowScript:84)
      	at ___cps.transform___(Native Method)
      	at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:73)
      	at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
      	at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:65)
      	at jdk.internal.reflect.GeneratedMethodAccessor435.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:152)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:146)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:146)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:187)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:423)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:331)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:295)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:97)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
      	at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829) 

      Parameter supposed to be defined/detected during first aborted run (together with default value). But you can see that as of version 2.440.1 this no longer works. Have there been any changes that force us to change the way we initialize parameters in these types of builds? Every 3rd, 4th build acts normally (understands parameter and uses it's default value).

            Unassigned Unassigned
            rpysz Rafal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: