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 availableCommon 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
- Fix the package name and version in
depsin rebar.config. - Refresh the dependency lock with
rebar3 upgrade. - 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/rebar3between runs.
Related guides
rebar3 "function undefined" / "unbound variable" compile error in CIFix rebar3 "Compiling failed" with "function X/N undefined" or "variable Y is unbound" in CI - the Erlang com…
opam "No solution found" dependency conflict in CIFix opam "No solution found for your installation request" in CI - the solver could not pick package versions…
Paket "Could not resolve dependencies" in CIFix Paket "Could not resolve dependencies" in CI - Paket's resolver found no version set that satisfies the c…