clockworklabs/SpacetimeDB · warning · anyhow::Error

Aborted.

Error message

Aborted.

What it means

A deliberate user abort: `spacetime dev` warns that the database(s) being published are also defined in the main `spacetime.json` (typically production databases), asks `Do you want to proceed with publishing in dev mode?`, and bails with `Aborted.` when the answer is no (or when `--force` was not passed and the prompt defaults were not accepted). It is a safety confirmation, not a malfunction.

Source

Thrown at crates/cli/src/subcommands/dev.rs:728

                database_sources
                    .get((*db).as_str())
                    .is_some_and(|src| src.as_deref() == Some("spacetime.json"))
            })
            .cloned()
            .collect();

        if !databases_from_main_config.is_empty() && !force {
            eprintln!(
                "{} Database(s) `{}` are defined in spacetime.json (usually reserved for production databases).",
                "Warning:".yellow().bold(),
                databases_from_main_config.join(", ")
            );
            let should_continue = Confirm::new()
                .with_prompt("Do you want to proceed with publishing in dev mode?")
                .default(true)
                .interact()?;
            if !should_continue {
                anyhow::bail!("Aborted.");
            }
        }
    }

    if let Some(ref cmd) = client_command {
        println!("Client command: {}", cmd.cyan());
    }
    println!("{}", "Press Ctrl+C to stop".dimmed());
    println!();
    let loaded_config_dir = loaded_config.as_ref().map(|lc| lc.config_dir.clone());

    generate_build_and_publish(
        &config,
        &project_dir,
        loaded_config_dir.as_deref(),
        &spacetimedb_dir,
        &module_bindings_dir,
        client_language,

View on GitHub (pinned to 524b4487d9)

Solutions

  1. Answer `y` at the prompt if overwriting those databases in dev mode is intended
  2. Better: use distinct dev database names in the dev publish targets so the warning never fires
  3. Pass `--force` to skip the confirmation in scripts that intentionally target those databases
  4. Split production and dev into separate config files/projects

Example fix

# before
spacetime dev  # same db names as prod config, answered 'n'
# after
spacetime dev --database mydb-dev
Defensive patterns

Strategy: validation

Validate before calling

# Separate dev db names from prod-configured ones
jq '.publish[].database' spacetime.json  # ensure none match main-config databases before dev

Try / catch

// If scripting the prompt non-interactively, either pass --force deliberately or expect the abort and exit 0 on 'Aborted.' when the operator declined.

Prevention

When it happens

Trigger: Running `spacetime dev` where dev publish targets reference databases also declared in the main config, and answering 'no' at the confirmation (or running non-interactively with the prompt resolving to no).

Common situations: Pointing a dev environment at the same database names as production config; running dev mode in CI where the interactive Confirm cannot be answered; sharing one spacetime.json between prod deploys and local dev.

Related errors


AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16). Data as JSON: /api/errors/9c0b7445241c7908. Report an issue: GitHub.