runner icon indicating copy to clipboard operation
runner copied to clipboard

Ephemeral runners unable to run workflows, only a single job

Open dv01d opened this issue 11 months ago • 3 comments

Describe the bug The first job executed on an ephemeral runner always triggers ACTIONS_RUNNER_HOOK_JOB_COMPLETED when this should be reserved for the end of a workflow.

To Reproduce Steps to reproduce the behavior:

  1. Create an ephemeral runner
  2. have two jobs in a workflow depend on it
  3. First job triggers ACTIONS_RUNNER_HOOK_JOB_COMPLETED, which deletes the runner
  4. Second, or subsequent jobs either wait forever or die part way through as the ephemeral runner is deleted

Expected behavior ACTIONS_RUNNER_HOOK_JOB_COMPLETED should be only triggered at the end of a designated workflow, not each job.

Runner Version and Platform

Latest, self hosted ephemeral

OS of the machine running the runner? OSX/Windows/Linux/... Linux, nothing to do with OS

What's not working?

Jobs hang, don't finish, or error out in a workflow in the UI.

Job Log Output

Runner and Worker's Diagnostic Logs

dv01d avatar Jan 07 '25 02:01 dv01d

More importantly ACTIONS_RUNNER_HOOK_JOB_COMPLETED seems to only run AFTER the first job, but fails to be executed after subsequent jobs. Conversely ACTIONS_RUNNER_HOOK_JOB_STARTED always runs at the beginning of a job, but the JOB_COMPLETED doesn't.

dv01d avatar Jan 17 '25 20:01 dv01d

Hello @dv01d,

With ephemeral runners, they execute only a single job—not the entire workflow.

The hooks ACTIONS_RUNNER_HOOK_JOB_STARTED and ACTIONS_RUNNER_HOOK_JOB_COMPLETED are triggered before a job starts and after it ends, respectively.

Do you see any workflow logs that ACTIONS_RUNNER_HOOK_JOB_COMPLETED hook is executed/run ? Are there some errors ?

In my setup, the hooks are working as expected. The ACTIONS_RUNNER_HOOK_JOB_COMPLETED hook is triggered after every end of job

MaUhlik-cen56998 avatar Jan 26 '25 19:01 MaUhlik-cen56998

No errors, it just doesn’t get executed. Perhaps as it was intended to only run for a single job. Seems strange that it could or would pick up any subsequent jobs if it was intended to only run a single job. Although even stranger that it runs the job started when it is running additional jobs, but never the job completed.

dv01d avatar Jan 26 '25 23:01 dv01d