Skip to content

migrate crashes at its audit step with HANDLER_CRASHED when no server observations exist #183

Closed

Description

@shipmill-romamo

Found while building #165 (PR #182); not yet reproduced by triage.

The problem

A cloudfall migrate --yes that gets past its deploy step on a project with no server observations crashes at the audit step with HANDLER_CRASHED, instead of a clean error naming what's missing. The implementer saw it on main before their change too, and their tests read the saved plan file to work around it.

Expected

The audit step either runs without observations or stops with a typed error (PRECONDITION and a context code naming the missing observations, with the command that records them), never HANDLER_CRASHED.

Activity

  1. shipmill-romamo commented on Oct 30, 2026

    @shipmill-romamo
    ContributorAuthor

    Triage: implement. A bug fix (quality bar). Reproduced from the code on main (70a167f): the audit step's runner, _verify_audit in sdk/src/cloudfall/migrate.py, calls load_observations, which raises ConfigValidationError (observation_directory_missing) when the observed directory doesn't exist. The step loop in execute_migration only catches MigrateError and LifecycleError, so the error escapes as HANDLER_CRASHED. The routes step (_verify_routes) calls load_observations the same way and crashes the same way.

    Plan: both steps stop with a typed error instead. Each raises MigrateError with a new code, migrate_observations_missing, whose detail names the missing directory and the command that records observations (cloudfall observe). The run saves its plan and reports the failing step as any other step error does, so a rerun after observe resumes at that step. An observed directory that exists but holds no snapshot for a declared server is left as it is: the audit reports it as drift (migrate_audit_drift), already a typed error. A regression test runs migrate --yes through the step with no observed directory and checks the code, and that the run isn't HANDLER_CRASHED.

  2. shipmill-romamo commented on Oct 30, 2026

    @shipmill-romamo
    ContributorAuthor

    PR: #184. audit and verify-routes now check for the observed directory first and fail with migrate_observations_missing, naming the directory and cloudfall observe; the plan is saved, so a rerun after observe resumes at that step. The CLI reports it as ENGINE_STEP_FAILED (exit 87), as it does every other migrate step error, rather than the PRECONDITION this issue suggested. A malformed snapshot and a server without one behave as before.

  3. added a commit that references this issue on Oct 30, 2026
    8c99771
  4. shipmill-romamo commented on Oct 31, 2026

    @shipmill-romamo
    ContributorAuthor

    Released in v0.8.0rc13 (pre-release).
    A plain install gets it with the next stable release.
    If you filed this: react 👍 on this comment once it works for you, or reply if it doesn't.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions