Skip to content

Commit 0ecccf5

Browse files
committed
feat(fire_vmm): surface the API readiness-probe failure reason
The :awaiting_api probe swallowed the describe_instance error and stopped with a bare :daemon_unready, hiding why a healthy-looking firecracker is unreachable. Log the last probe error on deadline and carry it in the stop reason ({:daemon_unready, reason}), so a host->jail socket permission/path problem is diagnosable instead of looking like an unexplained 5s restart loop.
1 parent 202141b commit 0ecccf5

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

lib/hyper/node/fire_vmm/state.ex

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ defmodule Hyper.Node.FireVMM.State do
113113
alias Hyper.Node.FireVMM.{Client, Opts}
114114
alias Unit.Time
115115

116+
require Logger
117+
116118
# How often to probe the daemon's API while waiting for it.
117119
@probe_interval Time.ms(50)
118120

@@ -123,9 +125,19 @@ defmodule Hyper.Node.FireVMM.State do
123125
{:ok, %InstanceInfo{}} ->
124126
{:next_state, :configuring, data, [{:state_timeout, 0, :configure}]}
125127

126-
{:error, _reason} ->
128+
{:error, reason} ->
127129
if System.monotonic_time(:millisecond) >= data.boot_deadline do
128-
{:stop, {:shutdown, {:boot_failed, :daemon_unready}}, data}
130+
# firecracker's own log shows the API server is up, so a persistent
131+
# probe failure points at the host->jail socket (path or, more often,
132+
# permissions: the jailer drops firecracker to the per-VM uid and the
133+
# unprivileged controller cannot reach the jailed socket). Surface the
134+
# last error rather than swallowing it into a bare :daemon_unready.
135+
Logger.warning(
136+
"vm #{id}: firecracker API not reachable before deadline; " <>
137+
"last probe error: #{inspect(reason)}"
138+
)
139+
140+
{:stop, {:shutdown, {:boot_failed, {:daemon_unready, reason}}}, data}
129141
else
130142
{:keep_state_and_data, [{:state_timeout, Time.as_ms(@probe_interval), :probe}]}
131143
end

0 commit comments

Comments
 (0)