hashicorp / go-plugin

Golang plugin system over RPC.
Mozilla Public License 2.0
5.25k stars 450 forks source link

Error running python-plugin gRPC example #157

Open lsnow99 opened 4 years ago

lsnow99 commented 4 years ago

From a fresh clone of the repo, I am getting an error running the python-plugin example.

Steps to reproduce:

Clone repository go build -o kv export KV_PLUGIN="python plugin-python/plugin.py" ./kv put hello world ./kv get hello

Output from ./kv put hello world:

[logan@logan-lin-main grpc]$ ./kv put hello world
2020-09-18T17:42:59.015-0400 [DEBUG] plugin: starting plugin: path=/usr/bin/sh args="[sh -c python plugin-python/plugin.py]"
2020-09-18T17:42:59.015-0400 [DEBUG] plugin: plugin started: path=/usr/bin/sh pid=380932
2020-09-18T17:42:59.015-0400 [DEBUG] plugin: waiting for RPC address: path=/usr/bin/sh
2020-09-18T17:42:59.144-0400 [DEBUG] plugin: using plugin: version=1
2020-09-18T17:42:59.145-0400 [TRACE] plugin.stdio: waiting for stdio data
2020-09-18T17:42:59.145-0400 [WARN ] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = Method not found!"

Output from ./kv get hello:

Sometimes I get this which is a success:

[logan@logan-lin-main grpc]$ ./kv get hello
2020-09-18T17:48:26.000-0400 [DEBUG] plugin: starting plugin: path=/usr/bin/sh args="[sh -c python plugin-python/plugin.py]"
2020-09-18T17:48:26.000-0400 [DEBUG] plugin: plugin started: path=/usr/bin/sh pid=383633
2020-09-18T17:48:26.000-0400 [DEBUG] plugin: waiting for RPC address: path=/usr/bin/sh
2020-09-18T17:48:26.146-0400 [DEBUG] plugin: using plugin: version=1
2020-09-18T17:48:26.146-0400 [TRACE] plugin.stdio: waiting for stdio data
2020-09-18T17:48:26.147-0400 [WARN ] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = Method not found!"
b'world'

Written from plugin-python

And sometimes it fails with the same error, and doesn't print the values associated with the key:

[logan@logan-lin-main grpc]$ ./kv get hello
2020-09-18T17:48:26.547-0400 [DEBUG] plugin: starting plugin: path=/usr/bin/sh args="[sh -c python plugin-python/plugin.py]"
2020-09-18T17:48:26.547-0400 [DEBUG] plugin: plugin started: path=/usr/bin/sh pid=383647
2020-09-18T17:48:26.547-0400 [DEBUG] plugin: waiting for RPC address: path=/usr/bin/sh
2020-09-18T17:48:26.696-0400 [DEBUG] plugin: using plugin: version=1
2020-09-18T17:48:26.697-0400 [TRACE] plugin.stdio: waiting for stdio data
Error: rpc error: code = Unimplemented desc = Method not found!
2020-09-18T17:48:26.697-0400 [WARN ] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = Method not found!"