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

Process apparently never started when using two Docker agents

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Ubuntu Xenial, Jenkins 2.239 with all plugins up-to-date
    • Similar Issues:

      Description

      The following Jenkins works fine:

       

      pipeline {
          agent none
          stages {
              stage('Test') {
                  agent {
                      docker {
                          image 'node:14-alpine'
                          alwaysPull true
                      }
                  }
                  steps {
                      sh 'pwd'
                      sh 'node --version'
                  }
              }
          }
      }
      

       

      The following got some issues and it's stuck on "docker pull node:14-alpine" (from Blue Ocean view):

       

       

      pipeline {
          agent {
              dockerfile {
                  filename 'docker/jenkins-agent/Dockerfile'
                  additionalBuildArgs "--build-arg UID=113"
              }
          }
      
      stages {
          stage('Test') {
                agent {
                    docker {
                        image 'node:14-alpine'
                        alwaysPull true
                    }
                }
                steps {
                    sh 'node --version'
                }
            }
          }
      }

       

      When tried without "alwaysPull true", it got stuck on "docker inspect -f . node:14-alpine — Shell Script".

      My Dockerfile:

       

      FROM ubuntu:focal AS ubuntu
      ENV DEBIAN_FRONTEND noninteractive
      # Creates a user.
      ARG UID=1001
      RUN useradd -rm -d /home/jenkins -s /bin/bash -g root -u $UID jenkins
      USER jenkins
      WORKDIR /home/jenkins
      

       

      Jenkins output:

      ...
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] isUnix
      [Pipeline] sh (
      (hang)

      Error after timeout (docker pull node:14-alpine — Shell Script):

      process apparently never started in /var/lib/jenkins/workspace/Deploy@2@tmp/durable-75354819 (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer) script returned exit code -2
      

      My understanding is when specifying "agent" inside "stage" it should override/replace the outer "agent", but it seems Jenkins got some issues with this configuration.

        Attachments

          Activity

          Hide
          thogr Thomas Gronwall added a comment -

          I got the same error after an upgrade of Jenkins and a bunch of plugins (including durable). I'm not using Docker. But it happens when in a stage with an explicit node{ sh ... } to hand over to a slave. But I have only got the error on one particular slave, it seams to work for a different slave. I don't know what the difference is.

          This is the error:
          process apparently never started in C:\Jenkins\workspace\APPBUILDER-MONGOOSE-PIPELINE-DEVELOP@tmp\durable-b7aab64d
          (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)

          I have now downgraded to version 1.34, and it seams to help. But I not 100% sure yet, if this error is possibly intermittent in nature.

          Show
          thogr Thomas Gronwall added a comment - I got the same error after an upgrade of Jenkins and a bunch of plugins (including durable). I'm not using Docker. But it happens when in a stage with an explicit node{ sh ... } to hand over to a slave. But I have only got the error on one particular slave, it seams to work for a different slave. I don't know what the difference is. This is the error: process apparently never started in C:\Jenkins\workspace\APPBUILDER-MONGOOSE-PIPELINE-DEVELOP@tmp\durable-b7aab64d (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer) I have now downgraded to version 1.34, and it seams to help. But I not 100% sure yet, if this error is possibly intermittent in nature.
          Hide
          lawtondevinec Craig Lawton-Devine added a comment -

          I have a similar issue and what introduced it in my case was the UID.

          In your file:

          additionalBuildArgs "--build-arg UID=113"
          

          Will give something like

          docker run -t -d -u 111:117 -u 113
          

          The duplication of the -u argument seems to cause the hang.

          Show
          lawtondevinec Craig Lawton-Devine added a comment - I have a similar issue and what introduced it in my case was the UID. In your file: additionalBuildArgs "--build-arg UID=113" Will give something like docker run -t -d -u 111:117 -u 113 The duplication of the -u argument seems to cause the hang.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            kenorb kenorb
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: