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

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

    Details

    • Similar Issues:

      Description

      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)

       

        Attachments

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

          Activity

          neworldlt Andrius Semionovas created issue -
          neworldlt Andrius Semionovas made changes -
          Field Original Value New Value
          Description 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)

           

           
          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}
           
          neworldlt Andrius Semionovas made changes -
          Labels docker pipeline scmworkflow docker pipeline race-condition scmworkflow
          Hide
          neworldlt 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. 

          Show
          neworldlt 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. 
          Hide
          neworldlt 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
                          }
          

           

          Show
          neworldlt 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 }  
          neworldlt Andrius Semionovas made changes -
          Summary Jenkins declarative pipelines sometimes is skipping "Checkout SCM" Jenkins declarative pipelines sometimes is skipping "Checkout SCM" [possible solution is in the comment]
          Hide
          nuzz 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).

          Show
          nuzz 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).

            People

            • Assignee:
              Unassigned
              Reporter:
              neworldlt Andrius Semionovas
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: