{"record":{"id":"c4425a7ccab0a6af","repo":"clockworklabs/SpacetimeDB","slug":"nickname-conflicts-with-saved-configuration-for","errorCode":null,"errorMessage":"Nickname {} conflicts with saved configuration for server {}: {}://{}","messagePattern":"Nickname (.+?) conflicts with saved configuration for server (.+?): (.+?)://(.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/config.rs","lineNumber":379,"sourceCode":"    ///\n    /// Implements `spacetime server edit`.\n    ///\n    /// Returns `Err` if no such server exists.\n    /// On success, returns `(old_nickname, old_host, hold_protocol)`,\n    /// with `Some` for each field that was changed.\n    pub fn edit_server(\n        &mut self,\n        server: &str,\n        new_nickname: Option<&str>,\n        new_host: Option<&str>,\n        new_protocol: Option<&str>,\n    ) -> anyhow::Result<(Option<String>, Option<String>, Option<String>)> {\n        // Check if the new nickname or host name would introduce ambiguities between\n        // server configurations.\n        if let Some(new_nick) = new_nickname\n            && let Ok(other_server) = self.find_server(new_nick)\n        {\n            anyhow::bail!(\n                \"Nickname {} conflicts with saved configuration for server {}: {}://{}\",\n                new_nick,\n                other_server.nick_or_host(),\n                other_server.protocol,\n                other_server.host\n            );\n        }\n        if let Some(new_host) = new_host\n            && let Ok(other_server) = self.find_server(new_host)\n        {\n            anyhow::bail!(\n                \"Host {} conflicts with saved configuration for server {}: {}://{}\",\n                new_host,\n                other_server.nick_or_host(),\n                other_server.protocol,\n                other_server.host\n            );\n        }","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/cli/src/config.rs#L361-L397","documentation":"`spacetime server edit <server> --nickname <new>` rejects the rename because the requested nickname already resolves to a different saved server. Nicknames and hosts share one lookup namespace (`find_server`), so a nickname equal to another entry's host is also a conflict.","triggerScenarios":"Calling edit_server with a new_nickname that find_server resolves to another server entry — either that server's nickname or its host.","commonSituations":"Renaming a server to a name already in use; trying to set a nickname that duplicates another server's host string.","solutions":["Choose a nickname that is not used as any server's nickname or host","Rename or remove the conflicting server first"],"exampleFix":"# before\nspacetime server edit maincloud --nickname local\n# error: Nickname local conflicts with saved configuration for server ...\n\n# after\nspacetime server edit maincloud --nickname cloud-prod","handlingStrategy":"validation","validationCode":"// ensure the candidate nickname does not resolve to another server\nif let Ok(other) = config.find_server(new_nick) {\n    if other.host != target.host {\n        anyhow::bail!(\"nickname already in use by {}\", other.nick_or_host());\n    }\n}","typeGuard":null,"tryCatchPattern":"Catch the 'Nickname ... conflicts with saved configuration' bail and prompt the operator for a different nickname instead of aborting.","preventionTips":["Run `spacetime server list` before renaming to see taken names","Keep nicknames clearly distinct from host strings since they share a namespace"],"tags":["cli","config","server","nickname","conflict"],"backgroundTag":"duplicate-config-entry","analyzedSha":"6dee26c6efc2856793e12b148a59742964f5d783","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}