{"record":{"id":"3c02d50c23097eda","repo":"clockworklabs/SpacetimeDB","slug":"aborted-3c02d5","errorCode":null,"errorMessage":"Aborted.","messagePattern":"Aborted\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":433,"sourceCode":"        // Preserve older servers for ordinary modules without environment changes.\n        Ok((\"application/octet-stream\", bytes))\n    }\n}\n\nfn confirm_and_clear(\n    name_or_identity: &str,\n    skip_prompt: bool,\n    mut builder: reqwest::RequestBuilder,\n) -> Result<reqwest::RequestBuilder, anyhow::Error> {\n    println!(\n        \"This will DESTROY the current {} module, and ALL corresponding data.\",\n        name_or_identity\n    );\n    if !y_or_n(\n        skip_prompt,\n        format!(\"Are you sure you want to proceed? [deleting {}]\", name_or_identity).as_str(),\n    )? {\n        anyhow::bail!(\"Aborted.\");\n    }\n\n    builder = builder.query(&[(\"clear\", true)]);\n    Ok(builder)\n}\n\nfn confirm_major_version_upgrade(skip_prompt: bool) -> Result<(), anyhow::Error> {\n    println!(\n        \"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\"\n    );\n    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","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/eddf9f5014579a50d4b67630e28b6e15cad9c4af/crates/cli/src/subcommands/publish.rs#L415-L451","documentation":"Publishing with --clear-database (or a schema change that requires clearing) first shows a destructive-action prompt: 'This will DESTROY the current <db> module, and ALL corresponding data.' Answering anything other than yes (without -y/--yes) raises this bail and no publish happens. The database is untouched.","triggerScenarios":"Running `spacetime publish --clear-database` and answering 'n' at the prompt; a CI job wired to a TTY where someone declines; interactive publish where the schema update requires clear and the user aborts.","commonSituations":"Shared dev databases where wiping data is costly; cautious manual publishing; accidentally passing --clear-database.","solutions":["If you truly want to wipe, rerun and answer y, or pass -y/--yes in automation","If not, drop --clear-database and fix schema changes to be backwards-compatible instead","Use `spacetime generate` + migration workflow to avoid needing clears"],"exampleFix":"# before\nspacetime publish mydb --clear-database   # answered n -> Aborted.\n# after\nspacetime publish mydb                     # no clear, no prompt","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = publish_exec().await {\n    if e.to_string() == \"Aborted.\" {\n        // user declined destructive clear: exit 0 or prompt differently\n    }\n}","preventionTips":["Only pass --clear-database when data loss is intended; pair it with -y in automation","Design schema changes to be backwards-compatible to avoid the clear prompt entirely"],"tags":["spacetime-publish","confirmation","data-loss","cli"],"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"}