dbt-labs/dbt-core · error

Progress style template is valid

Error message

Progress style template is valid

What it means

Panic from `.expect()` in `ProgressStyleType::get_style` when building the Spinner style. The template string is a compile-time constant; indicatif's `with_template` only fails for templates referencing invalid format keys. The expect asserts the built-in template is always valid — hitting it means an indicatif version incompatibility or corrupted build, not user input.

Solutions

  1. Check the locked `indicatif` version (`cargo tree -p indicatif`) and pin it to the version the crate was developed against.
  2. Update `dbt-tui-progress` templates if indicatif was intentionally upgraded and a key was renamed/removed.
  3. Report upstream if the crash occurs with the expected dependency versions — it signals a broken template constant.

Example fix

// Cargo.toml before (indicatif drifted)
indicatif = "0.18"

// after (pin to compatible version)
indicatif = "=0.17.8"
Defensive patterns

Strategy: validation

Validate before calling

// CI smoke test
test_style_constructs(ProgressStyleType::Spinner);

Prevention

When it happens

Trigger: Calling `get_style()` on `ProgressStyleType::Spinner` while the installed `indicatif` crate version rejects one of the template keys (`{prefix}`, `{spinner}`, `{elapsed}`, `{counters}`, `{context}`) — e.g. after a semver-incompatible indicatif upgrade.

Common situations: Dependency resolution pulled a different indicatif major/minor than the one the templates were written against; vendored/patched builds with altered feature flags.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of dbt-labs/dbt-core@0267ce9170 (2026-09-07). Data as JSON: /api/errors/75d8b394c67ed55e. Report an issue: GitHub.

Appendix: source

Thrown at crates/dbt-tui-progress/src/styles.rs:41

/// Available progress bar style variants.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ProgressStyleType {
    /// A simple spinner with elapsed time, counters, and context items.
    Spinner,
    /// A wide progress bar with position/total and elapsed time.
    FancyWideBar,
    /// A thin progress bar with counters, displaying context on a separate line.
    FancyThinBarWithCounters,
}

impl ProgressStyleType {
    /// Returns the indicatif `ProgressStyle` for this style type.
    pub fn get_style(&self) -> ProgressStyle {
        match self {
            ProgressStyleType::Spinner => ProgressStyle::with_template(
                "{prefix:.cyan.bold} {spinner:.green.bold} [{elapsed}] {counters} {context}",
            )
            .expect("Progress style template is valid"),
            ProgressStyleType::FancyWideBar => ProgressStyle::default_bar()
                .template("{prefix:.cyan.bold} {spinner:.green} ▐{bar:20.bright_cyan/dim}▌ {pos}/{human_len} [{elapsed}]")
                .expect("Progress style template is valid")
                .progress_chars("█▉▊▋▌▍▎▏ "),
            ProgressStyleType::FancyThinBarWithCounters => ProgressStyle::default_bar()
                .template("{prefix:.cyan.bold} [{bar:20.cyan}] {pos}/{len} {counters}")
                .expect("Progress style template is valid")
                .progress_chars("━━╾─ "),
        }
    }

    /// Returns the style for the context line (used with `FancyThinBarWithCounters`).
    pub fn get_context_line_style(&self) -> ProgressStyle {
        ProgressStyle::with_template("   {context}").expect("Progress style template is valid")
    }

    /// Returns whether this style type needs a separate context line.
    pub fn needs_context_line(&self) -> bool {

View on GitHub (pinned to 0267ce9170)