{"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":"warning","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":462,"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":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/eddf9f5014579a50d4b67630e28b6e15cad9c4af/crates/cli/src/subcommands/publish.rs#L444-L480","documentation":"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.","triggerScenarios":"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.","commonSituations":"SDK major-version bumps; automation hitting an interactive guard it cannot satisfy.","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"],"exampleFix":"# before\nyes | spacetime publish mydb      # still aborts: must be the word 'upgrade'\n# after\necho upgrade | spacetime publish mydb","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = publish_exec().await {\n    if e.to_string().contains(\"major version upgrade was not accepted\") {\n        // keep the module on the 1.0 SDK or re-run with 'upgrade' piped in\n    }\n}","preventionTips":["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"],"tags":["spacetime-publish","confirmation","major-upgrade","cli","data-loss"],"backgroundTag":"confirmation-declined","analyzedSha":"eddf9f5014579a50d4b67630e28b6e15cad9c4af","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}