{"record":{"id":"3c02d50c23097eda","repo":"clockworklabs/SpacetimeDB","slug":"aborted-3c02d5","errorCode":null,"errorMessage":"Aborted.","messagePattern":"Aborted\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"info","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":338,"sourceCode":"        )\n        .arg(common_args::dotnet_version())\n        .after_help(\"Run `spacetime help publish` for more detailed information.\")\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":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/publish.rs#L320-L356","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["If you truly intend to wipe the data, re-run and answer 'y'","If you want to keep the data, drop --clear-database and republish normally","In scripts, decide up front: pass --yes together with --clear-database for intentional destruction, or omit both"],"exampleFix":"// before\nspacetime publish mydb --clear-database   # answered 'n' -> Aborted.\n// after (decide before running)\nspacetime publish mydb                          # keep data\nspacetime publish mydb --clear-database --yes   # scripted, intends destruction","handlingStrategy":"validation","validationCode":"# decide intent before invoking the CLI\nif [[ \"${CLEAR_DB:-0}\" == 1 ]]; then\n  spacetime publish mydb --clear-database --yes\nelse\n  spacetime publish mydb\nfi","typeGuard":null,"tryCatchPattern":"if ! spacetime publish mydb --clear-database; then\n  echo 'publish aborted (nothing was changed)' >&2\nfi","preventionTips":["Pass --yes only when a script deliberately destroys data","Never leave --clear-database in shared scripts without review","Read prompts fully; 'Aborted.' means no data was touched"],"tags":["publish","confirmation","data-loss","clear-database"],"backgroundTag":"user-confirmation-declined","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}