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

Getting NoSuchFileException with FSSCM checkout

XMLWordPrintable

      Hello,

      I have Jenkins locally running with Docker in Minikube. I want to learn about Jenkins and dont want to test the Jenkins from my company.

      I want to checkout a project with FSSCM. It is first working and can recognize the Jenkinsfile.
      But I want also start a container with Maven in Kubernetes to run the build and thats where I get following error:

      Running on worker-215623a8-7372-4354-a7b1-0835f69e7464-zd1ns-36z1k in /home/jenkins/agent/workspace/tend-service_develop
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Declarative: Checkout SCM)
      [Pipeline] checkout
      FSSCM.checkout /jenkins-home/frontend-service to /home/jenkins/agent/workspace/tend-service_develop
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node[Pipeline] }
      [Pipeline] // podTemplate
      [Pipeline] End of Pipeline
      java.nio.file.NoSuchFileException: /jenkins-home/frontend-service
      	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
      	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
      	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
      	at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
      	at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
      	at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
      	at java.base/java.nio.file.Files.readAttributes(Files.java:1763)
      	at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
      	at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
      	at java.base/java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
      	at java.base/java.nio.file.Files.walkFileTree(Files.java:2716)
      	at org.apache.commons.io.FileUtils.listAccumulate(FileUtils.java:2076)
      	at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:2132)
      Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 172.17.0.4/172.17.0.4:41334
      		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1797)
      		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      		at hudson.remoting.Channel.call(Channel.java:1001)
      		at hudson.FilePath.act(FilePath.java:1166)
      		at hudson.FilePath.act(FilePath.java:1155)
      		at hudson.plugins.filesystem_scm.FSSCM.checkout(FSSCM.java:215)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)
      		at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)
      		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      		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)
      Caused: java.io.UncheckedIOException: /jenkins-home/frontend-service
      	at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:2135)
      	at org.apache.commons.io.FileUtils.iterateFiles(FileUtils.java:1904)
      	at hudson.plugins.filesystem_scm.FolderDiff.getNewOrModifiedFiles(FolderDiff.java:130)
      	at hudson.plugins.filesystem_scm.RemoteFolderDiff$CheckOut.invoke(RemoteFolderDiff.java:95)
      	at hudson.plugins.filesystem_scm.RemoteFolderDiff$CheckOut.invoke(RemoteFolderDiff.java:88)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3338)
      	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.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 hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:117)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Finished: FAILURE
      

       

       

      Part of the Jenkinsfile:

        pipeline {
          agent {
            kubernetes {
              label "${worker_id}"
              yaml """
                  apiVersion: v1
                  kind: Pod
                  spec:
                    containers:
                      - name: "maven"
                        image: "maven:latest"
                        tty: true
                        command:
                          - cat
                    volumes:
                      - name: docker-socket
                        hostPath:
                          path: "/var/run/docker.sock"
              """.stripIndent()
              }
            }
            stages {
              stage("Build") {
                steps {
                  container('maven') {
                      script {
                        sh """
                          cd "${WORKSPACE}"
                          mvn clean package
                        """
                      }
                    }
                  }
                }
              }
            }
      

       

      This is the configuration for FSSCM:

            Unassigned Unassigned
            victoria Victoria S
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: