Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4 gRPC tests fail with an unrelated error if the configure JSON is invalid #250

Open
rholshausen opened this issue Nov 10, 2022 · 2 comments

Comments

@rholshausen
Copy link
Contributor

Software versions

  • OS: e.g. Ubuntu
  • Consumer Pact library: e.g. Pact go beta
  • Provider Pact library: e.g. N/A
  • Golang Version: go version
  • Golang environment: Provide output of go env

Expected behaviour

Setup a gRPC consumer test, but have the JSON to configure the interaction to be invalid. Expect the test to fail with an invalid JSON error.

Actual behaviour

An error is logged about the JSON being invalid, but then the mock server is started anyway, which fails to start correctly. This hides the JSON error in the log output and the final error is:

2022-11-10T02:12:31.254037Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: pact_plugin_driver::plugin_manager: Got response $StartMockServerResponse { response: Some(Error("Failed to start gRPC mock server: Pact file does not contain any Protobuf descriptors")) }
2022-11-10T02:12:31.254068Z ERROR ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: pact_ffi::mock_server: Failed to start mock server - Mock server failed to start: Failed to start gRPC mock server: Pact file does not contain any Protobuf descriptors
2022/11/10 13:12:31 unable to start plugin transport: unable to start the mock server

Steps to reproduce

Any test should do it. Ie. break the JSON at https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/grpc/grpc_consumer_test.go#L36

Relevent log files

2022/11/10 13:12:30 [DEBUG] pact synchronous message validate config
2022/11/10 13:12:30 [DEBUG] initialising rust mock server interface
2022/11/10 13:12:30 [DEBUG] log_to_stdout res 0
2022/11/10 13:12:30 [DEBUG] add sync message
2022-11-10T02:12:30.629132Z DEBUG ThreadId(01) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/transport/http
core/transport/https
2022-11-10T02:12:30.629170Z DEBUG ThreadId(01) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/content-generator/binary
core/content-generator/json
core/content-matcher/json
core/content-matcher/multipart-form-data
core/content-matcher/text
core/content-matcher/xml
2022-11-10T02:12:30.629196Z DEBUG ThreadId(01) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/matcher/v1-equality
core/matcher/v2-max-type
core/matcher/v2-min-type
core/matcher/v2-minmax-type
core/matcher/v2-regex
core/matcher/v2-type
core/matcher/v3-content-type
core/matcher/v3-date
core/matcher/v3-datetime
core/matcher/v3-decimal-type
core/matcher/v3-includes
core/matcher/v3-integer-type
core/matcher/v3-null
core/matcher/v3-number-type
core/matcher/v3-time
core/matcher/v4-array-contains
core/matcher/v4-equals-ignore-order
core/matcher/v4-max-equals-ignore-order
core/matcher/v4-min-equals-ignore-order
core/matcher/v4-minmax-equals-ignore-order
core/matcher/v4-not-empty
core/matcher/v4-semver
2022-11-10T02:12:30.629616Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Loading plugin PluginDependency { name: "protobuf", version: None, dependency_type: Plugin }
2022-11-10T02:12:30.629631Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Did not find plugin, will start it
2022-11-10T02:12:30.629633Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Loading plugin manifest for plugin PluginDependency { name: "protobuf", version: None, dependency_type: Plugin }
2022-11-10T02:12:30.629639Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Looking for plugin in "/home/ronald/.pact/plugins"
2022-11-10T02:12:30.629660Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Found plugin manifest: "/home/ronald/.pact/plugins/protobuf-0.1.15/pact-plugin.json"
2022-11-10T02:12:30.629693Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Starting plugin with manifest PactPluginManifest { plugin_dir: "/home/ronald/.pact/plugins/protobuf-0.1.15", plugin_interface_version: 1, name: "protobuf", version: "0.1.15", executable_type: "exec", minimum_required_version: None, entry_point: "pact-protobuf-plugin", entry_points: {}, args: None, dependencies: None, plugin_config: {"hostToBindTo": String("127.0.0.1"), "protocVersion": String("3.19.1"), "downloadUrl": String("https://github.com/protocolbuffers/protobuf/releases/download")} }
2022-11-10T02:12:30.629704Z  WARN tokio-runtime-worker pact_plugin_driver::metrics: 

