Skip to content
Latchkey

buf "unable to resolve" dependency in CI

buf resolves module dependencies from buf.lock. If a dep in buf.yaml is not pinned in buf.lock, or the lock is stale, buf cannot resolve the import graph and fails before build or generate.

What this error means

buf fails with a message that it is unable to resolve a dependency, or that buf.lock is missing an entry for a dep declared in buf.yaml.

buf
Failure: unable to resolve dependency "buf.build/googleapis/googleapis":
no entry in buf.lock; run "buf dep update"

Common causes

buf.lock is stale or missing a dep

A dependency added to buf.yaml was never locked, so buf has no pinned commit to resolve it against.

The registry is unreachable at resolve time

A network block or outage prevents buf from downloading the dependency module referenced in buf.lock.

How to fix it

Update and commit buf.lock

  1. Run buf dep update to pin all buf.yaml deps into buf.lock.
  2. Commit the updated buf.lock.
  3. Re-run so CI resolves against the committed lock.
Terminal
buf dep update
git add buf.lock

Retry a transient registry outage

If buf.lock is current, a resolve failure is usually a transient network drop; re-running the job clears it.

How to prevent it

  • Run buf dep update whenever you add or bump a dependency.
  • Commit buf.lock so dependency versions are pinned and reproducible.
  • Retry transient registry-network failures automatically.

Related guides

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