Troubleshooting
Real failure modes and the messages Parity prints for them — everything unchanged, everything inconclusive, blocked mutations, refused connections, noisy fields, flagged IDs and configuration errors.
Each section starts from what you see. The messages are the ones the CLI prints.
Two commands answer most questions before any request is sent:
parity validate --list
parity compare --dry-run#Everything is unchanged
Both environments are the same server.
warning: baseline and candidate point at the same URL; every scenario will be unchanged by constructionCheck environments.baseline.url and environments.candidate.url, and any --baseline / --candidate flags or PARITY_BASELINE_URL / PARITY_CANDIDATE_URL variables that override them. The run header prints the two URLs that were actually used.
When both URLs reach the same process, read-only scenarios are unchanged and workflows that create resources may instead collide with themselves — each step is sent twice to one server, so the second "create" can be rejected as a duplicate:
✗ Customer without a phone number workflow · 2 steps · 1ms
step 1 · Create a customer without a phone · POST /customers
~ Status changed from 201 Created to 409 Conflict.Both URLs are different, but serve the same build. Parity cannot tell. Record what is deployed with --baseline-revision and --candidate-revision so the report shows it, and check your deployment step.
The scenarios do not reach the change. Parity compares the scenarios it is given. If the changed behaviour depends on state, single requests generated from OpenAPI will not see it; write a workflow that sets up the state and reads it back. parity validate --list shows exactly which scenarios exist.
A rule is hiding it. A broad ignore path such as $..id or $.data removes whole subtrees from comparison, and body: ignore removes the body. Review comparison.ignore and per-source compare blocks.
#Everything is inconclusive
Authentication is failing in both environments.
? Admin statistics
Step `Admin statistics` was rejected by both environments (401 / 401), so the behaviour behind
authentication was never exercised. Check `auth` for each environment; if this response is the
behaviour under test, declare it with `expect: { status: 401 }`.Two versions that both answer 401 agree with each other, but nothing behind the login was tested, so Parity does not call it unchanged. Fix the environment's auth: check that the variable holding the token is exported in the shell (or CI job) that runs Parity, and that the token is valid for both environments. Each environment has its own auth block; they often need different tokens.
If a 401 is what you mean to test — an endpoint that must reject anonymous callers — say so on the step:
requests:
- name: Admin statistics require a token
path: /admin/stats
headers: { Authorization: "" }
expect: { status: 401 }Rate limiting.
Step `…` was rate limited (429). Lower execution.concurrency or raise the test environment's limits.Lower execution.concurrency (or pass --concurrency 1), or raise the limit in the test environment.
A setup step or an expectation fails in both. A message such as expected status 201 but got 404 in the baseline and 404 in the candidate, so the intended behaviour was not exercised means the workflow itself is wrong for these environments: a path that does not exist, a fixture that is missing, a required field the API now demands in both versions.
Nothing was compared. If every scenario is inconclusive, skipped or errored, the run fails with:
✗ Nothing was compared
policy: no scenario produced a comparison — nothing was verified → exit 4That is deliberate: a run that verified nothing must not pass.
#Mutating scenarios are skipped
– 1 skipped
Not sent: this scenario makes mutating requests and the baseline environment is not a local
address. Point Parity at a disposable test environment, then set `allow_mutations: true` on that
environment or pass --allow-mutations.POST, PUT, PATCH and DELETE are only sent to local addresses by default. If the environment named in the message really is a disposable test environment, authorise it:
environments:
baseline:
url: https://baseline.staging.example.test
allow_mutations: true
candidate:
url: https://candidate.staging.example.test
allow_mutations: trueIf it is not, do not. See the mutation guard for what counts as local.
To run only the read-only part of an OpenAPI source against such an environment, restrict generation instead:
generation:
methods: [GET, HEAD]#Connection refused
! Invoice totals
The candidate environment failed: connection refused. This is an infrastructure failure, not a
behavioural result.
✗ 1 scenario could not be executed
policy: 1 scenario could not be executed (environment errors) → exit 2Nothing is listening at that address. Common causes:
- The server has not finished starting. In CI, wait for a health endpoint before running Parity.
- The wrong port, or
localhostmeaning something else: inside a container,localhostis the container. Use the service name, orhost.docker.internal. - The server crashed during the run. Earlier scenarios will have succeeded; check the server's log.
For a server that is slow to accept connections, execution.retries retries requests that never reached the server. Requests that were answered are never retried.
Related environment errors, all exit code 2:
| Message contains | Cause |
|---|---|
host name could not be resolved | DNS: a typo in the host, or a name that only resolves on another network. |
TLS handshake failed | A certificate the runner does not trust, or https against a plain-HTTP port. |
timed out / no complete response within … ms | The server did not answer within execution.timeout_ms. Raise it, or set timeout_ms on the slower environment. |
hit a gateway/availability error | A 502, 503 or 504 — usually a proxy in front of a server that is down. Adjust execution.infrastructure_statuses if one of these is a real response of your API. |
#Fields that change on every call
? GET /health · valid request
Every difference also appears between two runs of the baseline, so it cannot be attributed to
the candidate. Add ignore rules for: $.uptime_ms.Parity called the baseline twice and saw the same fields differ, so it will not blame the candidate. Add the suggested paths to comparison.ignore:
comparison:
ignore:
- $.uptime_ms
- $..created_at
- $.requestIdThis check only runs for read-only scenarios, because replaying a mutation would change state. In a workflow, a timestamp or request ID shows up as an ordinary change at the same path in many scenarios; ignore it the same way, globally or in the workflow's own compare block.
For numbers that differ slightly rather than randomly, use a tolerance instead of ignoring the field.
#IDs are flagged in single requests
~ `$.id` changed from "pay_1016" to "pay_6bfe93df4c".Each environment generates its own identifiers. In a workflow, IDs captured with extract are correlated and not reported. A single request — everything generated from OpenAPI or imported from Postman — has no earlier step to capture from, so a generated ID in its response is a difference.
Ignore the field for that source only:
sources:
- openapi: ./openapi.yaml
compare:
ignore: [$.id]
- workflows: ./tests/parity/Do not ignore $..id globally: in workflows that would also hide a response that returns the wrong object.
If an ID is flagged inside a workflow, either it was never extracted (add it to extract in the step that creates it), or it is genuinely a different object — as in the output above, where a retried payment should have returned the original payment and returned a new one.
#Configuration errors
Configuration problems exit with code 3 before any request is sent.
| Message | Fix |
|---|---|
no `parity.yaml` in this directory | Run parity init, pass --config, or pass a source flag such as --openapi. |
unknown field `comparision`, expected one of … | A misspelt or misplaced key. The message has the line and column, and lists the keys valid there. |
missing field `version` | Add version: 1 at the top of the file. |
environment variable not set: API_TOKEN | Export the variable, or give it a default with ${API_TOKEN:-value}. |
no URL configured for the baseline environment | Set environments.baseline.url or pass --baseline. |
invalid JSONPath `…` | Only a subset of JSONPath is supported; filters and slices are not. |
auth needs exactly one of `bearer`, `basic` or `header` | An auth block with none or several of them. |
sources[0] must define exactly one of `openapi`, `workflows`, `requests` or `postman` | Split the entry into one source per item. |
uses `{{order_id}}`, which nothing defines | Add the variable to the workflow's variables, to both environments' variables, or extract it in an earlier step. |
two scenarios share the id `…` | Give one of them an explicit id. |
is not an OpenAPI 3.x document | Swagger 2.0 documents must be converted to OpenAPI 3.x first. |
./parity.yaml already exists | parity init does not overwrite; pass --force if you mean to. |
unknown policy action `…` (use fail, warn or ignore) | --policy takes name=action, e.g. --policy inconclusive=fail. |
A source that loads but produces nothing is a warning, not an error:
openapi.yaml: no scenarios were generated (check `include`/`exclude`, `generation.methods` and `generation.variations`)#Exit codes
| Code | Meaning | First thing to check |
|---|---|---|
0 | No policy violation | — |
1 | Behavioural changes | The ✗ blocks, or parity report --open. |
2 | Environment errors | The ! blocks: is each environment up and reachable from where Parity runs? |
3 | Invalid configuration or usage | The error: line and its hint. parity validate reproduces it without sending requests. |
4 | Inconclusive, or nothing was compared | The ? and – blocks: authentication, blocked mutations, failing setup. |
130 | Cancelled | Interrupted, or execution.max_duration_s was reached. |
See exit codes for how policies map to them.
#Still stuck
Run with --verbose to print every scenario and every difference, and open the HTML report (parity report --open) to see the exact requests and responses for a step. If the behaviour looks wrong, open an issue on the GitHub repository with the redacted report or the relevant scenario.