Please note:
We are tracking this plugin load anonymously to gather important usage statistics.
To disable tracking, set the 'pact_do_not_track' environment variable to 'true'.


2022-11-10T02:12:30.631300Z DEBUG tokio-runtime-worker pact_plugin_driver::metrics: Sending event to GA - {"cd2": "unknown", "av": "0.1.10", "t": "event", "ds": "pact-plugins-rust", "cd4": "protobuf", "v": "1", "cd5": "0.1.15", "cd3": "linux-x86_64", "tid": "UA-117778936-1", "aid": "pact-plugins-rust", "aip": "true", "el": "Plugin loaded", "ea": "Loaded", "ec": "Plugin", "ev": "1", "cid": "89638527cd8b084f7b907dbcb8063bbe", "an": "pact-plugins-rust"}
2022-11-10T02:12:30.631734Z DEBUG tokio-runtime-worker reqwest::connect: starting new connection: https://www.google-analytics.com/    
2022-11-10T02:12:30.631810Z DEBUG tokio-runtime-worker hyper::client::connect::dns: resolving host="www.google-analytics.com"
2022-11-10T02:12:30.643227Z DEBUG tokio-runtime-worker hyper::client::connect::http: connecting to 142.250.70.206:443
2022-11-10T02:12:30.650405Z DEBUG tokio-runtime-worker hyper::client::connect::http: connected to 142.250.70.206:443
2022-11-10T02:12:30.650433Z DEBUG tokio-runtime-worker rustls::client::hs: No cached session for DnsName(DnsName(DnsName("www.google-analytics.com")))    
2022-11-10T02:12:30.650465Z DEBUG tokio-runtime-worker rustls::client::hs: Not resuming any session    
2022-11-10T02:12:30.660265Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Detected OS: Ubuntu 22.10 (kinetic) [64-bit]
2022-11-10T02:12:30.660280Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Starting plugin using "/home/ronald/.pact/plugins/protobuf-0.1.15/pact-protobuf-plugin"
2022-11-10T02:12:30.660518Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Plugin protobuf started with PID 1097247
2022-11-10T02:12:30.662758Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || {"port":46839, "serverKey":"a4780af5-3012-4927-918f-73df955b32c6"}
2022-11-10T02:12:30.662774Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Plugin process started OK (port = 46839), sending init message
2022-11-10T02:12:30.662842Z DEBUG ThreadId(01) hyper::client::connect::http: connecting to [::1]:46839
2022-11-10T02:12:30.662895Z DEBUG ThreadId(01) pact_plugin_driver::plugin_models: IP6 connection failed, will try IP4 address - transport error
2022-11-10T02:12:30.662900Z DEBUG ThreadId(01) hyper::client::connect::http: connecting to 127.0.0.1:46839
2022-11-10T02:12:30.662939Z DEBUG ThreadId(01) hyper::client::connect::http: connected to 127.0.0.1:46839
2022-11-10T02:12:30.662952Z DEBUG ThreadId(01) h2::client: binding client connection
2022-11-10T02:12:30.662964Z DEBUG ThreadId(01) h2::client: client connection bound
2022-11-10T02:12:30.662978Z DEBUG ThreadId(01) h2::codec::framed_write: send frame=Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2022-11-10T02:12:30.662996Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.662978Z DEBUG tokio-runtime-worker h2::codec::framed_write: send frame=Settings { flags: (0x0), initial_window_size: 1048576, max_frame_size: 16384, max_header_list_size: 16777216 }
2022-11-10T02:12:30.663020Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=WindowUpdate { stream_id: StreamId(0), size_increment: 5177345 }
2022-11-10T02:12:30.663053Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Settings { flags: (0x0), initial_window_size: 1048576, max_frame_size: 16384, max_header_list_size: 16777216 }
2022-11-10T02:12:30.663058Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Settings { flags: (0x1: ACK) }
2022-11-10T02:12:30.663070Z DEBUG tokio-runtime-worker tower::buffer::worker: service.ready=true processing request
2022-11-10T02:12:30.663113Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2022-11-10T02:12:30.663127Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Data { stream_id: StreamId(1) }
2022-11-10T02:12:30.663124Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663090Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_read: received frame=Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2022-11-10T02:12:30.663131Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Data { stream_id: StreamId(1), flags: (0x1: END_STREAM) }
2022-11-10T02:12:30.663136Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663109Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_write: send frame=Settings { flags: (0x1: ACK) }
2022-11-10T02:12:30.663140Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663121Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_read: received frame=WindowUpdate { stream_id: StreamId(0), size_increment: 5177345 }
2022-11-10T02:12:30.663143Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663134Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_read: received frame=Settings { flags: (0x1: ACK) }
2022-11-10T02:12:30.663155Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663143Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::proto::settings: received settings ACK; applying Settings { flags: (0x0), initial_window_size: 1048576, max_frame_size: 16384, max_header_list_size: 16777216 }
2022-11-10T02:12:30.663178Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663172Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2022-11-10T02:12:30.663198Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663192Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(1) }
2022-11-10T02:12:30.663211Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663205Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(1), flags: (0x1: END_STREAM) }
2022-11-10T02:12:30.663221Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663216Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_write: send frame=WindowUpdate { stream_id: StreamId(0), size_increment: 983041 }
2022-11-10T02:12:30.663240Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Settings { flags: (0x1: ACK) }
2022-11-10T02:12:30.663244Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::proto::settings: received settings ACK; applying Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2022-11-10T02:12:30.663248Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=WindowUpdate { stream_id: StreamId(0), size_increment: 983041 }
2022-11-10T02:12:30.663261Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663257Z DEBUG tokio-runtime-worker request{method=POST uri=http://127.0.0.1:46839/io.pact.plugin.PactPlugin/InitPlugin version=HTTP/2.0 headers={"te": "trailers", "content-type": "application/grpc", "authorization": Sensitive, "user-agent": "tonic/0.8.0"}}: tower_http::trace::on_request: started processing request
2022-11-10T02:12:30.663306Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663300Z DEBUG tokio-runtime-worker request{method=POST uri=http://127.0.0.1:46839/io.pact.plugin.PactPlugin/InitPlugin version=HTTP/2.0 headers={"te": "trailers", "content-type": "application/grpc", "authorization": Sensitive, "user-agent": "tonic/0.8.0"}}: pact_protobuf_plugin::server: Init request from plugin-driver-rust/0.1.10
2022-11-10T02:12:30.663332Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663326Z DEBUG tokio-runtime-worker request{method=POST uri=http://127.0.0.1:46839/io.pact.plugin.PactPlugin/InitPlugin version=HTTP/2.0 headers={"te": "trailers", "content-type": "application/grpc", "authorization": Sensitive, "user-agent": "tonic/0.8.0"}}: tower_http::trace::on_response: finished processing request latency=0 ms
2022-11-10T02:12:30.663369Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663364Z DEBUG tokio-runtime-worker request{method=POST uri=http://127.0.0.1:46839/io.pact.plugin.PactPlugin/InitPlugin version=HTTP/2.0 headers={"te": "trailers", "content-type": "application/grpc", "authorization": Sensitive, "user-agent": "tonic/0.8.0"}}: tower_http::trace::on_eos: end of stream stream_duration=0 ms status=0
2022-11-10T02:12:30.663391Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663385Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_write: send frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2022-11-10T02:12:30.663406Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663401Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_write: send frame=Data { stream_id: StreamId(1) }
2022-11-10T02:12:30.663417Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.663412Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_write: send frame=Headers { stream_id: StreamId(1), flags: (0x5: END_HEADERS | END_STREAM) }
2022-11-10T02:12:30.705854Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2022-11-10T02:12:30.705874Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(1) }
2022-11-10T02:12:30.705884Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(1), flags: (0x5: END_HEADERS | END_STREAM) }
2022-11-10T02:12:30.706003Z DEBUG ThreadId(01) pact_plugin_driver::plugin_manager: Got init response InitPluginResponse { catalogue: [CatalogueEntry { r#type: ContentMatcher, key: "protobuf", values: {"content-types": "application/protobuf;application/grpc"} }, CatalogueEntry { r#type: ContentGenerator, key: "protobuf", values: {"content-types": "application/protobuf;application/grpc"} }, CatalogueEntry { r#type: Transport, key: "grpc", values: {} }] } from plugin protobuf
2022-11-10T02:12:30.706023Z DEBUG ThreadId(01) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/content-generator/binary
core/content-generator/json
core/content-matcher/json
core/content-matcher/multipart-form-data
core/content-matcher/text
core/content-matcher/xml
core/matcher/v1-equality
core/matcher/v2-max-type
core/matcher/v2-min-type
core/matcher/v2-minmax-type
core/matcher/v2-regex
core/matcher/v2-type
core/matcher/v3-content-type
core/matcher/v3-date
core/matcher/v3-datetime
core/matcher/v3-decimal-type
core/matcher/v3-includes
core/matcher/v3-integer-type
core/matcher/v3-null
core/matcher/v3-number-type
core/matcher/v3-time
core/matcher/v4-array-contains
core/matcher/v4-equals-ignore-order
core/matcher/v4-max-equals-ignore-order
core/matcher/v4-min-equals-ignore-order
core/matcher/v4-minmax-equals-ignore-order
core/matcher/v4-not-empty
core/matcher/v4-semver
core/transport/http
core/transport/https
plugin/protobuf/content-generator/protobuf
plugin/protobuf/content-matcher/protobuf
plugin/protobuf/transport/grpc
2022-11-10T02:12:30.706062Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(0) }
2022-11-10T02:12:30.706073Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::proto::connection: Connection::poll; connection error error=GoAway(b"", NO_ERROR, Library)
2022-11-10T02:12:30.706257Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(protobuf, 1097247, STDOUT) || 2022-11-10T02:12:30.706166Z DEBUG tokio-runtime-worker Connection{peer=Server}: h2::codec::framed_read: received frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(0) }
2022-11-10T02:12:30.746917Z DEBUG tokio-runtime-worker rustls::client::hs: Using ciphersuite TLS13_AES_256_GCM_SHA384    
2022-11-10T02:12:30.746933Z DEBUG tokio-runtime-worker rustls::client::tls13: Not resuming    
2022-11-10T02:12:30.748677Z DEBUG tokio-runtime-worker rustls::client::tls13: TLS1.3 encrypted extensions: [Protocols([6832])]    
2022-11-10T02:12:30.748686Z DEBUG tokio-runtime-worker rustls::client::hs: ALPN protocol is Some(b"h2")    
2022-11-10T02:12:30.748872Z DEBUG tokio-runtime-worker h2::client: binding client connection
2022-11-10T02:12:30.748876Z DEBUG tokio-runtime-worker h2::client: client connection bound
2022-11-10T02:12:30.748881Z DEBUG tokio-runtime-worker h2::codec::framed_write: send frame=Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2022-11-10T02:12:30.748911Z DEBUG tokio-runtime-worker hyper::client::pool: pooling idle connection for ("https", www.google-analytics.com)
2022-11-10T02:12:30.748921Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=WindowUpdate { stream_id: StreamId(0), size_increment: 5177345 }
2022-11-10T02:12:30.749025Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2022-11-10T02:12:30.749040Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Data { stream_id: StreamId(1), flags: (0x1: END_STREAM) }
2022-11-10T02:12:30.763556Z DEBUG tokio-runtime-worker Connection{peer=Client}: rustls::client::tls13: Ticket saved    
2022-11-10T02:12:30.763573Z DEBUG tokio-runtime-worker Connection{peer=Client}: rustls::client::tls13: Ticket saved    
2022-11-10T02:12:30.763580Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Settings { flags: (0x0), max_concurrent_streams: 100, initial_window_size: 1048576, max_header_list_size: 65536 }
2022-11-10T02:12:30.763586Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Settings { flags: (0x1: ACK) }
2022-11-10T02:12:30.763591Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=WindowUpdate { stream_id: StreamId(0), size_increment: 983041 }
2022-11-10T02:12:30.763688Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Settings { flags: (0x1: ACK) }
2022-11-10T02:12:30.763691Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::proto::settings: received settings ACK; applying Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2022-11-10T02:12:30.849766Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2022-11-10T02:12:30.849813Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(1) }
2022-11-10T02:12:30.849860Z DEBUG tokio-runtime-worker reqwest::async_impl::client: response '200 OK' for https://www.google-analytics.com/collect    
2022-11-10T02:12:30.849930Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Reset { stream_id: StreamId(1), error_code: CANCEL }
2022-11-10T02:12:30.849972Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=GoAway { error_code: NO_ERROR, last_stream_id: StreamId(0) }
2022-11-10T02:12:30.849979Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::proto::connection: Connection::poll; connection error error=GoAway(b"", NO_ERROR, Library)
2022-11-10T02:12:30.849991Z DEBUG tokio-runtime-worker Connection{peer=Client}: rustls::conn: Sending warning alert CloseNotify    
2022-11-10T02:12:31.207614Z ERROR ThreadId(01) pact_ffi::plugins: Contents is not a valid JSON - expected `,` or `}` at line 10 column 44
2022/11/10 13:12:31 [DEBUG] mock server starting on address: 127.0.0.1 0
2022-11-10T02:12:31.208168Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: pact_plugin_driver::plugin_manager: Sending startMockServer request to plugin plugin_name="protobuf" plugin_version="0.1.15"
2022-11-10T02:12:31.208425Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: hyper::client::connect::http: connecting to [::1]:46839
2022-11-10T02:12:31.208814Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: pact_plugin_driver::plugin_models: IP6 connection failed, will try IP4 address - transport error
2022-11-10T02:12:31.208897Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: hyper::client::connect::http: connecting to 127.0.0.1:46839
2022-11-10T02:12:31.209208Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: hyper::client::connect::http: connected to 127.0.0.1:46839
2022-11-10T02:12:31.209236Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: h2::client: binding client connection
2022-11-10T02:12:31.209288Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: h2::client: client connection bound
2022-11-10T02:12:31.209307Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: h2::codec::framed_write: send frame=Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2022-11-10T02:12:31.209413Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_write: send frame=WindowUpdate { stream_id: StreamId(0), size_increment: 5177345 }
2022-11-10T02:12:31.209590Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_read: received frame=Settings { flags: (0x0), initial_window_size: 1048576, max_frame_size: 16384, max_header_list_size: 16777216 }
2022-11-10T02:12:31.209615Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_write: send frame=Settings { flags: (0x1: ACK) }
2022-11-10T02:12:31.209672Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: tower::buffer::worker: service.ready=true processing request
2022-11-10T02:12:31.209824Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_write: send frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2022-11-10T02:12:31.209871Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_write: send frame=Data { stream_id: StreamId(1) }
2022-11-10T02:12:31.209916Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_write: send frame=Data { stream_id: StreamId(1), flags: (0x1: END_STREAM) }
2022-11-10T02:12:31.210518Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_read: received frame=Settings { flags: (0x1: ACK) }
2022-11-10T02:12:31.210568Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::proto::settings: received settings ACK; applying Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2022-11-10T02:12:31.210596Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_read: received frame=WindowUpdate { stream_id: StreamId(0), size_increment: 983041 }
2022-11-10T02:12:31.253902Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2022-11-10T02:12:31.253931Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(1) }
2022-11-10T02:12:31.253943Z DEBUG tokio-runtime-worker pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}:Connection{peer=Client}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(1), flags: (0x5: END_HEADERS | END_STREAM) }
2022-11-10T02:12:31.254037Z DEBUG ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: pact_plugin_driver::plugin_manager: Got response $StartMockServerResponse { response: Some(Error("Failed to start gRPC mock server: Pact file does not contain any Protobuf descriptors")) }
2022-11-10T02:12:31.254068Z ERROR ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x2b5f230 port=0 transport=0x2b69470 transport_config=0x2b5f980}: pact_ffi::mock_server: Failed to start mock server - Mock server failed to start: Failed to start gRPC mock server: Pact file does not contain any Protobuf descriptors
2022/11/10 13:12:31 unable to start plugin transport: unable to start the mock server
@mefellows
Copy link
Member

Thanks Ron - easy fix!

@jasonltaylor
Copy link

I was told this also will fix an issue with an empty request. Adding details here to track. So if request has no content:

	grpcInteraction := `{
		"pact:content-type": "application/protobuf",
		"request": {
		},

The consumer test incorrectly fails with this error:

2022/12/06 20:52:19 [DEBUG] GetMessageRequestContents
    test.go:88: 
                Error Trace:    /test.go:88
                Error:          Received unexpected error:
                                retreived an empty message
                Test:           TestMyRequest

It should allow for requests with no fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants