{"record":{"id":"5e5ed813a2ea6f6a","repo":"clockworklabs/SpacetimeDB","slug":"aborting-because-major-version-upgrade-was-not-acc","errorCode":null,"errorMessage":"Aborting because major version upgrade was not accepted.","messagePattern":"Aborting because major version upgrade was not accepted\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"info","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":367,"sourceCode":"    println!();\n    println!(\"WARNING: Once you publish you cannot revert back to version 1.0.\");\n    println!();\n\n    if skip_prompt {\n        return Ok(());\n    }\n\n    let mut input = String::new();\n    print!(\"Please type 'upgrade' to accept this change: \");\n    let mut stdout = std::io::stdout();\n    std::io::Write::flush(&mut stdout)?;\n    std::io::stdin().read_line(&mut input)?;\n\n    if input.trim() == \"upgrade\" {\n        return Ok(());\n    }\n\n    anyhow::bail!(\"Aborting because major version upgrade was not accepted.\");\n}\n\npub async fn exec(config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> {\n    exec_with_options(config, args, false, None).await\n}\n\n/// This function can be used when calling publish programatically rather than straight from the\n/// CLI, like we do in `spacetime dev`. When calling from `spacetime dev` we don't want to display\n/// information about using the `spacetime.json` file as it's already announced as part of the\n/// `dev` command\npub async fn exec_with_options(\n    mut config: Config,\n    args: &ArgMatches,\n    quiet_config: bool,\n    pre_loaded_config: Option<&LoadedConfig>,\n) -> Result<(), anyhow::Error> {\n    // Build schema\n    let cmd = cli();","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/publish.rs#L349-L385","documentation":"Publishing a 2.x module over a 1.x database is a one-way major version upgrade. The CLI requires typing exactly 'upgrade' at the prompt (after pointing at the upgrade notes); any other input — 'yes', 'y', or empty — aborts the publish before anything changes (publish.rs:367).","triggerScenarios":"During `spacetime publish` over an existing v1 database with a v2 module, typing anything other than exactly `upgrade` at the 'Please type upgrade' prompt.","commonSituations":"Assuming y/n semantics; aborting intentionally after reading the irreversibility warning; CI pipelines stumbling into an interactive prompt; not having read the upgrade notes yet.","solutions":["Re-run the publish and type exactly: upgrade","First read the linked upgrade notes (https://spacetimedb.com/docs/upgrade) — the upgrade cannot be reverted to 1.0","If the upgrade was not intended, keep the module on 1.x or publish to a fresh database name","For automation, pre-plan the interactive step or schedule the upgrade deliberately"],"exampleFix":"// before (aborted)\nPlease type 'upgrade' to accept this change: yes\n// after\nPlease type 'upgrade' to accept this change: upgrade","handlingStrategy":"validation","validationCode":"# automation must expect the literal word, not y/n\nprintf 'upgrade\\n' | spacetime publish mydb   # only when the upgrade is intended","typeGuard":null,"tryCatchPattern":"if ! spacetime publish mydb; then\n  echo 'publish not confirmed; database untouched (still v1)' >&2\nfi","preventionTips":["Read the upgrade notes URL before typing upgrade","Treat 1.x-to-2.x publishes as planned maintenance, not routine deploys","Type exactly 'upgrade' — 'yes' and 'y' abort"],"tags":["publish","major-version","upgrade","confirmation"],"backgroundTag":"user-confirmation-declined","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}