clockworklabs/SpacetimeDB · error

No such saved server configuration: {server} Add a new serve

Error message

No such saved server configuration: {server}
Add a new server configuration with:
	spacetime server add {server} --url <url>

What it means

When a CLI command resolves a server by name, RawConfig::find_server matches saved configs by nickname or host; no match produces this error, which embeds the exact spacetime server add command to fix the situation (crates/cli/src/config.rs:148).

Source

Thrown at crates/cli/src/config.rs:148

#[derive(Debug, Clone)]
pub struct Config {
    home: RawConfig,
    home_path: CliTomlPath,
    /// The TOML document that was parsed to create `home`.
    ///
    /// We need to keep it to preserve comments and formatting when saving the config.
    doc: toml_edit::DocumentMut,
}

const NO_DEFAULT_SERVER_ERROR_MESSAGE: &str = "No default server configuration.
Set an existing server as the default with:
\tspacetime server set-default <server>
Or add a new server which will become the default:
\tspacetime server add {server} <url> --default";

fn no_such_server_error(server: &str) -> anyhow::Error {
    anyhow::anyhow!(
        "No such saved server configuration: {server}
Add a new server configuration with:
\tspacetime server add {server} --url <url>",
    )
}

fn hanging_default_server_context(server: &str) -> String {
    format!("Default server does not refer to a saved server configuration: {server}")
}

impl RawConfig {
    fn new_with_localhost() -> Self {
        let local = ServerConfig {
            host: "127.0.0.1:3000".to_string(),
            protocol: "http".to_string(),
            nickname: Some("local".to_string()),
            ecdsa_public_key: None,
        };

View on GitHub (pinned to 524b4487d9)

Solutions

  1. Add the server as the message instructs: spacetime server add <name> --url <url>
  2. List saved servers with spacetime server list and reuse an existing nickname/host
  3. Check the spelling of the --server / set-default argument against the list

Example fix

# before
spacetime server set-default mainnet   # Error: No such saved server configuration: mainnet

# after
spacetime server add mainnet --url https://mainnet.spacetimedb.com
spacetime server set-default mainnet
Defensive patterns

Strategy: validation

Validate before calling

# Ensure the server exists before using it:
spacetime server list | grep -q "^${SERVER_NAME}" \
  || spacetime server add "${SERVER_NAME}" --url "${SERVER_URL}"
spacetime server set-default "${SERVER_NAME}"

Prevention

When it happens

Trigger: Running spacetime server set-default mainnet, spacetime publish --server myhost, or any --server-referencing command where the name was never added via spacetime server add (fresh install, typo, or config file at ~/.config/.spacetime reset).

Common situations: Following docs/tutorials that reference a named server without the prerequisite add step; typos in server names; new machine or CI container without the saved config.

Related errors


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