{"record":{"id":"a21d73d60555162a","repo":"clockworklabs/SpacetimeDB","slug":"no-such-saved-server-configuration-server-add-a","errorCode":null,"errorMessage":"No such saved server configuration: {server}\nAdd a new server configuration with:\n\tspacetime server add {server} --url <url>","messagePattern":"No such saved server configuration: (.+?)\nAdd a new server configuration with:\n\tspacetime server add (.+?) --url <url>","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/config.rs","lineNumber":148,"sourceCode":"\n#[derive(Debug, Clone)]\npub struct Config {\n    home: RawConfig,\n    home_path: CliTomlPath,\n    /// The TOML document that was parsed to create `home`.\n    ///\n    /// We need to keep it to preserve comments and formatting when saving the config.\n    doc: toml_edit::DocumentMut,\n}\n\nconst NO_DEFAULT_SERVER_ERROR_MESSAGE: &str = \"No default server configuration.\nSet an existing server as the default with:\n\\tspacetime server set-default <server>\nOr add a new server which will become the default:\n\\tspacetime server add {server} <url> --default\";\n\nfn no_such_server_error(server: &str) -> anyhow::Error {\n    anyhow::anyhow!(\n        \"No such saved server configuration: {server}\nAdd a new server configuration with:\n\\tspacetime server add {server} --url <url>\",\n    )\n}\n\nfn hanging_default_server_context(server: &str) -> String {\n    format!(\"Default server does not refer to a saved server configuration: {server}\")\n}\n\nimpl RawConfig {\n    fn new_with_localhost() -> Self {\n        let local = ServerConfig {\n            host: \"127.0.0.1:3000\".to_string(),\n            protocol: \"http\".to_string(),\n            nickname: Some(\"local\".to_string()),\n            ecdsa_public_key: None,\n        };","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/config.rs#L130-L166","documentation":"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).","triggerScenarios":"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).","commonSituations":"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.","solutions":["Add the server as the message instructs: spacetime server add <name> --url <url>","List saved servers with spacetime server list and reuse an existing nickname/host","Check the spelling of the --server / set-default argument against the list"],"exampleFix":"# before\nspacetime server set-default mainnet   # Error: No such saved server configuration: mainnet\n\n# after\nspacetime server add mainnet --url https://mainnet.spacetimedb.com\nspacetime server set-default mainnet","handlingStrategy":"validation","validationCode":"# Ensure the server exists before using it:\nspacetime server list | grep -q \"^${SERVER_NAME}\" \\\n  || spacetime server add \"${SERVER_NAME}\" --url \"${SERVER_URL}\"\nspacetime server set-default \"${SERVER_NAME}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bootstrap scripts should always run spacetime server add before any --server usage","Use consistent server names across docs, scripts, and CI","Run spacetime server list when troubleshooting name resolution"],"tags":["cli","configuration","server","spacetimedb"],"backgroundTag":"unknown-server-config","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}