temporalio / tctl

Temporal CLI
https://docs.temporal.io/docs/system-tools/tctl
MIT License
43 stars 36 forks source link

[Bug] Unwanted stderr output when running tctl commands #313

Open hferentschik opened 2 years ago

hferentschik commented 2 years ago

What are you really trying to do?

Run any tctl commands

Describe the bug

When running any tctl command with the 1.16.3 version, there is additional stderr output appearing from hashicorp/go-plugin. For example:

$ tctx exec -c dev -- tctl wf describe --wid foo --rid 8858b620-89f5-4104-b6cc-8fc40e77de42                                                                                                                                
2022-10-13T15:26:13.585+0200 [WARN]  tctl: plugin configured with a nil SecureConfig
2022-10-13T15:26:13.608+0200 [WARN]  tctl: plugin configured with a nil SecureConfig
{
...
}
2022-10-13T15:26:14.698+0200 [INFO]  tctl: plugin process exited: path=/opt/homebrew/bin/tctl-data-converter pid=72439

Minimal Reproduction

Run any tctl while using a plugin as well, e.g. a DataConverter plugin.

Environment/Versions

$ tctl --version
tctl version 1.16.3

Additional context

This is most likely related to the commit 16ee92c18f9664fd6ac5c2a7c0c00c9b846c9e7c which bumps hashicorp/go-plugin. When I build tctl from source, I can see the described behaviour. If I downgrade the go-plugin version, it is gone.

hferentschik commented 2 years ago

See also https://github.com/hashicorp/go-plugin/pull/207.

hferentschik commented 2 years ago

So in my case, the rub seems to be here:https://github.com/temporalio/tctl/blob/79ca2a900aae7d2b15688f536fa05edef969c2a7/cli_curr/plugin/plugin.go#L51

Here the plugin client for the DataConverter is created without specifying a SecureConfig. Setting the logger level to error or off makes the warnings disappear. The alternative would be to provide a SecureConfig, but tbh I am not sure how this would work. The SecureConfig expects a hash of the binary the client is going to execute. I am not sure how the process would like to pass/configure this hash, and in the case of custom converters, I doubt that there are hashes available at all times.

feedmeapples commented 2 years ago

is this an option to switch to codec server instead of using plugins?

in the new cli we've removed plugins in favor of codec server

hferentschik commented 1 year ago

is this an option to switch to codec server instead of using plugins?

Potentially. Question is whether one wants to do something about this issue for now in tctl. I guess tctl will continue to be in use for some time forward.

in the new cli we've removed plugins in favor of codec server

I see. Good to know.