upgrade-preflight

Validates self-hosted Lightdash upgrade safety using upgrade-check and migrate preflight commands.

6.1k|768|Updated Mar 19, 2021
One-click install
npx skills add https://github.com/lightdash/lightdash --skill upgrade-preflight
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: upgrade-preflight
Source: https://github.com/lightdash/lightdash/tree/main/skills/upgrade-preflight
Command: npx skills add https://github.com/lightdash/lightdash --skill upgrade-preflight

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Upgrading a self-hosted Lightdash instance without checking span safety and database readiness can cause failed, hung, or lock-stuck migrations. This Skill interprets the lightdash upgrade-check and migrate preflight commands correctly so operators know whether an upgrade is safe before a maintenance window.

Core Features & Use Cases

  • Span safety verification: Runs lightdash upgrade-check --json to gate on the safe field, handling tri-state verdicts, required stops, and unverifiable spans that fail closed.
  • Database preflight gating: Runs migrate preflight --json inside the image and branches on decision and summary.red/summary.yellow, distinguishing severity class from check outcome.
  • Misreading prevention: Flags calm-looking results that mean "could not check", such as a version-path yellow blinding lock and disk checks, or probe errors masquerading as quiet tables.
  • Use Case: An operator planning an upgrade from 1.130.0 to 1.138.0 uses this Skill to confirm the span is safe, run the preflight against the live database, surface every yellow check, and recover a parked migration lease per the runbook.

Quick Start

Ask the assistant to check whether upgrading your self-hosted Lightdash instance from your current version to a target version is safe, and to interpret the preflight results.

Frequently Asked Questions about upgrade-preflight

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if a Lightdash upgrade is safe before running it?

Run `lightdash upgrade-check --from <current> --to <target> --json` first to verify the version span, then run `pnpm -F backend migrate-production preflight --json` inside the image against the live database. Gate on the `safe` field and the `decision` field respectively.

What is the difference between lightdash upgrade-check and migrate preflight?

upgrade-check answers whether a version span is safe in principle by reading the public release-safety index, with no database needed. migrate preflight answers whether this specific database will take the upgrade right now, checking locks, transactions, disk, and PostgreSQL version.

Does an exit code of 1 from migrate preflight mean the upgrade is unsafe?

Not necessarily. Exit codes are binary: 0 for success, 1 for everything else including unsafe verdicts, aborted decisions, and errors like an unreachable index. Always parse the JSON payload on stdout to find the actual reason.

Why does migrate preflight show RED PASS in its output?

Severity is the class of a check, not its result. A check like postgres-version is always red-class, so a healthy server reports severity red with outcome pass, rendered as [RED PASS]. Only severity red paired with outcome fail counts toward summary.red and an abort.

What does a version-path warning mean during preflight?

It means the image has no baked release-safety artifact, so required-stop verification was skipped. The held-locks, long-transactions, and disk-headroom checks then pass vacuously because they have no table list to examine, so describe them as unverified rather than clear.

How do I recover a stuck or parked Lightdash migration?

Run `migrate status --json` to see the state: migrating with a recent heartbeat means wait, stale recovers on its own, and parked means the migrator stopped deliberately and needs an operator decision. The upgrade runbook's recovery section covers unlock and retry procedures.