hashicorp / hashicorp/go-plugin

plugin failed to exit gracefully

Open
#331 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.1k
Forks
511
Avg merge
22h 47m
Merged PRs (30d)
4

Description

Hello! I tried to build the [basic](https://github.com/hashicorp/go-plugin/tree/main/examples/basic) example and while it does seem to work I sometimes get these log messages:

`2025-01-16T11:49:05.997+0100 [DEBUG] plugin: starting plugin: path=./plugin/greeter.exe args=["./plugin/greeter.exe"]
2025-01-16T11:49:06.069+0100 [DEBUG] plugin: plugin started: path=./plugin/greeter.exe pid=17972
2025-01-16T11:49:06.070+0100 [DEBUG] plugin: waiting for RPC address: plugin=./plugin/greeter.exe
2025-01-16T11:49:06.147+0100 [DEBUG] plugin.greeter.exe: message from plugin: foo=bar timestamp="2025-01-16T11:49:06.087+0100"
2025-01-16T11:49:06.150+0100 [DEBUG] plugin: using plugin: version=1
2025-01-16T11:49:06.150+0100 [DEBUG] plugin.greeter.exe: plugin address: address=127.0.0.1:10000 network=tcp timestamp="2025-01-16T11:49:06.149+0100"
2025-01-16T11:49:06.153+0100 [DEBUG] plugin.greeter.exe: message from GreeterHello.Greet: timestamp="2025-01-16T11:49:06.153+0100"
Hello!
2025-01-16T11:49:06.155+0100 [DEBUG] plugin.greeter.exe: 2025/01/16 11:49:06 [DEBUG] plugin: plugin server: accept tcp 127.0.0.1:10000: use of closed network connection
2025-01-16T11:49:06.158+0100 [INFO] plugin: plugin process exited: plugin=./plugin/greeter.exe id=17972
2025/01/16 11:49:06 [ERR] yamux: Failed to read stream data: read tcp 127.0.0.1:50460->127.0.0.1:10000: wsarecv: An existing connection was forcibly closed by the remote host.
2025/01/16 11:49:06 [ERR] yamux: Failed to write header: write tcp 127.0.0.1:50460->127.0.0.1:10000: use of closed network connection
2025-01-16T11:49:06.160+0100 [WARN] plugin: error closing client during Kill: err="unexpected EOF"
2025-01-16T11:49:06.160+0100 [WARN] plugin: plugin failed to exit gracefully
2025-01-16T11:49:06.161+0100 [DEBUG] plugin: error killing plugin: error="invalid argument"`

It does not happen every time and the warnings are not exactly the same each time either:

`2025-01-16T11:42:48.441+0100 [DEBUG] plugin: starting plugin: path=./plugin/greeter.exe args=["./plugin/greeter.exe"]
2025-01-16T11:42:48.513+0100 [DEBUG] plugin: plugin started: path=./plugin/greeter.exe pid=42576
2025-01-16T11:42:48.513+0100 [DEBUG] plugin: waiting for RPC address: plugin=./plugin/greeter.exe
2025-01-16T11:42:48.591+0100 [DEBUG] plugin.greeter.exe: message from plugin: foo=bar timestamp="2025-01-16T11:42:48.530+0100"
2025-01-16T11:42:48.594+0100 [DEBUG] plugin.greeter.exe: plugin address: address=127.0.0.1:10000 network=tcp timestamp="2025-01-16T11:42:48.594+0100"
ar timestamp="2025-01-16T11:42:51.843+0100"
2025-01-16T11:42:51.914+0100 [DEBUG] plugin: using plugin: version=1
2025-01-16T11:42:51.914+0100 [DEBUG] plugin.greeter.exe: plugin address: address=127.0.0.1:10000 network=tcp timestamp="2025-01-16T11:42:51.913+0100"
2025-01-16T11:42:51.918+0100 [DEBUG] plugin.greeter.exe: message from GreeterHello.Greet: timestamp="2025-01-16T11:42:51.918+0100"
Hello!
2025-01-16T11:42:51.919+0100 [DEBUG] plugin.greeter.exe: 2025/01/16 11:42:51 [DEBUG] plugin: plugin server: accept tcp 127.0.0.1:10000: use of closed network connection
2025-01-16T11:42:51.921+0100 [WARN] plugin: error closing client during Kill: err="unexpected EOF"
2025-01-16T11:42:51.921+0100 [WARN] plugin: plugin failed to exit gracefully
2025-01-16T11:42:51.922+0100 [DEBUG] plugin: error killing plugin: error="invalid argument"
2025-01-16T11:42:51.922+0100 [INFO] plugin: plugin process exited: plugin=./plugin/greeter.exe id=29736`

Since it only happens sporadically I'm a bit puzzled on why this is happening and if it's something that might cause issues later on.

Thank you for your time!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.