Skip to content
Latchkey

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

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