firecracker-containerd icon indicating copy to clipboard operation
firecracker-containerd copied to clipboard

Expose firecracker errors more clearly

Open samuelkarp opened this issue 5 years ago • 2 comments

Right now, if firecracker has an error, we show a pretty cryptic message like ctr: Put http://localhost/machine-config: dial unix /tmp/firecracker.sock: connect: no such file or directory: unknown. I've been using the following wrapper script around the firecracker binary to save its output and get a better handle at diagnosing what went wrong, but we need to do a better job of making this accessible.

workaround wrapper script
$ cat /usr/local/bin/firecracker-wrapper 
#!/bin/sh

exec > /tmp/firecracker.log
exec 2>&1

echo "Options: $@"

exec /usr/local/bin/firecracker "$@"

samuelkarp avatar Mar 06 '19 21:03 samuelkarp

The Go SDK is able to bind stdout/stderr

https://github.com/firecracker-microvm/firecracker-go-sdk/blob/b704cc3feb1e827244ddbc8a25c55c482f7f6e36/command_builder.go#L103-L119

but we are not utilizing it so far.

https://github.com/firecracker-microvm/firecracker-containerd/blob/b25fb56e6cd4cb39a04114dc48fba02faf8d538c/runtime/service.go#L478-L481

kzys avatar Jul 26 '19 16:07 kzys

Note that jailer support (#122) may change the way we invoke Firecracker.

kzys avatar Jul 26 '19 16:07 kzys