From 1d47aec0f03f52a16a3972975281fc359d48adc8 Mon Sep 17 00:00:00 2001 From: "gominimal-aw-bot[bot]" <281738952+gominimal-aw-bot[bot]@users.noreply.github.com> Date: Sun, 11 Oct 2026 19:57:12 +0000 Subject: [PATCH 1/3] fix(minvmd): reword the DNS-service refusals and minzoned release replies The host daemon's DNS-service refusals and minzoned's release output spelled the failure in internal vocabulary: hook ports, interim answerers, answerer services. Reword the fourteen refusal, release and handover strings in plain language, in place, with no behavior change; each one keeps the facts it already reported. The tracing lines and the detail strings scripts/session-e2e.sh greps are unchanged, and the minimald mirror is untouched. Five test pins follow the reworded strings; everything else in the suite is byte-identical. --- crates/minvmd/src/cmd/answerer.rs | 21 ++++---- crates/minvmd/src/net/answerer.rs | 81 ++++++++++++++++--------------- 2 files changed, 53 insertions(+), 49 deletions(-) diff --git a/crates/minvmd/src/cmd/answerer.rs b/crates/minvmd/src/cmd/answerer.rs index ac9eb5755b..f39cbe839a 100644 --- a/crates/minvmd/src/cmd/answerer.rs +++ b/crates/minvmd/src/cmd/answerer.rs @@ -106,7 +106,7 @@ const CONTROL_REPLY_TIMEOUT: std::time::Duration = std::time::Duration::from_sec pub fn release(controls: &[std::path::PathBuf], port: u16) -> Result<()> { for control in controls { if let Some(reply) = ask(control, &minimald_rpc::BoxControlRequest::ReleaseAnswerer)? { - eprintln!("minzoned: {}: {reply}", control.display()); + eprintln!("minzoned: {reply}"); } } let deadline = std::time::Instant::now() + PORT_FREE_WAIT; @@ -116,11 +116,8 @@ pub fn release(controls: &[std::path::PathBuf], port: u16) -> Result<()> { } if std::time::Instant::now() >= deadline { bail!( - "the hook port 127.0.0.1:{port} is still held {} s after the release: \ - another process holds it (a collision — a VM host daemon of another \ - state dir, a native minimald, or a foreign process), so the answerer \ - service cannot take it", - PORT_FREE_WAIT.as_secs() + "port 127.0.0.1:{port} is still in use by another process, so Minimal's DNS \ + service cannot take it; stop that process and run `min finalize-install` again" ); } std::thread::sleep(std::time::Duration::from_millis(100)); @@ -137,7 +134,7 @@ pub fn release_cancel(controls: &[std::path::PathBuf]) { control, &minimald_rpc::BoxControlRequest::ReleaseAnswererCancel, ) { - Ok(Some(reply)) => eprintln!("minzoned: {}: {reply}", control.display()), + Ok(Some(reply)) => eprintln!("minzoned: {reply}"), Ok(None) => {} Err(error) => eprintln!("minzoned: {}: {error:#}", control.display()), } @@ -183,12 +180,16 @@ fn ask( })) } Ok(minimald_rpc::BoxControlReply::Error { error }) => { - bail!("{} refused the request: {error}", control.display()) + bail!( + "the Minimal VM daemon at {} refused the request: {error}", + control.display() + ) } Ok(other) => bail!("{} answered {other:?}", control.display()), Err(error) => bail!( - "{} answered nothing this verb understands ({error}); the daemon may predate \ - the handover", + "the Minimal VM daemon at {} sent a reply this minzoned does not understand \ + ({error}); it may be an older version: run `min stop`, then \ + `min finalize-install` again", control.display() ), } diff --git a/crates/minvmd/src/net/answerer.rs b/crates/minvmd/src/net/answerer.rs index a1834c1f2c..b1e08525ce 100644 --- a/crates/minvmd/src/net/answerer.rs +++ b/crates/minvmd/src/net/answerer.rs @@ -330,8 +330,8 @@ fn prepare_interim_dir(sock: &Path) -> io::Result<()> { return Err(io::Error::new( io::ErrorKind::PermissionDenied, format!( - "the interim answerer channel's dir {} is not a directory owned by \ - uid {uid} with mode 0700 (owner {}, mode {:o}); refusing to bind in it", + "{} must be a directory owned by uid {uid} with mode 0700, \ + but it has owner {} and mode {:o}; the VM will not create its socket there", dir.display(), meta.uid(), meta.mode() & 0o7777 @@ -655,17 +655,15 @@ impl AddressBook { let (held, quarantined) = (self.held.len(), self.released.len()); return Err(match next { Some(wait) => format!( - "{} {first}-{last} is held or was released less than \ - {} s ago (the answer TTL a host resolver may still serve it under): \ - {held} of {capacity} are held by live boxes and {quarantined} are \ - quarantined; the next one frees in {} s", + "{} {first}-{last} is in use or was released in the last {} s: \ + {held} of {capacity} are in use and {quarantined} were just released; \ + the next one frees in {} s", minimald_rpc::BOX_ADDRESSES_EXHAUSTED, REUSE_QUARANTINE.as_secs(), wait.as_secs().max(1) ), None => format!( - "{} {first}-{last} is held ({held} of {capacity} by \ - live boxes); none remains to hand out", + "{} {first}-{last} is in use ({held} of {capacity}); none is free", minimald_rpc::BOX_ADDRESSES_EXHAUSTED, ), }); @@ -2414,7 +2412,7 @@ fn refuse_command(command: HandoverCommand, why: &str) { match command { HandoverCommand::Release(reply) | HandoverCommand::Cancel(reply) => { let _ = reply.send(ReleaseReply::no_op( - "this VM host daemon hosts no interim answerer", + "the running VM is not answering box names itself", )); } HandoverCommand::Allocate { reply, .. } => { @@ -2538,25 +2536,23 @@ fn channelless_holder_error(port: u16, holder: Option<(u32, String)>) -> String ); if native { format!( - "the zone answerer's hook port 127.0.0.1:{port} is held by a native minimald, \ - {who}, with no answerer channel, so no box can be handed an address: install \ - the answerer service (min session start prints the command); native daemons \ - publish into it once T90 lands" + "port 127.0.0.1:{port}, which box names are answered on, is in use by a Minimal \ + daemon running directly on this machine ({who}), so no box in the VM can be given \ + an address; run `min finalize-install` to install Minimal's DNS service on that \ + port instead" ) } else { format!( - "the zone answerer's hook port 127.0.0.1:{port} is held by {who}, which has no \ - answerer channel, so no box can be handed an address: free port {port} or set \ - the hook port" + "port 127.0.0.1:{port}, which box names are answered on, is in use by {who}, so no \ + box in the VM can be given an address; free the port, then try again" ) } } /// Why a box cannot be handed an address while this daemon reaches no /// answerer. -const NO_ANSWERER: &str = "this VM host daemon reaches no zone answerer to hand the box an \ - address (see the zone-answerer lines in its log); box addresses \ - are allocated host-wide by the answerer, never by the node"; +const NO_ANSWERER: &str = "the running VM cannot reach Minimal's DNS service for box names, so \ + this box cannot be given an address"; /// The answer to a release or a cancel: whether it changed anything, and /// the sentence the daemon logged for it. @@ -2674,7 +2670,7 @@ impl AnswererStatus { reply .recv_timeout(RELEASE_WINDOW + RELEASE_REPLY_TIMEOUT) .unwrap_or_else(|_| { - Err("the zone answerer did not hand out an address in time".to_string()) + Err("Minimal's DNS service for box names did not give this box an address in time; try again".to_string()) }) } @@ -2756,7 +2752,7 @@ impl AnswererStatus { ) -> ReleaseReply { if !self.0.hosting.load(Ordering::SeqCst) { return ReleaseReply::no_op(format!( - "this VM host daemon hosts no interim answerer; {nothing}" + "the running VM is not answering box names itself; {nothing}" )); } let sender = self @@ -2767,19 +2763,19 @@ impl AnswererStatus { .clone(); let Some(sender) = sender else { return ReleaseReply::no_op(format!( - "this VM host daemon's answerer is not running; {nothing}" + "the running VM's box-name service is not running; {nothing}" )); }; let (reply_to, reply) = std::sync::mpsc::channel(); if sender.send(command(reply_to)).is_err() { return ReleaseReply::no_op(format!( - "this VM host daemon's answerer is not running; {nothing}" + "the running VM's box-name service is not running; {nothing}" )); } reply .recv_timeout(RELEASE_REPLY_TIMEOUT) .unwrap_or_else(|_| { - ReleaseReply::no_op("the zone answerer did not answer the request in time") + ReleaseReply::no_op("the running VM did not answer the request in time") }) } } @@ -3220,8 +3216,8 @@ fn acquire( } Err(error) => { let why = format!( - "could not bind the zone answerer's hook port 127.0.0.1:{port}: {error}; \ - free port {port} or set the hook port" + "could not listen on 127.0.0.1:{port}, which box names are answered on: \ + {error}" ); surface_error(status, port, &mut erroring, &why); wait_refusing(&pings, &commands, PORT_RECHECK, &why); @@ -3358,7 +3354,7 @@ fn host_interim( }; if let Some(reply_to) = rebound.take() { let _ = reply_to.send(ReleaseReply::acted(format!( - "re-bound the interim answerer at 127.0.0.1:{port}" + "the running VM is answering box names on 127.0.0.1:{port} again" ))); } // ── hosting: wait for a release. @@ -3367,7 +3363,7 @@ fn host_interim( Ok(HandoverCommand::Release(reply_to)) => break reply_to, Ok(HandoverCommand::Cancel(reply_to)) => { let _ = reply_to.send(ReleaseReply::no_op( - "no release is pending; the interim answerer is serving", + "no handover is in progress; the running VM is answering box names", )); } // The interim is the answerer: its own boxes are handed @@ -3401,7 +3397,11 @@ fn host_interim( paths.global.display() ); tracing::info!(component = COMPONENT, port, "{detail}"); - let _ = release.send(ReleaseReply::acted(detail)); + let _ = release.send(ReleaseReply::acted(format!( + "the running VM stopped answering box names on 127.0.0.1:{port} so Minimal's DNS \ + service can take over; it resumes after {} s if the service has not started", + paths.release_window.as_secs() + ))); // ── the window: the service's channel, a cancel, or the bound. let deadline = Instant::now() + paths.release_window; // Box address requests that arrive mid-handover wait for the @@ -3413,7 +3413,7 @@ fn host_interim( Ok(HandoverCommand::Cancel(reply_to)) => break WindowEnd::Cancelled(reply_to), Ok(HandoverCommand::Release(reply_to)) => { let _ = reply_to.send(ReleaseReply::no_op( - "the interim answerer is already released", + "the running VM already stopped answering box names", )); } Ok( @@ -3464,15 +3464,16 @@ fn host_interim( for command in queued { refuse_command( command, - "answerer handover did not complete: the answerer service's channel did not \ - answer within the release window", + "the handover of box names to Minimal's DNS service did not finish, so this \ + box was not given an address; try again", ); } match UdpSocket::bind((Ipv4Addr::LOCALHOST, port)) { Ok(bound) => socket = bound, Err(error) => { - let detail = - format!("could not re-bind the interim answerer at 127.0.0.1:{port}: {error}"); + let detail = format!( + "the running VM could not resume answering box names on 127.0.0.1:{port}: {error}" + ); tracing::warn!(component = COMPONENT, port, "{detail}"); if let Some(reply_to) = rebound.take() { let _ = reply_to.send(ReleaseReply::no_op(detail)); @@ -5643,7 +5644,7 @@ mod tests { .allocate_at("node-b", "late", t0 + Duration::from_secs(10)) .expect_err("nothing is free outside the quarantine"); assert!( - refused.contains("released less than 15 s ago") && refused.contains("frees in 5 s"), + refused.contains("released in the last 15 s") && refused.contains("frees in 5 s"), "the refusal names the quarantine and the wait: {refused}" ); assert_eq!( @@ -5910,7 +5911,9 @@ mod tests { let refused = prepare_interim_dir(&wide.join(INTERIM_CHANNEL_SOCK_FILE)) .expect_err("a dir open to others is refused"); assert!( - refused.to_string().contains("refusing to bind"), + refused + .to_string() + .contains("will not create its socket there"), "{refused}" ); } @@ -6190,13 +6193,13 @@ mod tests { "the error names the holder's pid: {refused}" ); assert!( - refused.contains(&format!("free port {port} or set the hook port")), + refused.contains("free the port, then try again"), "the error gives the remedy: {refused}" ); // The native remedy, for a minimald holder. let native = channelless_holder_error(port, Some((42, "/usr/bin/minimald".to_string()))); assert!( - native.contains("install the answerer service (min session start prints the command)") + native.contains("run `min finalize-install` to install Minimal's DNS service") && native.contains("pid 42"), "{native}" ); @@ -6264,7 +6267,7 @@ mod tests { let reply = status.release_cancel(); assert!(reply.acted, "the cancel re-binds: {reply:?}"); assert!( - reply.detail.contains("re-bound"), + reply.detail.contains("again"), "and says so: {}", reply.detail ); From fcff8b16d3edf0ac79bc9da90b5885ec02f3acd6 Mon Sep 17 00:00:00 2001 From: "gominimal-aw-bot[bot]" <281738952+gominimal-aw-bot[bot]@users.noreply.github.com> Date: Sun, 11 Oct 2026 13:06:16 -0700 Subject: [PATCH 2/3] fix(minvmd): name the handover, not service startup, in the release reply The release window ends only when the service's channel takes the node's publish, so a service that started but whose handover failed still sees the VM resume. Say so. Keep the free-the-port remedy on the listen failure, and align the ReleaseReply doc with the reply no longer being the logged sentence. --- crates/minvmd/src/net/answerer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/minvmd/src/net/answerer.rs b/crates/minvmd/src/net/answerer.rs index b1e08525ce..261a999baf 100644 --- a/crates/minvmd/src/net/answerer.rs +++ b/crates/minvmd/src/net/answerer.rs @@ -2555,7 +2555,7 @@ const NO_ANSWERER: &str = "the running VM cannot reach Minimal's DNS service for this box cannot be given an address"; /// The answer to a release or a cancel: whether it changed anything, and -/// the sentence the daemon logged for it. +/// a sentence saying what the daemon did. #[derive(Debug, Clone, PartialEq, Eq)] pub struct ReleaseReply { /// Whether the request changed anything. @@ -3217,7 +3217,7 @@ fn acquire( Err(error) => { let why = format!( "could not listen on 127.0.0.1:{port}, which box names are answered on: \ - {error}" + {error}; free the port, then try again" ); surface_error(status, port, &mut erroring, &why); wait_refusing(&pings, &commands, PORT_RECHECK, &why); @@ -3399,7 +3399,7 @@ fn host_interim( tracing::info!(component = COMPONENT, port, "{detail}"); let _ = release.send(ReleaseReply::acted(format!( "the running VM stopped answering box names on 127.0.0.1:{port} so Minimal's DNS \ - service can take over; it resumes after {} s if the service has not started", + service can take over; it resumes after {} s if the handover has not finished", paths.release_window.as_secs() ))); // ── the window: the service's channel, a cancel, or the bound. From 4ea451876ee4a20896215bb1acdba410bf9d52c0 Mon Sep 17 00:00:00 2001 From: "gominimal-aw-bot[bot]" <281738952+gominimal-aw-bot[bot]@users.noreply.github.com> Date: Sun, 11 Oct 2026 13:12:31 -0700 Subject: [PATCH 3/3] fix(minvmd): name the daemon and the next step in the reworded DNS-service refusals The control sockets minzoned asks include a native daemon's, so the refusal says "the Minimal daemon", not "VM daemon". With several control sockets the release echoes name the socket again, so the answers can be told apart. The no-DNS-service refusal gains a next step, and the release and cancel replies are pinned by distinctive phrases. --- crates/minvmd/src/cmd/answerer.rs | 19 +++++++++++++++---- crates/minvmd/src/net/answerer.rs | 27 +++++++++++++++++++++------ 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/crates/minvmd/src/cmd/answerer.rs b/crates/minvmd/src/cmd/answerer.rs index f39cbe839a..c7df2f771a 100644 --- a/crates/minvmd/src/cmd/answerer.rs +++ b/crates/minvmd/src/cmd/answerer.rs @@ -106,7 +106,7 @@ const CONTROL_REPLY_TIMEOUT: std::time::Duration = std::time::Duration::from_sec pub fn release(controls: &[std::path::PathBuf], port: u16) -> Result<()> { for control in controls { if let Some(reply) = ask(control, &minimald_rpc::BoxControlRequest::ReleaseAnswerer)? { - eprintln!("minzoned: {reply}"); + echo(controls, control, &reply); } } let deadline = std::time::Instant::now() + PORT_FREE_WAIT; @@ -134,13 +134,24 @@ pub fn release_cancel(controls: &[std::path::PathBuf]) { control, &minimald_rpc::BoxControlRequest::ReleaseAnswererCancel, ) { - Ok(Some(reply)) => eprintln!("minzoned: {reply}"), + Ok(Some(reply)) => echo(controls, control, &reply), Ok(None) => {} Err(error) => eprintln!("minzoned: {}: {error:#}", control.display()), } } } +/// Prints one daemon's answer. With several control sockets asked, the line +/// names the socket, so the answers of the default VM, a named VM, and a +/// native daemon can be told apart. +fn echo(controls: &[std::path::PathBuf], control: &std::path::Path, reply: &str) { + if controls.len() > 1 { + eprintln!("minzoned: {}: {reply}", control.display()); + } else { + eprintln!("minzoned: {reply}"); + } +} + /// One request over one daemon's control socket: `None` when no daemon is /// there (the socket is absent, or nothing listens behind it), else the /// daemon's answer as a sentence. @@ -181,13 +192,13 @@ fn ask( } Ok(minimald_rpc::BoxControlReply::Error { error }) => { bail!( - "the Minimal VM daemon at {} refused the request: {error}", + "the Minimal daemon at {} refused the request: {error}", control.display() ) } Ok(other) => bail!("{} answered {other:?}", control.display()), Err(error) => bail!( - "the Minimal VM daemon at {} sent a reply this minzoned does not understand \ + "the Minimal daemon at {} sent a reply this minzoned does not understand \ ({error}); it may be an older version: run `min stop`, then \ `min finalize-install` again", control.display() diff --git a/crates/minvmd/src/net/answerer.rs b/crates/minvmd/src/net/answerer.rs index 261a999baf..8056477674 100644 --- a/crates/minvmd/src/net/answerer.rs +++ b/crates/minvmd/src/net/answerer.rs @@ -2552,7 +2552,9 @@ fn channelless_holder_error(port: u16, holder: Option<(u32, String)>) -> String /// Why a box cannot be handed an address while this daemon reaches no /// answerer. const NO_ANSWERER: &str = "the running VM cannot reach Minimal's DNS service for box names, so \ - this box cannot be given an address"; + this box cannot be given an address; run `min finalize-install --show` \ + to check the service's setup, or see minvmd.log for the cause (`min \ + dirs` shows where logs are kept)"; /// The answer to a release or a cancel: whether it changed anything, and /// a sentence saying what the daemon did. @@ -2670,7 +2672,11 @@ impl AnswererStatus { reply .recv_timeout(RELEASE_WINDOW + RELEASE_REPLY_TIMEOUT) .unwrap_or_else(|_| { - Err("Minimal's DNS service for box names did not give this box an address in time; try again".to_string()) + Err( + "Minimal's DNS service for box names did not give this box an address in \ + time; try again" + .to_string(), + ) }) } @@ -2763,13 +2769,13 @@ impl AnswererStatus { .clone(); let Some(sender) = sender else { return ReleaseReply::no_op(format!( - "the running VM's box-name service is not running; {nothing}" + "the running VM is not answering box names right now; {nothing}" )); }; let (reply_to, reply) = std::sync::mpsc::channel(); if sender.send(command(reply_to)).is_err() { return ReleaseReply::no_op(format!( - "the running VM's box-name service is not running; {nothing}" + "the running VM is not answering box names right now; {nothing}" )); } reply @@ -3472,7 +3478,8 @@ fn host_interim( Ok(bound) => socket = bound, Err(error) => { let detail = format!( - "the running VM could not resume answering box names on 127.0.0.1:{port}: {error}" + "the running VM could not resume answering box names on \ + 127.0.0.1:{port}: {error}" ); tracing::warn!(component = COMPONENT, port, "{detail}"); if let Some(reply_to) = rebound.take() { @@ -6078,6 +6085,12 @@ mod tests { std::fs::write(&paths.marker, b"").expect("the marker is written"); let reply = status.release(); assert!(reply.acted, "the hosting daemon releases: {reply:?}"); + assert!( + reply.detail.contains("stopped answering box names") + && !reply.detail.contains("interim answerer"), + "the reply is the user's sentence, not the logged one: {}", + reply.detail + ); let listener = UdpSocket::bind((Ipv4Addr::LOCALHOST, port)) .expect("the port is free once the release is answered"); assert!(!paths.interim.exists(), "the interim's channel is retired"); @@ -6267,7 +6280,9 @@ mod tests { let reply = status.release_cancel(); assert!(reply.acted, "the cancel re-binds: {reply:?}"); assert!( - reply.detail.contains("again"), + reply + .detail + .contains(&format!("is answering box names on 127.0.0.1:{port} again")), "and says so: {}", reply.detail );