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

Jenkins declarative pipelines sometimes is skipping "Checkout SCM" [possible solution is in the comment]

      Stacktrace:

      java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/android_master@4/Dockerfile
       at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
       at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
       at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
       at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
       at java.nio.file.Files.newByteChannel(Files.java:361)
       at java.nio.file.Files.newByteChannel(Files.java:407)
       at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
       at java.nio.file.Files.newInputStream(Files.java:152)
       at hudson.FilePath.read(FilePath.java:1974)
       at org.jenkinsci.plugins.workflow.steps.ReadFileStep$Execution.run(ReadFileStep.java:104)
       at org.jenkinsci.plugins.workflow.steps.ReadFileStep$Execution.run(ReadFileStep.java:94)
       at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:745)
       Finished: FAILURE

      This failure happens randomly only in parallel builds. Builds are launching on the same job. Script:

      builds["Country $country"] = {
       build job: env.JOB_NAME, parameters: [
       string(name: 'COUNTRY', value: country),
       booleanParam(name: 'APK', value: true),
       ]
      }

       

      I found "SCM Checkout" was skipped in case of failure. I added two screenshots for the same parallel jobs. 

       

       [Pipeline] Start of Pipeline
       [Pipeline] node
       Running on Jenkins in /var/lib/jenkins/workspace/android_master@4
       [Pipeline] {
       [Pipeline] stage
       [Pipeline]
      { (Declarative: Agent Setup) [Pipeline] isUnix [Pipeline] readFile [Pipeline] }
      [Pipeline] // stage
       [Pipeline] }
       [Pipeline] // node
       [Pipeline] stage
       [Pipeline] { (Declarative: Post Actions)
       [Pipeline] script
       [Pipeline]
      { [Pipeline] }
      [Pipeline] // script
       Error when executing always post condition:
      

       

       

      At the end of the build, I am cleaning everything with:

      cleanWs()

      The problem appeared for the first time after upgrading to 2.150.2 LT with all plugins (to that date)

       

      Also, another stacktrace accompany this error, but I am not sure if it is related:

      Error when executing always post condition: java.lang.NullPointerException: Cannot invoke method startsWith() on null object at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17) at WorkflowScript.run(WorkflowScript:249) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor426.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) 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:174) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129) at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$101(SandboxContinuable.java:34) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.lambda$run0$0(SandboxContinuable.java:59) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:121) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:58) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:182) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:332) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

       

        1. failing.png
          failing.png
          170 kB
        2. success.png
          success.png
          315 kB

          [JENKINS-56538] Jenkins declarative pipelines sometimes is skipping "Checkout SCM" [possible solution is in the comment]

          Andrius Semionovas created issue -
          Andrius Semionovas made changes -
          Description Original: Stacktrace:
          {code:java}
          java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/android_master@4/Dockerfile
           at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
           at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
           at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
           at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
           at java.nio.file.Files.newByteChannel(Files.java:361)
           at java.nio.file.Files.newByteChannel(Files.java:407)
           at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
           at java.nio.file.Files.newInputStream(Files.java:152)
           at hudson.FilePath.read(FilePath.java:1974)
           at org.jenkinsci.plugins.workflow.steps.ReadFileStep$Execution.run(ReadFileStep.java:104)
           at org.jenkinsci.plugins.workflow.steps.ReadFileStep$Execution.run(ReadFileStep.java:94)
           at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
           at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
           at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
           at java.lang.Thread.run(Thread.java:745)
           Finished: FAILURE{code}
          This failure happens randomly only in parallel builds. Builds are launching on the same job. Script:
          {code:java}
          builds["Country $country"] = {
           build job: env.JOB_NAME, parameters: [
           string(name: 'COUNTRY', value: country),
           booleanParam(name: 'APK', value: true),
           ]
          }{code}
           

          I found "SCM Checkout" was skipped in case of failure. I added two screenshots for the same parallel jobs. 

           
          [Pipeline] Start of Pipeline[Pipeline] nodeRunning on [Jenkins|https://jenkins.vinted.net/computer/(master)/] in /var/lib/jenkins/workspace/android_master@4[Pipeline] {[Pipeline] stage[Pipeline] { (Declarative: Agent Setup)[Pipeline] isUnix[Pipeline] readFile[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] stage[Pipeline] { (Declarative: Post Actions)[Pipeline] script[Pipeline] {[Pipeline] }[Pipeline] // script
           

          At the end of the build, I am cleaning everything with:
          {code:java}
          cleanWs(){code}
          The problem appeared for the first time after upgrading to 2.150.2 LT with all plugins (to that date)

           

           
          New: Stacktrace:
          {code:java}
          java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/android_master@4/Dockerfile
           at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
           at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
           at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
           at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
           at java.nio.file.Files.newByteChannel(Files.java:361)
           at java.nio.file.Files.newByteChannel(Files.java:407)
           at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
           at java.nio.file.Files.newInputStream(Files.java:152)
           at hudson.FilePath.read(FilePath.java:1974)
           at org.jenkinsci.plugins.workflow.steps.ReadFileStep$Execution.run(ReadFileStep.java:104)
           at org.jenkinsci.plugins.workflow.steps.ReadFileStep$Execution.run(ReadFileStep.java:94)
           at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
           at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
           at java.util.concurrent.FutureTask.run(FutureTask.java:266)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
           at java.lang.Thread.run(Thread.java:745)
           Finished: FAILURE{code}
          This failure happens randomly only in parallel builds. Builds are launching on the same job. Script:
          {code:java}
          builds["Country $country"] = {
           build job: env.JOB_NAME, parameters: [
           string(name: 'COUNTRY', value: country),
           booleanParam(name: 'APK', value: true),
           ]
          }{code}
           

          I found "SCM Checkout" was skipped in case of failure. I added two screenshots for the same parallel jobs. 

           
          {code:java}
           [Pipeline] Start of Pipeline
           [Pipeline] node
           Running on Jenkins in /var/lib/jenkins/workspace/android_master@4
           [Pipeline] {
           [Pipeline] stage
           [Pipeline]
          { (Declarative: Agent Setup) [Pipeline] isUnix [Pipeline] readFile [Pipeline] }
          [Pipeline] // stage
           [Pipeline] }
           [Pipeline] // node
           [Pipeline] stage
           [Pipeline] { (Declarative: Post Actions)
           [Pipeline] script
           [Pipeline]
          { [Pipeline] }
          [Pipeline] // script
           Error when executing always post condition:
          {code}
           

           

          At the end of the build, I am cleaning everything with:
          {code:java}
          cleanWs(){code}
          The problem appeared for the first time after upgrading to 2.150.2 LT with all plugins (to that date)

           

          Also, another stacktrace accompany this error, but I am not sure if it is related:


          {code:java}
          Error when executing always post condition: java.lang.NullPointerException: Cannot invoke method startsWith() on null object at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157) at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17) at WorkflowScript.run(WorkflowScript:249) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor426.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) 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:174) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129) at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$101(SandboxContinuable.java:34) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.lambda$run0$0(SandboxContinuable.java:59) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:121) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:58) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:182) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:332) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745){code}
           
          Andrius Semionovas made changes -
          Labels Original: docker pipeline scmworkflow New: docker pipeline race-condition scmworkflow

          Seems like I found a problem. I found failures happen because two parallel builds are using the same folder on slave machine:

          Success:

          Started by upstream project "android-release-by-tag/v8.31.0.0" build number 1
          originally caused by:
           Push event for tag v8.31.0.0
          13:55:46 Connecting to https://api.github.com using jenkins/****** (Testing GitHub integration for multibranch pipelines)
          Obtained Jenkinsfile from 9a50827efe20bbf7129e4c541f9057f10b0ec0e1
          Running in Durability level: MAX_SURVIVABILITY
          Loading library xxx-shared-libs@master
          Attempting to resolve master from remote references...
           > git --version # timeout=10
           > git ls-remote -h git@github.com:xxx/jenkins-shared-libs.git # timeout=10
          Found match: refs/heads/master revision e1fb61690198e5d487ac3a56f96cc5bb35ec80cf
          No credentials specified
          Cloning the remote Git repository
          Cloning with configured refspecs honoured and without tags
          Cloning repository git@github.com:xxx/jenkins-shared-libs.git
           > git init /var/lib/jenkins/workspace/android-release-by-tag_v8.31.0.0@libs/xxx-shared-libs@10 # timeout=10
          Fetching upstream changes from git@github.com:xxx/jenkins-shared-libs.git
           > git --version # timeout=10
           > git fetch --no-tags --progress git@github.com:xxx/jenkins-shared-libs.git +refs/heads/*:refs/remotes/origin/*
           > git config remote.origin.url git@github.com:xxx/jenkins-shared-libs.git # timeout=10
           > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
           > git config remote.origin.url git@github.com:xxx/jenkins-shared-libs.git # timeout=10
          Fetching without tags
          Fetching upstream changes from git@github.com:xxx/jenkins-shared-libs.git
           > git fetch --no-tags --progress git@github.com:xxx/jenkins-shared-libs.git +refs/heads/*:refs/remotes/origin/*
          Checking out Revision e1fb61690198e5d487ac3a56f96cc5bb35ec80cf (master)
           > git config core.sparsecheckout # timeout=10
           > git checkout -f e1fb61690198e5d487ac3a56f96cc5bb35ec80cf
          Commit message: "Merge pull request #34 from xxx/fix/mistyped_variable"
          [Pipeline] Start of Pipeline
          [Pipeline] node
          Running on slave in /var/lib/jenkins/workspace/android-release-by-tag_v8.31.0.0@8
          [Pipeline] {
          [Pipeline] stage
          [Pipeline] { (Declarative: Checkout SCM)
          [Pipeline] checkout
          using credential github-jenkins-user

           

          Fail:

           

          Started by upstream project "android-release-by-tag/v8.31.0.0" build number 1
          originally caused by:
           Push event for tag v8.31.0.0
          13:55:46 Connecting to https://api.github.com using jenkins/****** (Testing GitHub integration for multibranch pipelines)
          Obtained Jenkinsfile from 9a50827efe20bbf7129e4c541f9057f10b0ec0e1
          Running in Durability level: MAX_SURVIVABILITY
          Loading library xxx-shared-libs@master
          Attempting to resolve master from remote references...
           > git --version # timeout=10
           > git ls-remote -h git@github.com:xxx/jenkins-shared-libs.git # timeout=10
          Found match: refs/heads/master revision e1fb61690198e5d487ac3a56f96cc5bb35ec80cf
          No credentials specified
          Cloning the remote Git repository
          Cloning with configured refspecs honoured and without tags
          Cloning repository git@github.com:xxx/jenkins-shared-libs.git
           > git init /var/lib/jenkins/workspace/android-release-by-tag_v8.31.0.0@libs/xxx-shared-libs@6 # timeout=10
          Fetching upstream changes from git@github.com:xxx/jenkins-shared-libs.git
           > git --version # timeout=10
           > git fetch --no-tags --progress git@github.com:xxx/jenkins-shared-libs.git +refs/heads/*:refs/remotes/origin/*
           > git config remote.origin.url git@github.com:xxx/jenkins-shared-libs.git # timeout=10
           > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
           > git config remote.origin.url git@github.com:xxx/jenkins-shared-libs.git # timeout=10
          Fetching without tags
          Fetching upstream changes from git@github.com:xxx/jenkins-shared-libs.git
           > git fetch --no-tags --progress git@github.com:xxx/jenkins-shared-libs.git +refs/heads/*:refs/remotes/origin/*
          Checking out Revision e1fb61690198e5d487ac3a56f96cc5bb35ec80cf (master)
           > git config core.sparsecheckout # timeout=10
           > git checkout -f e1fb61690198e5d487ac3a56f96cc5bb35ec80cf
          Commit message: "Merge pull request #34 from xxx/fix/mistyped_variable"
          [Pipeline] Start of Pipeline
          [Pipeline] node
          Running on slave in /var/lib/jenkins/workspace/android-release-by-tag_v8.31.0.0@8
          [Pipeline] {
          [Pipeline] ansiColor
          [Pipeline] {
          [Pipeline] timestamps
          [Pipeline] {
          [Pipeline] stage
          [Pipeline] { (env)
          [Pipeline] getContext

           

          Seems like the master doesn't know which workspace folders are used in the slave. 

          Andrius Semionovas added a comment - Seems like I found a problem. I found failures happen because two parallel builds are using the same folder on slave machine: Success: Started by upstream project "android-release-by-tag/v8.31.0.0" build number 1 originally caused by: Push event for tag v8.31.0.0 13:55:46 Connecting to https: //api.github.com using jenkins/****** (Testing GitHub integration for multibranch pipelines) Obtained Jenkinsfile from 9a50827efe20bbf7129e4c541f9057f10b0ec0e1 Running in Durability level: MAX_SURVIVABILITY Loading library xxx-shared-libs@master Attempting to resolve master from remote references... > git --version # timeout=10 > git ls-remote -h git@github.com:xxx/jenkins-shared-libs.git # timeout=10 Found match: refs/heads/master revision e1fb61690198e5d487ac3a56f96cc5bb35ec80cf No credentials specified Cloning the remote Git repository Cloning with configured refspecs honoured and without tags Cloning repository git@github.com:xxx/jenkins-shared-libs.git > git init / var /lib/jenkins/workspace/android-release-by-tag_v8.31.0.0@libs/xxx-shared-libs@10 # timeout=10 Fetching upstream changes from git@github.com:xxx/jenkins-shared-libs.git > git --version # timeout=10 > git fetch --no-tags --progress git@github.com:xxx/jenkins-shared-libs.git +refs/heads/*:refs/remotes/origin/* > git config remote.origin.url git@github.com:xxx/jenkins-shared-libs.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config remote.origin.url git@github.com:xxx/jenkins-shared-libs.git # timeout=10 Fetching without tags Fetching upstream changes from git@github.com:xxx/jenkins-shared-libs.git > git fetch --no-tags --progress git@github.com:xxx/jenkins-shared-libs.git +refs/heads/*:refs/remotes/origin/* Checking out Revision e1fb61690198e5d487ac3a56f96cc5bb35ec80cf (master) > git config core.sparsecheckout # timeout=10 > git checkout -f e1fb61690198e5d487ac3a56f96cc5bb35ec80cf Commit message: "Merge pull request #34 from xxx/fix/mistyped_variable" [Pipeline] Start of Pipeline [Pipeline] node Running on slave in / var /lib/jenkins/workspace/android-release-by-tag_v8.31.0.0@8 [Pipeline] { [Pipeline] stage [Pipeline] { (Declarative: Checkout SCM) [Pipeline] checkout using credential github-jenkins-user   Fail:   Started by upstream project "android-release-by-tag/v8.31.0.0" build number 1 originally caused by: Push event for tag v8.31.0.0 13:55:46 Connecting to https: //api.github.com using jenkins/****** (Testing GitHub integration for multibranch pipelines) Obtained Jenkinsfile from 9a50827efe20bbf7129e4c541f9057f10b0ec0e1 Running in Durability level: MAX_SURVIVABILITY Loading library xxx-shared-libs@master Attempting to resolve master from remote references... > git --version # timeout=10 > git ls-remote -h git@github.com:xxx/jenkins-shared-libs.git # timeout=10 Found match: refs/heads/master revision e1fb61690198e5d487ac3a56f96cc5bb35ec80cf No credentials specified Cloning the remote Git repository Cloning with configured refspecs honoured and without tags Cloning repository git@github.com:xxx/jenkins-shared-libs.git > git init / var /lib/jenkins/workspace/android-release-by-tag_v8.31.0.0@libs/xxx-shared-libs@6 # timeout=10 Fetching upstream changes from git@github.com:xxx/jenkins-shared-libs.git > git --version # timeout=10 > git fetch --no-tags --progress git@github.com:xxx/jenkins-shared-libs.git +refs/heads/*:refs/remotes/origin/* > git config remote.origin.url git@github.com:xxx/jenkins-shared-libs.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 > git config remote.origin.url git@github.com:xxx/jenkins-shared-libs.git # timeout=10 Fetching without tags Fetching upstream changes from git@github.com:xxx/jenkins-shared-libs.git > git fetch --no-tags --progress git@github.com:xxx/jenkins-shared-libs.git +refs/heads/*:refs/remotes/origin/* Checking out Revision e1fb61690198e5d487ac3a56f96cc5bb35ec80cf (master) > git config core.sparsecheckout # timeout=10 > git checkout -f e1fb61690198e5d487ac3a56f96cc5bb35ec80cf Commit message: "Merge pull request #34 from xxx/fix/mistyped_variable" [Pipeline] Start of Pipeline [Pipeline] node Running on slave in / var /lib/jenkins/workspace/android-release-by-tag_v8.31.0.0@8 [Pipeline] { [Pipeline] ansiColor [Pipeline] { [Pipeline] timestamps [Pipeline] { [Pipeline] stage [Pipeline] { (env) [Pipeline] getContext   Seems like the master doesn't know which workspace folders are used in the slave. 

          I found a workaround for this issue. Use `sleep` to make sure no two jobs will be launched on the same second. No more problems since.

                          script {
                              def builds = [:]
          
                              for (i = 0; i < countries.size(); i++) {
                                  def sleepInSec = i * 5
                                  builds["Country $country"] = {
                                      sleep(sleepInSec)
          
                                      build job: env.JOB_NAME, parameters: [
                                              string(name: 'COUNTRY', value: country),
                                      ]
                                  }
                              }
          
                              parallel builds
                          }
          

           

          Andrius Semionovas added a comment - I found a workaround for this issue. Use `sleep` to make sure no two jobs will be launched on the same second. No more problems since. script { def builds = [:] for (i = 0; i < countries.size(); i++) { def sleepInSec = i * 5 builds[ "Country $country" ] = { sleep(sleepInSec) build job: env.JOB_NAME, parameters: [ string(name: 'COUNTRY' , value: country), ] } } parallel builds }  
          Andrius Semionovas made changes -
          Summary Original: Jenkins declarative pipelines sometimes is skipping "Checkout SCM" New: Jenkins declarative pipelines sometimes is skipping "Checkout SCM" [possible solution is in the comment]

          Matt Nuzzaco added a comment -

          I'm seeing a similar set of errors on parallel builds, I am running Jenkins core v2.175 + all the latest versions of plugins (also running kubernetes plugin).

          Matt Nuzzaco added a comment - I'm seeing a similar set of errors on parallel builds, I am running Jenkins core v2.175 + all the latest versions of plugins (also running kubernetes plugin).

          Gil Katz added a comment -

          Lately we started to have the same exception

          Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (AWS-Slave) - Test slave (i-070cffe277f6328cd)
          at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
          at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
          at hudson.remoting.Channel.call(Channel.java:998)
          at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:285)
          at com.sun.proxy.$Proxy108.withRepository(Unknown Source)
          at org.jenkinsci.plugins.gitclient.RemoteGitImpl.withRepository(RemoteGitImpl.java:237)
          at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1266)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1235)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
          at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
          at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.CompletableFuture$AsyncSupply@204f8579 rejected from java.util.concurrent.ThreadPoolExecutor@3f4ea331[Running, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0]
          at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063)
          at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830)
          at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379)
          at java.util.concurrent.CompletableFuture.asyncSupplyStage(CompletableFuture.java:1604)
          at java.util.concurrent.CompletableFuture.supplyAsync(CompletableFuture.java:1830)
          at org.eclipse.jgit.util.FS$FileStoreAttributes.getFileStoreAttributes(FS.java:329)
          at org.eclipse.jgit.util.FS$FileStoreAttributes.get(FS.java:296)
          at org.eclipse.jgit.util.FS.getFileStoreAttributes(FS.java:767)
          at org.eclipse.jgit.internal.storage.file.FileSnapshot.<init>(FileSnapshot.java:224)
          at org.eclipse.jgit.internal.storage.file.FileSnapshot.<init>(FileSnapshot.java:205)
          at org.eclipse.jgit.internal.storage.file.FileSnapshot.save(FileSnapshot.java:102)
          at org.eclipse.jgit.internal.storage.file.FileRepository.<init>(FileRepository.java:209)
          at org.eclipse.jgit.lib.BaseRepositoryBuilder.build(BaseRepositoryBuilder.java:583)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRepository(CliGitAPIImpl.java:3171)
          at hudson.plugins.git.GitAPI.getRepository(GitAPI.java:277)
          at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:28)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:84)
          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.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:931)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:905)
          at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:857)
          at hudson.remoting.UserRequest.perform(UserRequest.java:211)
          at hudson.remoting.UserRequest.perform(UserRequest.java:54)
          at hudson.remoting.Request$2.run(Request.java:369)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          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)

          This happens when we cal to a parallel job that has a shared lib call  

          Gil Katz added a comment - Lately we started to have the same exception Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (AWS-Slave) - Test slave (i-070cffe277f6328cd) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) at hudson.remoting.Channel.call(Channel.java:998) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:285) at com.sun.proxy.$Proxy108.withRepository(Unknown Source) at org.jenkinsci.plugins.gitclient.RemoteGitImpl.withRepository(RemoteGitImpl.java:237) at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1266) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1235) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.CompletableFuture$AsyncSupply@204f8579 rejected from java.util.concurrent.ThreadPoolExecutor@3f4ea331 [Running, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 0] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2063) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:830) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1379) at java.util.concurrent.CompletableFuture.asyncSupplyStage(CompletableFuture.java:1604) at java.util.concurrent.CompletableFuture.supplyAsync(CompletableFuture.java:1830) at org.eclipse.jgit.util.FS$FileStoreAttributes.getFileStoreAttributes(FS.java:329) at org.eclipse.jgit.util.FS$FileStoreAttributes.get(FS.java:296) at org.eclipse.jgit.util.FS.getFileStoreAttributes(FS.java:767) at org.eclipse.jgit.internal.storage.file.FileSnapshot.<init>(FileSnapshot.java:224) at org.eclipse.jgit.internal.storage.file.FileSnapshot.<init>(FileSnapshot.java:205) at org.eclipse.jgit.internal.storage.file.FileSnapshot.save(FileSnapshot.java:102) at org.eclipse.jgit.internal.storage.file.FileRepository.<init>(FileRepository.java:209) at org.eclipse.jgit.lib.BaseRepositoryBuilder.build(BaseRepositoryBuilder.java:583) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRepository(CliGitAPIImpl.java:3171) at hudson.plugins.git.GitAPI.getRepository(GitAPI.java:277) at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:28) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:84) 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.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:931) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:905) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:857) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:369) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(FutureTask.java:266) 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) This happens when we cal to a parallel job that has a shared lib call  

            Unassigned Unassigned
            neworldlt Andrius Semionovas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: