Skip to content
Latchkey

GitLab CI "artifacts not found" / Expired Between Stages

A later job expected files from an earlier one and found nothing. The upstream artifacts expired, were never declared, or the consuming job did not pull them in.

What this error means

A downstream job fails because expected build output is missing - "No such file or directory" for an artifact path, or the job log shows it downloaded no artifacts at all.

Job log
$ ./deploy.sh dist/app
./deploy.sh: line 3: dist/app: No such file or directory
# upstream artifacts expired or were never passed

Common causes

Artifacts expired before use

A short expire_in (or default expiry) removed the artifact before the consuming job ran - common when a pipeline is retried later.

Producer did not declare artifacts

The upstream job built the files but never declared artifacts:paths, so nothing was uploaded to pass downstream.

Consumer pulled the wrong dependencies

With dependencies: or needs:artifacts, the consuming job only receives artifacts from the listed jobs. An omitted or misnamed job yields no files.

How to fix it

Declare artifacts and keep them long enough

.gitlab-ci.yml
build:
  stage: build
  script: make
  artifacts:
    paths: [dist/]
    expire_in: 1 day

Pull the right artifacts downstream

Name the producing job so the consumer actually receives its artifacts.

.gitlab-ci.yml
deploy:
  stage: deploy
  needs:
    - job: build
      artifacts: true
  script: ./deploy.sh dist/app

How to prevent it

  • Set expire_in longer than your retry window for artifacts you depend on.
  • Always declare artifacts:paths on jobs whose output is consumed later.
  • Use needs:artifacts / dependencies to pass exactly the right outputs.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →