Skip to content
Latchkey

Pact "can-i-deploy ... no records found" in CI

can-i-deploy could not find any matrix rows for the pacticipant and version you asked about. Unlike "Computer says no" (a known failure), "no records found" means the broker has nothing recorded for that name, version, or environment.

What this error means

can-i-deploy exits with "there is no matrix" or "no records found" for the pacticipant/version, often because the version string or environment name is wrong.

Pact
Error: can-i-deploy: no records found
There is no matrix for the given selectors:
pacticipant: web-consumer, version: 5f3a1c, environment: production

Common causes

The version was never published or has a different string

The --version passed to can-i-deploy does not match any published consumer version, so no matrix rows exist.

The environment name does not exist in the broker

The --to-environment value is not a registered environment, so there is nothing recorded to gate on.

How to fix it

Match version and environment to what exists

  1. Confirm the version string equals the one used at publish (the same sha).
  2. Confirm the environment name is registered in the broker.
  3. Re-run can-i-deploy with the corrected selectors.
Terminal
# list environments the broker knows
pact-broker list-environments --broker-base-url "$PACT_BROKER_BASE_URL"

Record deployments so environments have data

Use record-deployment after a deploy so future can-i-deploy checks against that environment have matrix rows.

Terminal
pact-broker record-deployment \
  --pacticipant web-consumer --version "$GIT_SHA" \
  --environment production

How to prevent it

  • Use the identical version string at publish and at can-i-deploy.
  • Register environments and record deployments so the matrix is populated.
  • Fail clearly when no records exist rather than treating it as pass.

Frequently asked questions

What causes ""no records found""?
The --version passed to can-i-deploy does not match any published consumer version, so no matrix rows exist.
How do I fix "no records found"?
Match version and environment to what exists

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card