8000 boxes, minimald, minvmd: refuse a newer box-state format before changing anything, and show why on the host · Issue #3842 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

boxes, minimald, minvmd: refuse a newer box-state format before changing anything, and show why on the host #3842

Done

Description

@agent-137

Situation

The box store records a state format in sessions/index.json (format_version, which INDEX_FORMAT_VERSION = 1 writes, crates/boxes/src/store.rs:1107). A minimald that meets a newer format refuses it (read_index, store.rs:1155). Three things keep that refusal from doing its job, and gominimal/inbox#1330 (0.7 to 0.8 upgrade, must-have for 0.8.0) needs all three fixed: "A 0.8 binary that meets provider state it cannot use stops with a message that names the version mismatch and the next step, and changes nothing."

  1. It changes the state before it refuses. DiskLoader::new (store.rs:1433) creates the sessions directory and runs tighten_store_modes (BOX-232) before it reads index.json (store.rs:1435-1453). On a refused store, the modes are already changed.
  2. The message names no next step. Today it reads: "<path> has format version N. This minimald reads format version 1 or older. A newer minimald wrote this file."
  3. In the VM, nobody sees it.
    • The guest's store error ends at crates/minimald/src/main.rs:461 ("microVM init failed; shutting the VM down"), and the guest shuts down.
    • The host gets no beacon and prints only "the detached supervisor exited during startup" (crates/minvmd/src/cmd/run.rs:371, then crates/minimal/src/autospawn.rs). That is the silent failure of diag: Downgrade from 0.8.0-dev to 0.7.3-rc1: the old guest minimald cannot parse the newer box store index #3060.
    • A data-volume mount failure already reaches the host with its reason, as the MOUNT_FAILED beacon (guest::emit_mount_failed_marker, crates/minimald/src/guest.rs:258; host side BootBeacon in crates/minvmd/src/cmd/mod.rs:448 and run.rs:3675).

Work

  • Read before any write. DiskLoader::new reads and checks the format version before it creates a directory, tightens a mode, heals, reconciles or flushes anything. A store whose index.json has a newer format is refused with the tree byte-identical, modes and mtimes included.
  • The refusal names the mismatch and the next step. Exact text, pinned in the test:
    The box state in <state dir> was written by a newer release of Minimal (state format <N>). This release reads state format 1 or older, so it stopped and changed nothing. Install the release that wrote this state, or restore the copy of this directory that you made before you upgraded.
    <state dir> is the directory that holds sessions/. On the VM host it is the guest path, followed by the host's data volume path, which minvmd adds.
  • In the VM, the guest sends the reason to the host.
    • A refused store emits a new beacon, STATE_REFUSED\n<one-line reason>\n, and parks as the MOUNT_FAILED path does. It never sends READY. It uses the same 512-byte cap and one-line flattening as mount_failed_beacon.
    • minvmd reads it as a new BootBeacon::StateRefused { reason }.
    • minvmd fails the boot with the guest's reason, plus one sentence naming the data volume path. It does not remove or touch the volume.
  • min prints it. On autospawn, and on any command that starts the host, min prints the refusal text as the command's error and exits non-zero. It replaces the "detached supervisor exited during startup" text for this cause, and adds no retry advice. It does the same for a native Linux minimald that refuses at startup.
  • Out of scope: a format bump, the installer archive and downgrade check (inbox#1330 open questions 1 and 2), and 0.7.x.

Tests

  • boxes: store_refuses_a_newer_format_and_changes_nothing builds a store with format_version = 2, some wide modes and a record. DiskLoader::new must return the refusal, and the tree must be byte-identical with the same modes.
  • boxes: the refusal's text, pinned.
  • minimald: the STATE_REFUSED beacon is two lines, flattened and capped, as mount_failed_beacon_is_two_lines_flattened_and_capped.
  • minvmd: read_ready_beacon parses STATE_REFUSED with and without a reason line.
  • minimal: the autospawn boot-failure error for a state refusal carries the refusal text and no retry advice.

Refs gominimal/inbox#1330, #3060, #3567.

Activity

  1. added
    priority:must-have
    release:0.8.0
    on Nov 27, 2026
  2. agent-137 commented on Nov 27, 2026

    @agent-137
    MemberAuthor

    Fixed by #3850 (D3842, task #3843), merged as 82e17fb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:must-haverelease:0.8.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0