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
- Run
buf dep updateto pin all buf.yaml deps into buf.lock. - Commit the updated buf.lock.
- Re-run so CI resolves against the committed lock.
Terminal
buf dep update
git add buf.lockRetry 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 updatewhenever you add or bump a dependency. - Commit buf.lock so dependency versions are pinned and reproducible.
- Retry transient registry-network failures automatically.
Related guides
buf "buf.lock is out of date" (buf dep update) in CIFix "buf.lock is out of date" in CI - the committed lockfile does not match the deps declared in buf.yaml. Ru…
buf module "not found" on the Buf Schema Registry in CIFix a buf "module not found" error from the Buf Schema Registry in CI - the module reference is wrong, the mo…
buf "buf build" Failure compile error in CIFix "buf build" compile errors in CI - buf could not compile a proto because of a syntax error or an unresolv…