Skip to content
Latchkey

cabal "encountered missing dependencies" in CI

The cabal solver could not find a set of package versions satisfying every bound. Some dependency or version constraint cannot be met.

What this error means

cabal build aborts with Encountered missing or private dependencies, listing the packages and bounds it could not satisfy. It is deterministic given the index and constraints.

stack
Resolving dependencies...
Error: cabal: Encountered missing or private dependencies:
aeson >=2.2 && <2.3
text ==1.2.*

Common causes

Conflicting or too-tight bounds

Two dependencies require incompatible versions of a shared package, or a bound excludes every available release.

Stale package index

A package or version exists upstream but the local Hackage index is out of date, so the solver cannot see it.

How to fix it

Update the package index

Refresh Hackage so the solver sees current releases.

CI step
cabal update
cabal build all

Relax or align the bounds

  1. Loosen overly tight upper bounds that exclude valid versions.
  2. Use a cabal.project.freeze to lock a known-good set.
  3. Pick an index-state for reproducible resolution.

Pin a working plan

Commit a freeze file so CI resolves the same versions every run.

CI step
cabal freeze

How to prevent it

  • Commit a cabal.project.freeze for reproducibility.
  • Run cabal update before building in CI.
  • Keep version bounds reasonable.

Related guides

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