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

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

Closed
danwinship opened this issue Dec 6, 2019 · 5 comments · Fixed by #735 or #760
Closed

Comments

@danwinship
Copy link
Contributor

If a plugin exits with a non-0 exit status and prints stuff to stderr but not stdout, then pkg/invoke/raw_exec.go:pluginErr() will categorize this as "netplugin failed with no error message". This seems to be in part because it forwards the plugin's stderr to its parent's stderr, which is nice and all, but it means that the stderr might end up getting logged somewhere less useful (eg, in cri-o's logs rather than kubelet's). Plus, the "failed with no error message" part is just wrong.

(Seen in two unrelated contexts with different plugins in the same day, lol)

@dcbw @squeed

@squeed
Copy link
Member

squeed commented Dec 11, 2019

Yeah, that makes sense. We give plugins the opportunity to output a reasonable error message via json, but that's not always possible.

@squeed
Copy link
Member

squeed commented Dec 11, 2019

While we're at it, we should interpret the exit code if it indicates abnormal termination.

@zjj2wry
Copy link
Contributor

zjj2wry commented Dec 19, 2019

Encountered this problem. kubectl describe pod will only get netplugin failed with no error message

@bboreham
Copy link
Contributor

bboreham commented Jan 8, 2020

Reopened because I'm not sure how #735 works.

@bboreham bboreham reopened this Jan 8, 2020
@dcbw
Copy link
Member

dcbw commented Apr 1, 2020

Yeah, I can't see where c.Run() in raw_exec.go will create an ExitError that includes stderr output.

dcbw added a commit to dcbw/cni that referenced this issue 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 issue 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 issue 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 issue 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 issue 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]>
asears pushed a commit to asears/cni that referenced this issue 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 issue 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants