Troubleshooting & FAQ
Turn on debug logging first
The plugin logs detail that it does not return to the Pact framework, which only receives a short message. Set RUST_LOG=debug in the environment that launches the plugin process and check the plugin’s standard error output before digging further. See Logging.
If a response says Multiple errors detected and logged, please check logs, the individual causes are only in the plugin log, not in the error returned to your test framework.
Common errors
| Error | Cause and fix |
|---|---|
|
The interaction was configured with no |
|
|
|
|
|
The path in |
|
The schema embedded in the Pact file (looked up by |
|
|
|
The interaction being verified was not built by this plugin, or the Pact file’s |
|
The embedded schema lookup described in Schema Compatibility failed on both paths: the interaction has no A common cause: a pact-jvm JUnit5/JUnit4/Spock consumer test with several |
|
The actual and expected interaction bodies were tagged with different record names in their content type. This points at a mismatch between the consumer test and the provider/mock response, not the schema itself. |
|
The interaction’s content type is not one this plugin owns, or is missing the |
|
The field’s Avro type is a union that is not a simple two-branch |
|
A nullable (union) field could not resolve a non-null branch to validate against. Check the union only has one non-null type. |
|
A required field (no default value, not nullable) was left out of the test configuration. Add a matching rule expression for it, or give the field a default/make it nullable in the schema. |
|
The field’s Avro type is not one of |
|
The string given for a field is not a valid Matching Rule definition expression, or uses a rule type this plugin does not implement yet. Compare against the working examples in Testing. |
|
Every gRPC call to the plugin must carry the |
FAQ
- Why does my test fail with an error instead of a normal assertion failure?
-
Configuration problems (missing/invalid schema, missing fields, unsupported types) are detected while the plugin builds the interaction or compares content, before any matching happens. They come back as a plugin
errorstring rather than a per-field mismatch. - Do I need the schema registry running to verify a provider?
-
No. This plugin has no external schema registry integration. The schema used at verification time is the one embedded in the Pact file at consumer-test time (see Schema Compatibility), not a schema fetched from a registry or re-read from disk.
- Can I use
matching(regex, …)or other Pact matchers? -
Field values are parsed as standard Pact Matching Rule definition expressions, so any expression the Pact plugin framework’s rule parser understands is expected to work; unsupported rule types fail with
Rule '<rule>' not supported for now. If you hit that, check the linked matching-rule-definition-expressions documentation and open an issue with the expression you tried. - My schema has a field with a three-way union — why is it rejected?
-
The plugin only special-cases the
[null, T]shape for optional fields. Wider unions are not supported for matching; flatten the schema or split it into separate fields/records.
Want to help? Learn how to contribute to the Compress4J docs ›