opam "Sorry, no solution found" dependency conflict in CI
opam ran its dependency solver over the packages your project needs and could not find a version set that satisfies every constraint at once. It prints the clashing requirements and installs nothing.
What this error means
opam install fails with "[ERROR] Could not determine a set of packages to install" and "Sorry, no solution found, exiting", followed by the constraints that conflict.
[ERROR] Could not determine a set of packages to install:
- dune >= 3.10 is not available because the package is pinned to 2.9.3
- your request is rejected
Sorry, no solution found, exitingCommon causes
Conflicting version constraints or a stale pin
A pin or a manifest lower bound demands a version another dependency forbids, so no coherent install set exists in the switch.
An out-of-date opam repository
The repo snapshot in CI predates a release the solver needs, so it never sees the version that would satisfy the request.
How to fix it
Update the repository and drop stale pins
- Run
opam updateso the solver sees current versions. - Remove any leftover pins that block the needed release.
- Re-install dependencies from the project manifest.
opam update
opam install . --deps-only --yesAsk the solver to explain the conflict
Run with verbose output to see exactly which two constraints clash, then loosen the over-tight bound in your .opam or dune-project.
opam install . --deps-only --verboseHow to prevent it
- Run
opam updatebefore installing in CI so the solver is current. - Remove pins once they are no longer needed.
- Keep version bounds in the opam file as loose as the project allows.