Skip to content
Latchkey

Mix "deps.get" could not fetch a dependency

mix deps.get failed to obtain a dependency. A git ref does not exist, authentication failed, or the network call to fetch the package broke.

What this error means

deps.get aborts with a fetch error - a missing git ref, an auth failure, or a Hex network error. Git/auth issues are deterministic; raw network failures are transient.

mix
** (Mix) Command "git fetch --force --quiet ..." failed
fatal: couldn't find remote ref v9.9.9
Unable to fetch dependency :widget

Common causes

Bad git ref or tag

A dependency points at a branch, tag, or SHA that no longer exists on the remote.

Private repo without credentials

A git dependency over HTTPS/SSH needs credentials CI does not have.

Transient network failure

The ref is valid but the fetch times out or the host returns an error; a re-run succeeds.

How to fix it

Point at a valid ref

Update mix.exs to an existing tag or commit.

mix.exs
{:widget, git: "https://github.com/org/widget.git", tag: "v1.2.0"}

Provide credentials for private deps

  1. Inject a deploy key or token from CI secrets.
  2. Use SSH or a token-authenticated HTTPS URL.
  3. Avoid committing credentials into mix.exs.

Re-run on transient failures

A network-level fetch error usually clears on retry. On Latchkey managed runners, self-healing auto-retries transient dependency fetch failures.

How to prevent it

  • Pin git deps to immutable tags or SHAs.
  • Store git credentials in CI secrets.
  • Cache the deps directory between runs.

Related guides

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