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.
$ ./deploy.sh dist/app
./deploy.sh: line 3: dist/app: No such file or directory
# upstream artifacts expired or were never passedCommon 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
build:
stage: build
script: make
artifacts:
paths: [dist/]
expire_in: 1 dayPull the right artifacts downstream
Name the producing job so the consumer actually receives its artifacts.
deploy:
stage: deploy
needs:
- job: build
artifacts: true
script: ./deploy.sh dist/appHow to prevent it
- Set
expire_inlonger than your retry window for artifacts you depend on. - Always declare
artifacts:pathson jobs whose output is consumed later. - Use
needs:artifacts/dependenciesto pass exactly the right outputs.