clockworklabs/SpacetimeDB · info · anyhow::Error

Aborted.

Error message

Aborted.

What it means

Publishing in a mode that destroys the existing module and all of its data (clear-database) prompts for confirmation ('Are you sure you want to proceed? [deleting X]'). Answering anything other than yes aborts the publish with no changes made (publish.rs:338).

Source

Thrown at crates/cli/src/subcommands/publish.rs:338

        )
        .arg(common_args::dotnet_version())
        .after_help("Run `spacetime help publish` for more detailed information.")
}

fn confirm_and_clear(
    name_or_identity: &str,
    skip_prompt: bool,
    mut builder: reqwest::RequestBuilder,
) -> Result<reqwest::RequestBuilder, anyhow::Error> {
    println!(
        "This will DESTROY the current {} module, and ALL corresponding data.",
        name_or_identity
    );
    if !y_or_n(
        skip_prompt,
        format!("Are you sure you want to proceed? [deleting {}]", name_or_identity).as_str(),
    )? {
        anyhow::bail!("Aborted.");
    }

    builder = builder.query(&[("clear", true)]);
    Ok(builder)
}

fn confirm_major_version_upgrade(skip_prompt: bool) -> Result<(), anyhow::Error> {
    println!(
        "It looks like you're trying to do a major version upgrade from 1.0 to 2.0. We recommend first looking at the upgrade notes before committing to this upgrade: https://spacetimedb.com/docs/upgrade"
    );
    println!();
    println!("WARNING: Once you publish you cannot revert back to version 1.0.");
    println!();

    if skip_prompt {
        return Ok(());
    }

View on GitHub (pinned to 524b4487d9)

Solutions

  1. If you truly intend to wipe the data, re-run and answer 'y'
  2. If you want to keep the data, drop --clear-database and republish normally
  3. In scripts, decide up front: pass --yes together with --clear-database for intentional destruction, or omit both

Example fix

// before
spacetime publish mydb --clear-database   # answered 'n' -> Aborted.
// after (decide before running)
spacetime publish mydb                          # keep data
spacetime publish mydb --clear-database --yes   # scripted, intends destruction
Defensive patterns

Strategy: validation

Validate before calling

# decide intent before invoking the CLI
if [[ "${CLEAR_DB:-0}" == 1 ]]; then
  spacetime publish mydb --clear-database --yes
else
  spacetime publish mydb
fi

Try / catch

if ! spacetime publish mydb --clear-database; then
  echo 'publish aborted (nothing was changed)' >&2
fi

Prevention

When it happens

Trigger: Running `spacetime publish <db> --clear-database` (or a config/script that requests clearing) over an existing database and answering 'n' at the prompt; without --yes in a non-interactive context the prompt fails closed the same way.

Common situations: Reflexively answering 'n' to a destructive-looking prompt; CI jobs hitting an interactive prompt they were never meant to see; unclear intent about whether data should be kept.

Related errors


AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16). Data as JSON: /api/errors/3c02d50c23097eda. Report an issue: GitHub.