sh step stuck on when adding inheritFrom in the kubernetes agent section

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      After upgraded the kubernetes-plugin to 1.18.0, all of my pipelines hanging on in the one of shell step, and it ended up with the following error.

      process apparently never started in /home/jenkins/workspace/playaround@tmp/durable-3833ccbe
       (running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
      

      After a deep investigation, I've reproduced the issue with the following minimal pipeline code.

      pipeline {
          agent {
              kubernetes {
                  label 'playaround'
                  containerTemplate(name: 'busybox', image: 'busybox', command: 'cat', ttyEnabled: true)
                  inheritFrom 'default'
              }
          }
          
          stages {
              stage('debug') {
                  steps {
                      sh "echo in steps"
      
                      script {
                          sh "echo in script"
      
                          container('busybox') {
      
                              sh "echo in busybox container"
                          }
                      }
                  }
              }
          }
      }
      

      It hanging on in the last sh step inside of the `busybox` container.
      and it works if I using the default `jnlp` container or by removing the `inheritFrom` from agent definition.

      This is a major issue for running the pipelines using kubernetes plugin.

      as the workaround, I've rollback to the version `1.17.3`, all works.

            Assignee:
            Carlos Sanchez
            Reporter:
            jubel han
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: