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

client Error:Unrecognized remote plugin message... #199

Open
klayyu opened this issue May 25, 2022 · 3 comments
Open

client Error:Unrecognized remote plugin message... #199

klayyu opened this issue May 25, 2022 · 3 comments

Comments

@klayyu
Copy link

klayyu commented May 25, 2022

Hi,there, thank you for the great go-plugin,
I am getting this error when using 3rd log package.
client Error:Unrecognized remote plugin message...

how can i stop sync log info from plugin to host, or can i use 3rd log package?

@yockii
Copy link

yockii commented Dec 8, 2022

I found it will print a debug level log when start plugin with an unrecognized format, if i turn the log to above debug level (info eg.), this will successfully run over.

code here:

logger.Debug("plugin address", "network", listener.Addr().Network(), "address", listener.Addr().String())

@gilwo
Copy link

gilwo commented Apr 13, 2023

Hi,
I hope this will be useful for some,

after digging into the problem myself in my project I reached to the following conclusions:

  • any output to stdout from the client will be grabbed and send to the server using underlying pipe
  • the server expect a handshake message from the client as the first thing in order to start the plugin flow
  • receiving any other message (like printf() or logs to stdout or anything going to stdout) will break the flow of the Start() logic invoked from Client() call (in order to connect to the client - on the host side)

hence in my project I routed all my logs to the plugin logging mechanics and turned off all messages going to stdout before calling plugin.Serve() (on the plugin side)

@tomhjp
Copy link
Contributor

tomhjp commented Sep 18, 2023

@gilwo is spot on - any logging from the plugin should be written to stderr, and then go-plugin will ship those logs into the client's logger output. Technically you could print to stdout after the connection has been successfully negotiated in Start() (called from Client()) but I'd recommend sticking to stderr which is where go-plugin expects any logs to be printed.

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

4 participants