jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-55585] Powershell plugin inside container hangs

Open
#452 4 comments 0 reactions 0 assignees View on GitHub
component:durable-task-plugin imported-jira-issue priority:blocker resolution:unresolved
Dominant language
Java
Stars
30
Forks
101
PR merge metrics
No merged PRs in 30d

Description

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 IDIMAGE COMMAND CREATED STATUS PORTS NAMES

xxxxalpine: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 PPIDC STIME TTY TIMECMD

adminis+ 537253500 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 -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

$ docker rm -f

[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 -eo pid,comm

---
Originally reported by chiranth, imported from: Powershell plugin inside container hangs


  • status: Open
  • priority: Blocker
  • component(s): durable-task-plugin
  • label(s): powershell
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 2025-12-09

Raw content of original issue

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

environment

```
Jenkins ver. 2.138.3

Powershell Plugin : 1.3

Docker Pipeline: 1.17
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.