GitLab CI "dependencies job ... not found" - Not in a Previous Stage
dependencies lists which earlier jobs supply artifacts to the current job. Naming a job that does not exist, or one not in a previous stage, makes the artifact download invalid.
What this error means
Validation or the job log reports that a dependency job was not found or is not in a previous stage, and the expected artifacts are missing.
gitlab-ci
This GitLab CI configuration is invalid:
'deploy' job: undefined dependency: 'package'
('package' is not defined in a prior stage)Common causes
Job name typo
The dependencies entry does not match any defined job name.
Dependency not in an earlier stage
dependencies, like needs, can only reference jobs from a previous stage.
Mixing dependencies with needs incorrectly
When needs is present, dependencies must be a subset of the needed jobs.
How to fix it
Reference a real earlier-stage job
Match the exact job name and ensure it runs in a prior stage.
.gitlab-ci.yml
stages: [build, deploy]
package:
stage: build
artifacts:
paths: [dist/]
deploy:
stage: deploy
dependencies: [package]How to prevent it
- Keep dependencies a subset of needs when both are used.
- Match dependency names exactly to defined jobs.
- Ensure every dependency runs in an earlier stage.
Related guides
GitLab CI "needs job exists but is not in an earlier stage"Fix GitLab CI needs config where the named job exists but is in the same or a later stage - needs can only de…
GitLab CI "This job depends on other jobs with expired/erased artifacts"Fix GitLab CI jobs that fail because upstream artifacts they need have expired or been erased - the dependenc…
GitLab CI "cache:key:files config requires at least one file"Fix GitLab CI cache:key:files invalid - the files list is empty, has more than two entries, or points at path…