Skip to content

Pipeline using previous pipeline artifacts

Summary

Yesterday 2 of our pipelines started failing on our self hosted pipeline. Rerunning them solved the issue so I started diggging into the issue. I found out that for some strange reason artifacts from previous pipeline are passed to my current pipeline. If current fails due to it and I run it again, it's clean again.

Steps to reproduce

  1. Add Gitlab CI like this:
stages:
  - test 1
  - test 2

Prepare certs:
  stage: test 1
  needs: []
image: debian:latest
  variables:
    GIT_STRATEGY: none
  script:
    - if [ -d "ansible" ]; then ls -lah ansible; fi ## Added for debugging our issue
    - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/global-services/ansible.git
    - cd ansible
    - do something here
  artifacts:
    paths:
      - ansible/roles/common/files/certificate_path/
    expire_in: 1 week


Test:
  image: debian:latest
  stage: test 2
  needs: ["Prepare certs"]
  script:
    - ls -lah ansible/roles/common/files/certificate_path/
    - cp -R ansible/roles/common/files/certificate_path/* certs/
    - ls -lah certs/
  1. Now every second time we run the pipeline, git clone will fail because ansible/roles/common/files/certificate_path/ already exists

Example Project

Could not reproduce with community runners on gitlab.com.

  • Our self hosted gitlab is running in docker with version ee-13.9.3 (it happened with 13.9.0 also)
  • Our runners are also running in docker and are on version 13.9.0

What is the current bug behavior?

Pipeline sees previous pipeline artifacts

What is the expected correct behavior?

It should start from clean state

Relevant logs and/or screenshots

First job that is successful: brave_wMX7clLeVF

Second run that fails: TQgcjBSqgL