Any idea on this? ```2022-12-07T21:16:20.081180Z E...
# protobufs
r
Any idea on this?
Copy code
2022-12-07T21:16:20.081180Z ERROR ThreadId(01) pact_ffi::plugins: Failed to call out to plugin - Request to configure interaction failed: Failed to process protobuf: Failed to invoke protoc binary: exit code exit status: 1
It is available:
Copy code
$ which protoc
/usr/local/bin/protoc
Could this be because I made an error in my grpc interaction and it might not comply to the spec?
u
The protoc binary exited with an error code. It should have printed out an error message, which will be in the logs
r
Here is the full output I have on my console:
Copy code
$ go test -v .
=== RUN   TestUserAPIClient
2022/12/07 22:32:54 [DEBUG] pact synchronous message validate config
2022/12/07 22:32:54 [DEBUG] initialising native interface
2022/12/07 22:32:54 [DEBUG] log_to_stdout res 0
2022/12/07 22:32:54 [DEBUG] add sync message
2022-12-07T21:32:54.911626Z  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-12-07T21:32:55.485108Z ERROR ThreadId(01) pact_ffi::plugins: Failed to call out to plugin - Request to configure interaction failed: Failed to process protobuf: Failed to invoke protoc binary: exit code exit status: 1
2022/12/07 22:32:55 [DEBUG] mock server starting on address: 127.0.0.1 0
2022-12-07T21:32:55.487658Z ERROR ThreadId(01) pactffi_create_mock_server_for_transport{pact=PactHandle { pact_ref: 1 } addr=0x101708190 port=0 transport=0x1017043c0 transport_config=0x101706330}: 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/12/07 22:32:55 unable to start plugin transport: unable to start the mock server
FAIL    <http://github.com/ringods/pulumi-pact-poc|github.com/ringods/pulumi-pact-poc>      0.934s
FAIL
Time: 0h:00m:03s
u
Ok, what OS are you running? Is this running in Docker?
m
Ringo - could please check the logs of the protobuf plugin to see if anything else is in there? It should be
~/.pact/plugins/protobuf-0.1.xxx/log/plugin.log.*
r
@Matt (pactflow.io / pact-js / pact-go) only two lines in the log file:
Copy code
2022-12-08T07:19:42.612162Z ERROR tokio-runtime-worker pact_protobuf_plugin::server: Failed to process protobuf: Failed to invoke protoc binary: exit code exit status: 1
2022-12-08T07:19:42.623750Z ERROR tokio-runtime-worker pact_protobuf_plugin::server: Failed to start gRPC mock server: Pact file does not contain any Protobuf descriptors
🤔 1
u
If you enable TRACE level logging, it will print out the command it is trying to execute
m
I’ve noticed a bug in the way logging is handled in Go - having to set an env var and use
SetLogLevel
is not the intention, I’ll fix that shortly.
r
Where/how should I configure the TRACE level logging? Any pointer to a doc page describing that?
m
Just on the go but I'll push up a fix tonight. Exporting the following should work though:
export LOG_LEVEL=trace
(I think it's currently mentioned in the troubleshooting guide)
thankyou 1
r
Found the problem:
Copy code
2022-12-09T10:06:12.991143Z TRACE tokio-runtime-worker request{method=POST uri=<http://127.0.0.1:52887/io.pact.plugin.PactPlugin/ConfigureInteraction> version=HTTP/2.0 headers={"te": "trailers", "content-type": "application/grpc", "authorization": Sensitive, "user-agent": "tonic/0.8.2"}}: pact_protobuf_plugin::protoc: Invoking protoc: Command { std: "./protoc/bin/protoc" "-o/Users/ringods/.pact/plugins/protobuf-0.2.0/tmp/.tmpN76QN0" "-I/Users/ringods/Projects/pulumi/pulumi-pact-poc/proto/pulumi" "--include_imports" "/Users/ringods/Projects/pulumi/pulumi-pact-poc/proto/pulumi/language.proto" "-Iprotoc/include", kill_on_drop: false }
2022-12-09T10:06:13.024890Z DEBUG tokio-runtime-worker request{method=POST uri=<http://127.0.0.1:52887/io.pact.plugin.PactPlugin/ConfigureInteraction> version=HTTP/2.0 headers={"te": "trailers", "content-type": "application/grpc", "authorization": Sensitive, "user-agent": "tonic/0.8.2"}}: pact_protobuf_plugin::protoc: Protoc output: 
2022-12-09T10:06:13.024927Z DEBUG tokio-runtime-worker request{method=POST uri=<http://127.0.0.1:52887/io.pact.plugin.PactPlugin/ConfigureInteraction> version=HTTP/2.0 headers={"te": "trailers", "content-type": "application/grpc", "authorization": Sensitive, "user-agent": "tonic/0.8.2"}}: pact_protobuf_plugin::protoc: Protoc stderr: pulumi/plugin.proto: File not found.
The main protobuf file in
./proto/pulumi/language.go
imports
pulumi/plugin.proto
, but to resolve this correctly, I need to be able to configure the include path from
"-I/Users/ringods/Projects/pulumi/pulumi-pact-poc/proto/pulumi"
to just
"-I/Users/ringods/Projects/pulumi/pulumi-pact-poc/proto"
(e.g. drop the last part
pulumi
from the path. Can I do that?
u
You can add additional includes in the plugin manifest file, under
pluginConfig
, see https://github.com/pactflow/pact-protobuf-plugin#configuration
🙌 1
r
@uglyog that’s good for now. IMO this should be a project-level configuration though.
m
FYI have created https://github.com/pactflow/pact-protobuf-plugin/issues/17 to track this. I got a similar feedback from another user via a DM last week
r
Thanks for this. I upgraded to pact-protobuf-plugin v0.2.4.