astrid-runtime/astrid · error

nightly channel must point to an exact nightly prerelease

Error message

nightly channel must point to an exact nightly prerelease

What it means

A nightly channel pointer must reference an exact nightly prerelease version: the version's pre-release segment must encode the nightly source commit (via nightly_source_commit) and the build metadata must be empty. This ensures a nightly pointer pins one reproducible build rather than a generic or mislabeled version.

Source

Thrown at crates/astrid-cli/src/commands/update_channel.rs:504

            .context("channel publication skew overflowed the clock")?;
        ensure!(
            published <= latest_reasonable_publication,
            "signed channel published-at is unreasonably far in the future"
        );
    }
    let max_lifetime = match expected_channel {
        UpdateChannel::Stable => chrono::Duration::days(30),
        UpdateChannel::Dev => chrono::Duration::days(7),
        UpdateChannel::Nightly => chrono::Duration::days(2),
    };
    ensure!(
        expires.signed_duration_since(published) <= max_lifetime,
        "signed channel lifetime exceeds the maximum for its channel"
    );
    let version = canonical_version(&pointer.release.version)?;
    let nightly_commit = nightly_source_commit(&version);
    match expected_channel {
        UpdateChannel::Nightly => ensure!(
            nightly_commit.is_some() && version.build.is_empty(),
            "nightly channel must point to an exact nightly prerelease"
        ),
        UpdateChannel::Stable | UpdateChannel::Dev => ensure!(
            version.pre.is_empty() && version.build.is_empty(),
            "stable and dev channels must point to canonical releases"
        ),
    }
    ensure!(
        pointer.release.tag == format!("v{version}"),
        "signed channel release tag does not match its version"
    );
    ensure!(
        is_commit(&pointer.release.source_commit),
        "signed channel source commit is invalid"
    );
    if let Some(commit) = nightly_commit {
        ensure!(

View on GitHub (pinned to affd8760f4)

Solutions

  1. Set the nightly version to the canonical prerelease form `X.Y.Z-nightly.<date>.<commit>` with no build metadata and republish
  2. If you meant to publish a normal release, use the stable or dev channel instead
  3. Re-run the nightly release workflow so it embeds the source commit in the pre-release segment
  4. Do not 'clean' the version string before writing it into the nightly pointer

Example fix

// before (channel.toml)
version = "0.5.0"
// after
version = "0.5.0-nightly.20260909.a1b2c3d"
Defensive patterns

Strategy: validation

Validate before calling

fn nightly_version_ok(v: &semver::Version) -> bool {
    !v.pre.is_empty() && v.pre.as_str().starts_with("nightly") && v.build.is_empty()
}

Type guard

fn is_nightly_prerelease(version: &str) -> bool {
    match semver::Version::parse(version) {
        Ok(v) => !v.build.is_empty() == false && !v.pre.is_empty(),
        Err(_) => false,
    }
}

Try / catch

match parse_channel(&bytes, UpdateChannel::Nightly, now) {
    Err(e) if e.to_string().contains("exact nightly prerelease") => {
        anyhow::bail!("nightly channel points at a non-nightly version: {}", /* logged version */)
    }
    other => other?,
}

Prevention

When it happens

Trigger: parse_channel or enforce_continuity with expected_channel = Nightly and a release version like `0.5.0` (no pre-release) or `0.5.0-nightly.20260909+abc` (build metadata present), i.e. missing the embedded commit or carrying non-empty `version.build`.

Common situations: Publisher pointing the nightly channel at a stable/dev release by mistake; someone stripping build/pre segments when normalizing the version; a template pointer reused across channels without rewriting the version.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/fc148a03add89ed7. Report an issue: GitHub.