Skip to content

CI artifacts missing when job exceeds deadline with when: always

Summary

CI artifacts are not fetched for jobs that exceed job deadline, with artifacts: when: always set.

Steps to reproduce

  • Set CI job timeout to 10 minutes
  • Write .gitlab-ci.yml containing:
default:
  image: alpine:latest

stages:
- test

test:
  stage: test
  before_script:
  - mkdir logs
  - date > logs/before.log
  artifacts:
    when: always
    paths:
    - logs
  script:
  - date > logs/script.log
  - sleep $((12 * 60))
  - date >> logs/script.log
  • run the job

Example Project

https://gitlab.com/dmlary/gitlab-ci-timeout-no-artifacts

What is the current bug behavior?

Currently, CI gets an error when fetching artifacts, and debugging data is lost.

What is the expected correct behavior?

CI should fetch the artifacts and they should be available for the job.

Relevant logs and/or screenshots

Screen_Shot_2020-11-17_at_10.54.12_AM

Output of checks

This bug happens on GitLab.com

Possible fixes

Support artifacts on timeout with always and add always_except_timeout

Edited by Jackie Porter