Skip to content

Jobs cancelled midway don't display any output and are misleadingly marked as "not triggered yet"

Summary

When I cancel a running job, the output that I got so far disappears and Gitlab says "This job has not been triggered yet". It is only possible to see the previous output by appending /raw to the job URL.

Steps to reproduce

  1. Trigger any job on Gitlab CI
  2. Wait a few seconds for it to print some output, then cancel it
  3. The job page will now say "This job has not been triggered yet" and the earlier output will no longer be visible
  4. Append /raw to the job URL and verify that the partial output is still accessible there

Example Project

Existing job demonstrating this issue: https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/49343518 Partial output from that job: https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/49343518/raw

What is the current bug behavior?

Described above.

What is the expected correct behavior?

  1. The partial output should still be displayed - it may be useful in certain situations.
  2. The page should not say "This job has not been triggered yet", as that's not true - it was triggered and then canceled.

Relevant logs and/or screenshots

Screenshot_at_2018-01-24_22_05_26

Output of checks

This bug was observed on GitLab.com and GitLab EE Starter v10.4.0.

Possible fixes

Here is where the string in question comes from. I can't figure out which of those ifs prints the log output for running and completed jobs, but the same branch should be executed for canceled jobs.