jenkinsci / jenkinsci/postbuild-task-plugin

[JENKINS-26994] Post-build task fails if job is aborted

Open
#54 2 comments 0 reactions 0 assignees View on GitHub
component:postbuild-task-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
8
Forks
19
Avg merge
38m
Merged PRs (30d)
1

Description

Jenkins is running on a windows 2003 server

In the job config postbuild task part:

log text : .

script : dir

When the job is successed or failed, the postbuild task works fine

When the job is aborted (manually stopped or timeout case) I get this kind of logs:

Running script :dir

[workspace] $ cmd /c call C:\Users\XXX\AppData\Local\Temp\2\hudson13287273761205392.bat

Exception when executing the batch command : null

Build step 'Post build task' marked build as failure

Finished: ABORTED

C:\Users\XXX\AppData\Local\Temp\2 is the java.io.tmpdir data

I ran a non-stop script listing files in this folder, the temp script

hudsonxxxxxxxx.bat is never written in this folder

in the jenkins log I have a java exception generated each time a job is aborted :

java.lang.InterruptedException

at java.lang.ProcessImpl.waitFor(Native Method)

at hudson.Proc$LocalProc.join(Proc.java:319)

at hudson.Launcher$ProcStarter.join(Launcher.java:345)

at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:82)

at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)

at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)

at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)

at hudson.model.Build$RunnerImpl.build(Build.java:178)

at hudson.model.Build$RunnerImpl.doRun(Build.java:139)

at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)

at hudson.model.Run.run(Run.java:1438)

at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)

at hudson.model.ResourceController.execute(ResourceController.java:88)

at hudson.model.Executor.run(Executor.java:239)

It is a main issue in my professional project.

From my web research it appears that post build task is supposed to work fine even when the job is aborted

---
Originally reported by willou, imported from: Post-build task fails if job is aborted


  • status: Open
  • priority: Major
  • component(s): postbuild-task-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 4
  • imported: 20251223-222157

Raw content of original issue

Jenkins is running on a windows 2003 server
In the job config postbuild task part:
log text : .
script : dir
When the job is successed or failed, the postbuild task works fine

When the job is aborted (manually stopped or timeout case) I get this kind of logs:
Running script :dir
[workspace] $ cmd /c call C:\Users\XXX\AppData\Local\Temp\2\hudson13287273761205392.bat
Exception when executing the batch command : null
Build step 'Post build task' marked build as failure
Finished: ABORTED

C:\Users\XXX\AppData\Local\Temp\2 is the java.io.tmpdir data

I ran a non-stop script listing files in this folder, the temp script
hudsonxxxxxxxx.bat is never written in this folder

in the jenkins log I have a java exception generated each time a job is aborted :
java.lang.InterruptedException
at java.lang.ProcessImpl.waitFor(Native Method)
at hudson.Proc$LocalProc.join(Proc.java:319)
at hudson.Launcher$ProcStarter.join(Launcher.java:345)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:82)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)
at hudson.model.Run.run(Run.java:1438)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)

It is a main issue in my professional project.
From my web research it appears that post build task is supposed to work fine even when the job is aborted

environment

```
Jenkins 1.466.1

postbuild-task plugin 1.8
```

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.