Skip to content
Latchkey

rebar3 "Dependency not available" in CI

rebar3 tried to resolve a dependency from rebar.config and could not retrieve it. The Hex package name or version is wrong, or the git/Hex source is unreachable from the runner.

What this error means

rebar3 compile fails with "Dependency X not available" or "Failed to fetch and copy dep", naming the dependency it could not obtain.

rebar3
===> Verifying dependencies...
===> Failed to fetch and copy dep: {pkg,<<"cowboyy">>,<<"2.10.0">>,...}
===> Dependency cowboyy not available

Common causes

A wrong package name or version

The Hex package name is misspelled or the pinned version does not exist, so the fetch returns nothing.

The dependency source is unreachable

A git ref or Hex endpoint is temporarily unreachable from the runner, so rebar3 cannot copy the dep.

How to fix it

Correct the dependency entry and refetch

  1. Fix the package name and version in deps in rebar.config.
  2. Refresh the dependency lock with rebar3 upgrade.
  3. Re-run rebar3 compile.
rebar.config
{deps, [{cowboy, "2.10.0"}]}.

Cache deps and retry transient fetches

Persist the rebar3 cache so resolved deps are reused, and retry when a source is momentarily unreachable.

.github/workflows/ci.yml
- uses: actions/cache@v4
  with:
    path: ~/.cache/rebar3
    key: rebar3-${{ hashFiles('rebar.lock') }}

How to prevent it

  • Verify Hex package names and versions before pinning them.
  • Commit rebar.lock so CI fetches the same resolved deps.
  • Cache ~/.cache/rebar3 between runs.

Related guides

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