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.
Error: can-i-deploy: no records found
There is no matrix for the given selectors:
pacticipant: web-consumer, version: 5f3a1c, environment: productionCommon 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
- Confirm the version string equals the one used at publish (the same sha).
- Confirm the environment name is registered in the broker.
- Re-run can-i-deploy with the corrected selectors.
# 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.
pact-broker record-deployment \
--pacticipant web-consumer --version "$GIT_SHA" \
--environment productionHow 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.