GitLab "job succeeded but artifacts missing": artifact debugging
Debugs GitLab pipelines where a job succeeds but its artifacts are missing. Use when the artifacts tab is empty or downstream jobs cannot find files an earlier job should have produced; the cause is usually a non-matching paths glob or a missing needs/dependencies link. Not for failing jobs, corrupt artifacts, or Pages deployment issues.
GitLab "job succeeded but artifacts missing": artifact debugging
TL;DR: Open the producing job's log and look at the Uploading artifacts lines at the end. Almost always the path glob matched nothing, so nothing was uploaded, and the downstream job correctly found nothing. Fix the path relative to the project root and confirm the log lists uploaded files.
WARNING: artifacts: no matching filesSteps
- Scroll to the end of the producing job's log and find the
Uploading artifacts...section. If it warns about no matching files, thepathsglob did not match anything.
Expected: You see exactly which paths were tried.
- Fix the paths to be relative to the project directory, not to wherever the script's working directory happened to be. Remember the job may have
cd'd into a subdirectory.
Expected: The next run's log lists the files being uploaded.
- Confirm the upload actually succeeded. Look for the
okafter the upload-to-coordinator line. A failed upload from a network blip or a full runner disk leaves the job green with nothing stored.
Expected: The log shows a successful upload with a file count.
- In the consuming job, check
needs:(ordependencies:) names the producing job. Without that link the job downloads nothing from it.
Expected: The downstream log shows Downloading artifacts for the right job.
- Check size and expiry. An artifact bigger than the project or instance limit fails the upload with a clear error, and
expire_indeletes artifacts before a later manual download.
Expected: Artifact size is under the limit and expiry covers your download window.
- Check
artifacts:when:. If it is set toon_failurethe job only uploads when it fails; a green job then legitimately produces nothing.
Expected: when matches the outcome you expect artifacts from.
Use this when
- A pipeline job is green but its artifacts tab is empty or says missing
- A downstream job fails because files an earlier job should have produced are not there
Not for this skill when
- The producing job itself failed. Fix the job first
- Artifacts exist but are corrupt. Different problem
- GitLab Pages did not deploy. That is a pages job issue, not artifacts
Variant phrasings
Job log shows "no matching files" for artifacts
The glob is wrong; steps 1 and 2 above.
Downstream job errors with "file not found" for a build output
The producer never uploaded it; work backward through the steps above.
Why it happens
The runner uploads artifacts to the coordinator when the job ends, resolving paths against the project directory. A glob that matches nothing is only a warning, not a failure, so the job stays green while storing nothing. Downstream jobs then download an empty set and fail later, far from the real cause.
Edge cases
- Untracked files need
artifacts:untracked: true; tracked-file globs ignore them silently - Dotenv reports need
artifacts:reports:dotenv, and they never appear as downloadable files - Cache is not artifacts: a cache miss never fails a job and cached files are not downloadable from the UI
needs:withoptional: truesilently skips a job that did not run
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_oUE8XwxXqs1rdevaswsHKQ
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.