clockworklabs/SpacetimeDB · warning · anyhow::Error
Aborting because major version upgrade was not accepted.
Error message
Aborting because major version upgrade was not accepted.
What it means
Publishing a module built against SpacetimeDB 2.0 over a 1.0 database is a one-way major upgrade; the CLI demands the literal word 'upgrade' typed at the prompt. Any other input (empty line, 'yes', 'y', EOF) aborts the publish with this error and the database stays on 1.0.
Solutions
- Read the linked upgrade notes (https://spacetimedb.com/docs/upgrade), then type 'upgrade' exactly
- In automation, pre-accept by piping it: `echo upgrade | spacetime publish ...` or use the non-interactive skip flag for your flow
- If not ready, pin your module to the 1.0 SDK/ABI and publish that instead
Example fix
# before yes | spacetime publish mydb # still aborts: must be the word 'upgrade' # after echo upgrade | spacetime publish mydb
Defensive patterns
Strategy: validation
Try / catch
if let Err(e) = publish_exec().await {
if e.to_string().contains("major version upgrade was not accepted") {
// keep the module on the 1.0 SDK or re-run with 'upgrade' piped in
}
} Prevention
- Read the 1.0→2.0 upgrade notes before first publish after an SDK bump
- In CI, pipe `echo upgrade` or pre-plan the migration window; the prompt requires the exact word
- Snapshot/export database data before accepting a major upgrade
When it happens
Trigger: First publish after upgrading the SDK/CLI to 2.0 against an existing 1.0 database; typing 'yes' instead of 'upgrade'; CI pipes closing stdin so read_line returns EOF.
Common situations: SDK major-version bumps; automation hitting an interactive guard it cannot satisfy.
Related errors
- Aborted.
- Aborted.
- No database target matches
- No matching target found in spacetime.json for the provided…
- Publish aborted by user.
AI-assisted analysis of clockworklabs/SpacetimeDB@eddf9f5014 (2026-08-20).
Data as JSON: /api/errors/5e5ed813a2ea6f6a.
Report an issue: GitHub.
Appendix: source
Thrown at crates/cli/src/subcommands/publish.rs:462
println!();
println!("WARNING: Once you publish you cannot revert back to version 1.0.");
println!();
if skip_prompt {
return Ok(());
}
let mut input = String::new();
print!("Please type 'upgrade' to accept this change: ");
let mut stdout = std::io::stdout();
std::io::Write::flush(&mut stdout)?;
std::io::stdin().read_line(&mut input)?;
if input.trim() == "upgrade" {
return Ok(());
}
anyhow::bail!("Aborting because major version upgrade was not accepted.");
}
pub async fn exec(config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> {
exec_with_options(config, args, false, None).await
}
/// This function can be used when calling publish programatically rather than straight from the
/// CLI, like we do in `spacetime dev`. When calling from `spacetime dev` we don't want to display
/// information about using the `spacetime.json` file as it's already announced as part of the
/// `dev` command
pub async fn exec_with_options(
mut config: Config,
args: &ArgMatches,
quiet_config: bool,
pre_loaded_config: Option<&LoadedConfig>,
) -> Result<(), anyhow::Error> {
// Build schema
let cmd = cli();View on GitHub (pinned to eddf9f5014)