{"record":{"id":"31bd72b5d362ce24","repo":"clockworklabs/SpacetimeDB","slug":"publishing-aborted-by-user","errorCode":null,"errorMessage":"Publishing aborted by user","messagePattern":"Publishing aborted by user","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"info","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":814,"sourceCode":"                }\n                println!(\"{}\", manual.reason);\n                println!(\"Proceeding with database clear due to --delete-data=on-conflict.\");\n\n                builder = confirm_and_clear(name_or_identity, yes.delete_data, builder)?;\n            }\n            PrePublishResult::AutoMigrate(auto) => {\n                println!(\"{}\", auto.migrate_plan);\n                // We only arrive here if you have not specified ClearMode::Always AND there was no\n                // conflict that required manual migration.\n                if auto.break_clients\n                    && !y_or_n(\n                        force_break_clients || yes.break_clients,\n                        \"The above changes will BREAK existing clients. Do you want to proceed?\",\n                    )?\n                {\n                    println!(\"Aborting\");\n                    // Early exit: return an error or a special signal. Here we bail out by returning Err.\n                    anyhow::bail!(\"Publishing aborted by user\");\n                }\n                builder = builder\n                    .query(&[(\"token\", auto.token)])\n                    .query(&[(\"policy\", \"BreakClients\")]);\n            }\n        }\n    }\n\n    Ok(builder)\n}\n\nasync fn call_pre_publish(\n    client: &reqwest::Client,\n    database_host: &str,\n    domain: &String,\n    host_type: &str,\n    program_bytes: &[u8],\n    auth_header: &AuthHeader,","sourceCodeStart":796,"sourceCodeEnd":832,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/publish.rs#L796-L832","documentation":"The pre-publish check returned an auto-migration plan, but the server flagged `break_clients: true` — the plan's schema changes will break existing subscribed clients. Unless a force flag is set, the CLI asks 'The above changes will BREAK existing clients. Do you want to proceed?'; a non-`y` answer bails here before the publish request with the `BreakClients` policy token is ever sent.","triggerScenarios":"Publishing additive-but-client-visible schema changes (renamed/removed columns or tables encoded in client bindings) while existing clients are live; answering 'n' or hitting EOF at the prompt in a non-interactive run.","commonSituations":"Altering a table definition while a game client built against the old schema is deployed; CI publishing without the break-clients/yes flag so stdin EOF aborts; consciously testing whether a change is breaking by reading the printed plan.","solutions":["Answer `y` at the prompt if breaking clients is acceptable right now","Pass the break-clients force flag (`force_break_clients`, e.g. `--break-clients`) or `--yes` so non-interactive runs proceed","If clients must keep working, revert the breaking schema change and republish a compatible version","Coordinate the publish with a client update so subscribers reconnect against the new schema"],"exampleFix":"# before\nspacetime publish mydb        # auto plan flags break_clients -> declined -> aborted\n# after\nspacetime publish mydb --break-clients --yes","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"// CI wrapper: detect the break-clients abort and either flag it or retry with the force flag\nlet out = run_cli(\"spacetime publish db\");\nif out.contains(\"Publishing aborted by user\") && out.contains(\"BREAK existing clients\") {\n    return Err(\"publish would break clients; coordinate a client release first\");\n}","preventionTips":["Decide break-clients policy per environment and encode it in the publish flag used by scripts","Run the publish against a staging database first to see the migration plan and break_clients verdict","Keep client bindings in lockstep with published schemas; publish compatible changes when subscribers are live"],"tags":["spacetimedb","publish","breaking-change","confirmation","migration"],"backgroundTag":"breaking-change-confirmation","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}