jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-65409] If docker container fails to start, Jenkins should run "docker logs"

Open
#667 0 comments 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

Please attempt to run "docker logs" if a container fails to start using "docker.image().inside {}" or "withDockerContainer"

 

Currently, if a docker container fails to run in a Pipeline build (i.e., "docker top" is not able to locate the running container), the following message is displayed:

process apparently never started in /home/jenkins/workspace/my/workspace@​tmp/durable-9e096821

(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)

After this, Jenkins runs "docker stop" and "docker rm" to get rid of the container.

Instead, when "docker top" fails, Jenkins should attempt to run "docker logs" on the container before removing it. The original failure should be rethrown regardless of whether docker logs fails.

 

It's not clear by default what the source of the problem might be, and it's very difficult for a user without Jenkins admin access to find a workaround.

 

---
Originally reported by rmorrise, imported from: If docker container fails to start, Jenkins should run "docker logs"


  • status: Open
  • priority: Minor
  • component(s): docker-workflow-plugin
  • label(s): docker, docker-workflow-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-07

Raw content of original issue

Please attempt to run "docker logs" if a container fails to start using "docker.image().inside {}" or "withDockerContainer"

 

Currently, if a docker container fails to run in a Pipeline build (i.e., "docker top" is not able to locate the running container), the following message is displayed:
process apparently never started in /home/jenkins/workspace/my/workspace@tmp/durable-9e096821
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
After this, Jenkins runs "docker stop" and "docker rm" to get rid of the container.

Instead, when "docker top" fails, Jenkins should attempt to run "docker logs" on the container before removing it. The original failure should be rethrown regardless of whether docker logs fails.

 

It's not clear by default what the source of the problem might be, and it's very difficult for a user without Jenkins admin access to find a workaround.

 

  • environment: Jenkins 2.263.3

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.