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

No logs written in ~/.pact/plugins/protobuf-X/logs #50

Open
jadencodes opened this issue Feb 16, 2024 · 4 comments
Open

No logs written in ~/.pact/plugins/protobuf-X/logs #50

jadencodes opened this issue Feb 16, 2024 · 4 comments

Comments

@jadencodes
Copy link

Hi there, we are evaluating using this across a microservice environment that relies on GRPC communcations.

We were able to quickly get up a demo in our kotlin services but are struggling with the typescript/js repositories. While a learning curve is expected, we get no logs in the protobuf plugin directory from the js libraries which we got and relied on from the java library. This makes triaging what the problem is (i suspect building or importing our protobuf) pretty much trial and error.

I also cloned the example from: https://github.com/pact-foundation/pact-plugins/blob/main/examples/gRPC/area_calculator/js/test/grpc.consumer.spec.ts and still see no logs. The log files themselves are created, but never written to.

I have increased the log level to debug and trace to see if that helps but it doesn't seem to have an effect.

The error we saw in kotlin console that was triagable from the protobuf plugin logs is the same as the error we see in js:

Failed to process protobuf: Failed to invoke protoc binary: exit code exit status: 1

We are on npm 8, nodejs 16

@YOU54F
Copy link
Member

YOU54F commented Feb 16, 2024

👋

that usually indicates the plugin couldn't start, you can try invoking the binary manually from the plugin directory.

I am going to assume its because protoc isn't installed on the machine in question

https://google.github.io/proto-lens/installing-protoc.html

@jadencodes
Copy link
Author

Hi there, thanks for the fast response.

protoc is installed: as I said the kotlin library works and the linked example using the js library works. However when we use an apparently bad protobuf, it doesn't work and no logs are produced to indicate why.

@vjustov
Copy link

vjustov commented Aug 20, 2024

I am getting the same behavior that @jadencodes describes. also running the tests in the example repo dont produce any logs.

i have also noticed that in my runs the port number is impossibly high: 4294967293

@vjustov
Copy link

vjustov commented Aug 26, 2024

looking through the logs i can see: Failed to process protobuf: Failed to invoke protoc binary: exit code exit status: 1", interaction: [], plugin_configuration: None }
and further down: Some(Error("Failed to start gRPC mock server: Pact file does not contain any Protobuf descriptors")) } which is odd as i have triple checked the path and they are correct (turns out i had set the dir property when starting the provider). any pointers @YOU54F ?

now im getting the following errors which are very hard to follow as it doesnt say which field its refering to: Failed to call out to plugin - Request to configure interaction failed: Failed to process protobuf: Field values must be configured with a string value, got Number(1.0)

EDIT: The log above about string field values is only printed when the provider logs are set in debug mode

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