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

Powershell plugin inside container hangs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • durable-task-plugin
    • Jenkins ver. 2.138.3
      Powershell Plugin : 1.3
      Docker Pipeline: 1.17

      The powershell plugin when used within docker container enters a hang state. I would expect it to fail if powershell core is not installed, which works if the same thing is ran outside docker. The jenkins agent is a Ubuntu 16.04 machine.

      I dont see any other process also running within the docker container in the hung state except cat

      //

      CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
      xxxx alpine:latest "cat" 5 minutes ago Up 5 minutes ecstatic_galileo
      PS /home/administrator> docker top 2a2a21fe5dbc
      WARNING: Error loading config file: /home/administrator/.docker/config.json: open /home/administrator/.docker/config.json: permission denied
      UID PID PPID C STIME TTY TIME CMD
      adminis+ 5372 5350 0 07:39 pts/0 00:00:00 cat

      //Sample Jenkinsfile

      timestamps {

      //linux docker
      node("LinuxDocker") {

      //Works
      docker.image("alpine:latest").inside

      { sh("echo command inside docker") }

      // Hangs

      docker.image("alpine:latest").inside

      { powershell(script:"echo command inside docker") }

      }

      }

      Hung output
      ==================================================
      [Pipeline]

      { [Pipeline] sh 20:39:30 + echo command inside docker 20:39:30 command inside docker [Pipeline] }

      $ docker top <xxxxguid> -eo pid,comm
      WARNING: Error loading config file: /home/administrator/.docker/config.json: open /home/administrator/.docker/config.json: permission denied
      $ docker stop --time=1 <xxxxguid>
      $ docker rm -f <xxxxguid>
      [Pipeline] // withDockerContainer
      [Pipeline] sh
      20:39:32 + docker inspect -f . alpine:latest
      20:39:32 WARNING: Error loading config file: /home/administrator/.docker/config.json: open /home/administrator/.docker/config.json: permission denied
      20:39:32 .
      [Pipeline] withDockerContainer
      20:39:32 dockerLinux does not seem to be running inside a container
      $ docker run -t -d -u 1000:1000 -w /home/agent/workspace/ation_test_dockertestexecute -v /home/agent/workspace/ation_test_dockertestexecute:/home/agent/workspace/ation_test_dockertestexecute:rw,z -v /home/agent/workspace/ation_test_dockertestexecute@tmp:/home/agent/workspace/ation_test_dockertestexecute@tmp:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** alpine:latest cat
      [Pipeline] {
      [Pipeline] powershell
      $ docker top <hguid> -eo pid,comm

            Unassigned Unassigned
            chiranth Chiranth Bagivalu Ramaswamy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: