{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/go-plugin/issues/45","repository_url":"https://api.github.com/repos/hashicorp/go-plugin","labels_url":"https://api.github.com/repos/hashicorp/go-plugin/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/go-plugin/issues/45/comments","events_url":"https://api.github.com/repos/hashicorp/go-plugin/issues/45/events","html_url":"https://github.com/hashicorp/go-plugin/issues/45","id":262254789,"number":45,"title":"Unable to get go-plugin/GRPC flavor working in container.","user":{"login":"manther","id":2479634,"avatar_url":"https://avatars2.githubusercontent.com/u/2479634?v=4","gravatar_id":"","url":"https://api.github.com/users/manther","html_url":"https://github.com/manther","followers_url":"https://api.github.com/users/manther/followers","following_url":"https://api.github.com/users/manther/following{/other_user}","gists_url":"https://api.github.com/users/manther/gists{/gist_id}","starred_url":"https://api.github.com/users/manther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manther/subscriptions","organizations_url":"https://api.github.com/users/manther/orgs","repos_url":"https://api.github.com/users/manther/repos","events_url":"https://api.github.com/users/manther/events{/privacy}","received_events_url":"https://api.github.com/users/manther/received_events","type":"User","site_admin":false},"labels":[{"id":314725980,"url":"https://api.github.com/repos/hashicorp/go-plugin/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-10-02T22:59:22Z","updated_at":"2017-12-13T14:32:19Z","closed_at":null,"author_association":"NONE","body":"Problem first happened with my teams project, but recreated the issue using the go-plugins example to be sure. \r\n\r\nSteps:\r\n\r\nContainer built FROM golang:latest\r\n\r\nrun interactively \r\n\r\n    1  go get github.com/hashicorp/go-plugin\r\n    2  cd src/github.com/hashicorp/go-plugin/examples/grpc/\r\n    3  go build -o kv\r\n    4  go build -o kv-go-grpc ./plugin-go-grpc\r\n    5  export KV_PLUGIN=\"./kv-go-grpc\"\r\n    6  ./kv put hello world\r\n\r\n\r\nroot@b93305f57ca2:/go/src/github.com/hashicorp/go-plugin/examples/grpc# ./kv put hello world\r\n2017-10-02T22:51:35.213Z [DEBUG] plugin: starting plugin: path=/bin/sh args=\"[sh -c ./kv-go-grpc]\"\r\n2017-10-02T22:51:35.214Z [DEBUG] plugin: waiting for RPC address: path=/bin/sh\r\n2017-10-02T22:51:35.220Z [DEBUG] plugin.sh: plugin address: timestamp=2017-10-02T22:51:35.220Z address=/tmp/plugin040334221 network=unix\r\n\r\n*It just hangs here indefinitely. (Same behavior as in my current project). \r\n\r\nIf, I do the same for the basic example and it runs fine. \r\n\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/go-plugin/issues/comments/351407881","html_url":"https://github.com/hashicorp/go-plugin/issues/45#issuecomment-351407881","issue_url":"https://api.github.com/repos/hashicorp/go-plugin/issues/45","id":351407881,"user":{"login":"gotohr","id":864692,"avatar_url":"https://avatars1.githubusercontent.com/u/864692?v=4","gravatar_id":"","url":"https://api.github.com/users/gotohr","html_url":"https://github.com/gotohr","followers_url":"https://api.github.com/users/gotohr/followers","following_url":"https://api.github.com/users/gotohr/following{/other_user}","gists_url":"https://api.github.com/users/gotohr/gists{/gist_id}","starred_url":"https://api.github.com/users/gotohr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gotohr/subscriptions","organizations_url":"https://api.github.com/users/gotohr/orgs","repos_url":"https://api.github.com/users/gotohr/repos","events_url":"https://api.github.com/users/gotohr/events{/privacy}","received_events_url":"https://api.github.com/users/gotohr/received_events","type":"User","site_admin":false},"created_at":"2017-12-13T14:32:19Z","updated_at":"2017-12-13T14:32:19Z","author_association":"NONE","body":"in that grpc example, there is this code:\r\n```\r\n\t// We're a host. Start by launching the plugin process.\r\n\tclient := plugin.NewClient(&plugin.ClientConfig{\r\n\t\tHandshakeConfig: shared.Handshake,\r\n\t\tPlugins:         PluginMap,\r\n\t\tCmd:             exec.Command(\"sh\", \"-c\", os.Getenv(\"KV_PLUGIN\")),\r\n```\r\nif we swap that last line with\r\n```\r\nCmd:             exec.Command(os.Getenv(\"KV_PLUGIN\")),\r\n```\r\nthus removing sh wrapper, host kills subprocess and doesn't hang.\r\nNow, can somebody tell me is this OK to do? Why do we wrap plugin cmd with sh?\r\n"}}
{"actor":{"display_login":"gotohr"}}