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

Jenkins on Docker (LTS) running locally cannot build Pipelines from local repos

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • * Jenkins 2.89.3 (a container spun up from a recent "jenkinsci/blueocean" Docker image update), running on ...
      * Docker engine 17.12.0-ce, which in turn is running on ...
      * macOS High Sierra 10.13.2

      The LTS release of Jenkins on Docker (installed on a user's local computer) looks like it can no longer build Pipelines from locally cloned repos.

      We have hundreds of readers following the Tutorials in the Jenkins User Documentation like this one. (I.e. Over 900 people have forked the repo that this tutorial uses since about September/October last year.)

      Up until a couple of weeks ago (afaik) and at least since mid-December 2017 when I last tested one of these tutorials, these Tutorials were working fine.

      However, either a recent change in Jenkins or Docker seems to have stopped Jenkins from successfully building Pipelines from locally cloned repos.

      Here's an example of the output I received from following the Build a Java app with Maven tutorial up to the first 'Build' stage, based on my environment (above):

      Started by user Alex
      Obtained Jenkinsfile from git /home/Documents/GitHub/simple-java-maven-app
      [Pipeline] node
      Running on Jenkins in /var/jenkins_home/workspace/simple-java-maven-app
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Declarative: Checkout SCM)
      [Pipeline] checkout
       > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url /home/Documents/GitHub/simple-java-maven-app # timeout=10
      Fetching upstream changes from /home/Documents/GitHub/simple-java-maven-app
       > git --version # timeout=10
       > git fetch --tags --progress /home/Documents/GitHub/simple-java-maven-app +refs/heads/*:refs/remotes/origin/*
       > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
       > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
      Checking out Revision 11ab29736c7e974f76be79e885ec3e2ccd1edd3c (refs/remotes/origin/master)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f 11ab29736c7e974f76be79e885ec3e2ccd1edd3c
      Commit message: "Add initial Jenkinsfile"
      First time build. Skipping changelog.
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Declarative: Agent Setup)
      [Pipeline] sh
      [simple-java-maven-app] Running shell script
      + docker pull maven:3-alpine
      3-alpine: Pulling from library/maven
      Digest: sha256:400fb45cfcedfc492ff91319ea0a58f570172f8cf65f40b9b14931f44a6c1417
      Status: Image is up to date for maven:3-alpine
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] sh
      [simple-java-maven-app] Running shell script
      + docker inspect -f . maven:3-alpine
      .
      [Pipeline] withDockerContainer
      Jenkins does not seem to be running inside a container
      $ docker run -t -d -u 0:0 -v /root/.m2:/root/.m2 -w /var/jenkins_home/workspace/simple-java-maven-app -v /var/jenkins_home/workspace/simple-java-maven-app:/var/jenkins_home/workspace/simple-java-maven-app:rw,z -v /var/jenkins_home/workspace/simple-java-maven-app@tmp:/var/jenkins_home/workspace/simple-java-maven-app@tmp:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat maven:3-alpine
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Build)
      [Pipeline] sh
      [simple-java-maven-app] Running shell script
      sh: can't create /var/jenkins_home/workspace/simple-java-maven-app@tmp/durable-d0777806/jenkins-log.txt: nonexistent directory
      sh: can't create /var/jenkins_home/workspace/simple-java-maven-app@tmp/durable-d0777806/jenkins-result.txt: nonexistent directory
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      $ docker stop --time=1 62fb7efe019d5a88ed5d0c265d663184dab9668e62f4a26732dc3521ff797bd3
      $ docker rm -f 62fb7efe019d5a88ed5d0c265d663184dab9668e62f4a26732dc3521ff797bd3
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code -2
      Finished: FAILURE
      

      Other Jenkins users who've been following the tutorials in the Jenkins User Documentation have reported similar buggy behavior (see rows 44 and 45 of the documentation feedback form), one of which appears to indicate that this issue is also a problem with Docker on Windows.

      This buggy behavior even prevents the ability to successfully run a Pipeline from a local Git repo in Blue Ocean.

      I've attached links to the relevant Jenkins User Google Group post and GitHub repo issue, which a user who identified this issue (early on) had raised.

            ndeloof Nicolas De Loof
            ggaskell Giles Gaskell
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: