clockworklabs/SpacetimeDB · warning · anyhow::Error

Publishing aborted by user

Error message

Publishing aborted by user

What it means

The pre-publish check returned PrePublishResult::AutoMigrate with break_clients=true: the schema changes can be applied automatically, but they alter client-visible schema so existing generated clients and active subscriptions will break. The CLI asks 'The above changes will BREAK existing clients. Do you want to proceed?' and this error means the user declined, with neither --break-clients nor --yes=break-clients/--yes=all passed.

Solutions

  1. Re-run and answer 'y' if breaking clients is acceptable.
  2. Pass `--break-clients` (equivalent to --yes=break-clients) or `--yes=all` to skip the prompt.
  3. If clients must keep working, revert the schema change or stage it additively: add new tables/columns first, migrate clients, then remove old ones in a later publish.

Example fix

# before
spacetime publish mydb
# after
spacetime publish mydb --break-clients
Defensive patterns

Strategy: validation

Validate before calling

# When breaking changes are intended and clients will be regenerated:
spacetime publish mydb --break-clients
# or scope just this prompt: --yes=break-clients

Try / catch

On non-zero exit, if stderr contains "The above changes will BREAK existing clients" or "Publishing aborted by user", either regenerate client bindings and re-publish with --break-clients, or surface the breaking-change list for review

Prevention

When it happens

Trigger: `spacetime publish` producing breaking-but-auto-applicable changes (dropping a client-visible table, changing row types or reducer signatures), no --break-clients flag, no --yes=break-clients or --yes=all, and the user answering 'n' at the prompt.

Common situations: Removing or altering subscribed tables during development; automation that omits the yes flags; users surprised that an 'auto' migration still breaks clients; non-interactive contexts where the prompt cannot be answered.

Related errors


AI-assisted analysis of clockworklabs/SpacetimeDB@eddf9f5014 (2026-08-20). Data as JSON: /api/errors/31bd72b5d362ce24. Report an issue: GitHub.

Appendix: source

Thrown at crates/cli/src/subcommands/publish.rs:955

                }
                println!("{}", manual.reason);
                println!("Proceeding with database clear due to --delete-data=on-conflict.");

                builder = confirm_and_clear(name_or_identity, yes.delete_data, builder)?;
            }
            PrePublishResult::AutoMigrate(auto) => {
                println!("{}", auto.migrate_plan);
                // We only arrive here if you have not specified ClearMode::Always AND there was no
                // conflict that required manual migration.
                if auto.break_clients
                    && !y_or_n(
                        force_break_clients || yes.break_clients,
                        "The above changes will BREAK existing clients. Do you want to proceed?",
                    )?
                {
                    println!("Aborting");
                    // Early exit: return an error or a special signal. Here we bail out by returning Err.
                    anyhow::bail!("Publishing aborted by user");
                }
                builder = builder
                    .query(&[("token", auto.token)])
                    .query(&[("policy", "BreakClients")]);
            }
        }
    }

    Ok(builder)
}

async fn call_pre_publish(
    client: &reqwest::Client,
    database_host: &str,
    domain: &String,
    host_type: &str,
    program_bytes: &[u8],
    auth_header: &AuthHeader,

View on GitHub (pinned to eddf9f5014)