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

Capture stderr from plugin #759

Closed
wants to merge 1 commit into from
Closed

Capture stderr from plugin #759

wants to merge 1 commit into from

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented Apr 1, 2020

Fixes #732

Example from panic (using 'noop'):

netplugin failed: "panic: test panic\n\ngoroutine 1 [running]:\nmain.main()\n\tplugins/test/noop/main.go:220 +0x39\n"

If stderr is also blank I add the OS-level error:

netplugin failed with no error message: exit status 1

Signed-off-by: Bryan Boreham <[email protected]>
dcbw added a commit to dcbw/cni that referenced this pull request Apr 1, 2020
The way raw_exec invokes the command doesn't actually pass back
stderr, despite ExitError having that capability.  c.Run()
internally calls c.Wait() but that doesn't capture stderr and
insert it into the returned ExitError. So we have to do that
ourselves.

Fixes: containernetworking#732
Fixes: containernetworking#759

Signed-off-by: Dan Williams <[email protected]>
@dcbw
Copy link
Member

dcbw commented Apr 1, 2020

See also #760

dcbw added a commit to dcbw/cni that referenced this pull request Apr 1, 2020
The way raw_exec invokes the command doesn't actually pass back
stderr, despite ExitError having that capability.  c.Run()
internally calls c.Wait() but that doesn't capture stderr and
insert it into the returned ExitError. So we have to do that
ourselves.

Fixes: containernetworking#732
Fixes: containernetworking#759

Signed-off-by: Dan Williams <[email protected]>
dcbw added a commit to dcbw/cni that referenced this pull request Apr 2, 2020
The way raw_exec invokes the command doesn't actually pass back
stderr, despite ExitError having that capability.  c.Run()
internally calls c.Wait() but that doesn't capture stderr and
insert it into the returned ExitError. So we have to do that
ourselves.

Fixes: containernetworking#732
Fixes: containernetworking#759

Signed-off-by: Dan Williams <[email protected]>
dcbw added a commit to dcbw/cni that referenced this pull request Apr 8, 2020
The way raw_exec invokes the command doesn't actually pass back
stderr, despite ExitError having that capability.  c.Run()
internally calls c.Wait() but that doesn't capture stderr and
insert it into the returned ExitError. So we have to do that
ourselves.

Fixes: containernetworking#732
Fixes: containernetworking#759

Signed-off-by: Dan Williams <[email protected]>
dcbw added a commit to dcbw/cni that referenced this pull request Apr 8, 2020
The way raw_exec invokes the command doesn't actually pass back
stderr, despite ExitError having that capability.  c.Run()
internally calls c.Wait() but that doesn't capture stderr and
insert it into the returned ExitError. So we have to do that
ourselves.

Fixes: containernetworking#732
Fixes: containernetworking#759

Signed-off-by: Dan Williams <[email protected]>
@bboreham
Copy link
Contributor Author

bboreham commented Apr 8, 2020

closing in favour of #760

@bboreham bboreham closed this Apr 8, 2020
asears pushed a commit to asears/cni that referenced this pull request Apr 9, 2020
The way raw_exec invokes the command doesn't actually pass back
stderr, despite ExitError having that capability.  c.Run()
internally calls c.Wait() but that doesn't capture stderr and
insert it into the returned ExitError. So we have to do that
ourselves.

Fixes: containernetworking#732
Fixes: containernetworking#759

Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: asears <[email protected]>
asears pushed a commit to asears/cni that referenced this pull request Apr 9, 2020
The way raw_exec invokes the command doesn't actually pass back
stderr, despite ExitError having that capability.  c.Run()
internally calls c.Wait() but that doesn't capture stderr and
insert it into the returned ExitError. So we have to do that
ourselves.

Fixes: containernetworking#732
Fixes: containernetworking#759

Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: asears <[email protected]>
@squeed squeed deleted the capture-stderr branch February 1, 2021 11:17
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

Successfully merging this pull request may close these issues.

if plugin segfaults/panics, invoke.ExecPlugin... claims it "failed with no error message"
2 participants