Spencer
11/07/2024, 5:17 PMGrpcTransport
(the consumer tests are written in TypeScript) with the host host.docker.internal:8000
, as the project is made up of multiple Docker containers on a shared network.
My requests are successful, as I can verify by manually inspecting the project's front-end for changes. However, when I use the pact_verifier_cli
to "replay" my generated pacts specifying grpc
transport and with the same hostname and port, I get builder error for url (<grpc://host.docker.internal:8000>)
.
I will note that 8000 hits an Envoy proxy, but any other port also gives me the same error. I also will note that I understand all the Pact Protobuf examples I've seen mock out a provider server instead of just hitting the "production" one directly, but for my uses this is okay and I'm not sure why this would influence me getting this error result either.
Any thoughts on how I could remedy this? Thank you šMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Spencer
11/07/2024, 8:59 PMpact-plugins
repo.
Those examples don't mock out the provider; they just may start it as part of the test code (at least in the case of the Go one), whereas I'm not doing that on my side.
I will try that, thank you Matt šMatt (pactflow.io / pact-js / pact-go)
Spencer
11/07/2024, 9:10 PM--transport grpc:8000
and -h host.docker.internal
give builder error for url (grpc:<8000://host.docker.internal>)
Spencer
11/07/2024, 9:11 PMtransports
optionSpencer
11/07/2024, 9:12 PMerror sending request for url (<http://host.docker.internal/>)
I will dig into the logs some more and report back š this looks like progress!Spencer
11/07/2024, 10:43 PM-p 8000
along with --transports grpc:8000
I then get back Request to fetch message from provider failed: status 415
hyper_util::client::legacy::connect::http: connecting to 192.168.65.254:8000
2024-11-07T22:41:54.347626Z DEBUG main hyper_util::client::legacy::connect::http: connected to 192.168.65.254:8000
2024-11-07T22:41:54.348437Z DEBUG main hyper_util::client::legacy::pool: pooling idle connection for ("http", host.docker.internal:8000)
2024-11-07T22:41:54.348454Z DEBUG main verify_provider{provider_name="backend-go"}:verify_interaction{interaction="A gRPC updateEndpoint request"}: pact_verifier::provider_client: Received native response: Response { url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("host.docker.internal")), port: Some(8000), path: "/", query: None, fragment: None }, status: 415, headers: {"content-type": "application/grpc", "grpc-status": "3", "grpc-message": "invalid gRPC request content-type \"application/json\"", "x-envoy-upstream-service-time": "0", "date": "Thu, 07 Nov 2024 22:41:54 GMT", "server": "envoy", "content-length": "0"} }
2024-11-07T22:41:54.348492Z INFO main verify_provider{provider_name="backend-go"}:verify_interaction{interaction="A gRPC updateEndpoint request"}: pact_verifier::provider_client: Received response: HTTP Response ( status: 415, headers: Some({"server": ["envoy"], "content-type": ["application/grpc"], "content-length": ["0"], "grpc-status": ["3"], "grpc-message": ["invalid gRPC request content-type \"application/json\""], "date": ["Thu, 07 Nov 2024 22:41:54 GMT"], "x-envoy-upstream-service-time": ["0"]}), body: Empty )
2024-11-07T22:41:54.348503Z DEBUG main verify_provider{provider_name="backend-go"}:verify_interaction{interaction="A gRPC updateEndpoint request"}: pact_verifier::provider_client: body:
Spencer
11/07/2024, 10:47 PM-p 8000
along with --transports grpc:8000
I then get back Request to fetch message from provider failed: status 415
partial logs below, I think I may need to tweak my Envoy config
hyper_util::client::legacy::connect::http: connecting to 192.168.65.254:8000
hyper_util::client::legacy::connect::http: connected to 192.168.65.254:8000
hyper_util::client::legacy::pool: pooling idle connection for ("http", host.docker.internal:8000)
pact_verifier::provider_client: Received native response: Response { url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("host.docker.internal")), port: Some(8000), path: "/", query: None, fragment: None }, status: 415, headers: {"content-type": "application/grpc", "grpc-status": "3", "grpc-message": "invalid gRPC request content-type \"application/json\"", "x-envoy-upstream-service-time": "0", "date": "Thu, 07 Nov 2024 22:41:54 GMT", "server": "envoy", "content-length": "0"} }
pact_verifier::provider_client: Received response: HTTP Response ( status: 415, headers: Some({"server": ["envoy"], "content-type": ["application/grpc"], "content-length": ["0"], "grpc-status": ["3"], "grpc-message": ["invalid gRPC request content-type \"application/json\""], "date": ["Thu, 07 Nov 2024 22:41:54 GMT"], "x-envoy-upstream-service-time": ["0"]}), body: Empty )
pact_verifier::provider_client: body:
Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
pact_verifier_cli -f ../consumer-jvm/build/pacts/protobuf-consumer-area-calculator-provider.json -p 37621
I wonder if there is state being passed in that is expected to be handled by a http message proxy, which is receiving the application/json
content messageSpencer
11/08/2024, 4:32 PMSpencer
11/12/2024, 2:36 PMenvoy.yaml
for the provider so far, unfortunately.
If you guys think it would be useful, I could share the consumer test code and the generated pact privately.Yousaf Nabi (pactflow.io)
Spencer
11/22/2024, 3:27 PMSpencer
02/07/2025, 8:23 PM