Dustin Iser
11/21/2024, 2:02 PMPlugin protobuf failed to validate the interaction: Plugin configuration item with key 'ea4217bffbf17f94e01b461796d57ad4' is required. Received config ["794aed6a7e746a9d0688e0a45801456b"]
I have several questions about this:
• How do I debug it? When I look at the code it appears that these keys are MD5 hashes of the proto descriptors. How do I figure out what's different?
• How is it failing? When I debug the tests, it appears that it's failing with a request sent to the broker. When I look at the request payload, it appears that the expected descriptor keys are there. Yet the broker still returns an error.
• Why do I care about the descriptor keys? It's not immediately apparent to me why I should care if the descriptor keys are different. Isn't it possible that the protos used by the consumer and the provider to be different and yet the contracts still be satisfied?Yousaf Nabi (pactflow.io)
How do I debug it?Have you set debug or trace logs, download the pact file so you can run it locally. isolate individual interactions with
PACT_DESCRIPTION="<SOME DESC>"
to see if you can isolate.
When I debug the tests, it appears that it’s failing with a request sent to the broker.That response doesn’t look like it is coming from the broker. Do you have a copy of the pact file so you can isolate the broker from the equation.
• Why do I care about the descriptor keys? It’s not immediately apparent to me why I should care if the descriptor keys are different. Isn’t it possible that the protos used by the consumer and the provider to be different and yet the contracts still be satisfied?There should be a description key in the pact interaction https://github.com/pact-foundation/pact-reference/blob/b55407ef2be897d286af9330506[…]python/pacts/grpc-consumer-python-area-calculator-provider.json it ties the interaction to a specific protobuf which is stored in the pact file https://github.com/pact-foundation/pact-reference/blob/b55407ef2be897d286af9330506[…]python/pacts/grpc-consumer-python-area-calculator-provider.json I think it may be due to the
key
value
https://github.com/pact-foundation/pact-reference/blob/b55407ef2be897d286af9330506[…]python/pacts/grpc-consumer-python-area-calculator-provider.json
which was removed in 0.4.5 of the pact_ffi
https://github.com/pact-foundation/pact-reference/issues/264#issuecomment-1556582681
The metadata section in the pact should give a good indication as to which library produced it and which version.
If you can provide a copy of the pact file that would be useful. Maybe try removing the key
value if it is present and trying againYousaf Nabi (pactflow.io)
Dustin Iser
11/21/2024, 7:30 PMrholshausen
11/21/2024, 10:15 PMDustin Iser
11/22/2024, 8:43 PMservice Service0 {
rpc endpoint0 (Request0) returns (Response0)
}
Module1.proto
service Service1 {
rpc endpoint1 (Request1) returns (Response1)
}
Then I wrote consumer tests like this:
@PactTestFor(providerName = "microservice")
class ConsumerTest {
@PactTestFor(pactMethod = "endpoint0")
@PactTestFor(pactMethod = "endpoint1")
}
When I look at the contract generated, the metadata object only contains protoFile data for Module0. However, if I comment out the Service0 tests and generate a contract again, the protoFile data now contains Module1 protos.
Do I have to set a new provider name for every proto file?