firecracker-microvm / firecracker-containerd

firecracker-containerd enables containerd to manage containers as Firecracker microVMs
Apache License 2.0
2.1k stars 179 forks source link

Expose firecracker errors more clearly #128

Open samuelkarp opened 5 years ago

samuelkarp commented 5 years ago

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 "$@" ```
kzys commented 4 years ago

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 commented 4 years ago

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