{"record":{"id":"0ec0a8085f5f8d5e","repo":"clockworklabs/SpacetimeDB","slug":"the-database-name-is-not-registered-to-the-ident","errorCode":null,"errorMessage":"The database {name} is not registered to the identity you provided.\\nWe suggest you push to either a domain owned by you, or a new domain like:\\n\\tspacetime publish {suggested_tld}\\n","messagePattern":"The database (.+?) is not registered to the identity you provided\\.\\\\nWe suggest you push to either a domain owned by you, or a new domain like:\\\\n\\\\tspacetime publish (.+?)\\\\n","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":812,"sourceCode":"                }\n\n                if is_maincloud_host(&database_host)\n                    && let Some(domain) = domain.as_ref()\n                {\n                    println!(\"Dashboard: https://spacetimedb.com/{}\", domain.as_ref());\n                }\n            }\n            PublishResult::PermissionDenied { name } => {\n                if anon_identity {\n                    anyhow::bail!(\"You need to be logged in as the owner of {name} to publish to {name}\",);\n                }\n                // If we're not in the `anon_identity` case, then we have already forced the user to log in above (using `get_auth_header`), so this should be safe to unwrap.\n                let token = config.spacetimedb_token().unwrap();\n                let identity = decode_identity(token)?;\n                //TODO(jdetter): Have a nice name generator here, instead of using some abstract characters\n                // we should perhaps generate fun names like 'green-fire-dragon' instead\n                let suggested_tld: String = identity.chars().take(12).collect();\n                return Err(anyhow::anyhow!(\n                    \"The database {name} is not registered to the identity you provided.\\n\\\n                    We suggest you push to either a domain owned by you, or a new domain like:\\n\\\n                    \\tspacetime publish {suggested_tld}\\n\",\n                ));\n            }\n        }\n    }\n\n    Ok(())\n}\n\nfn default_publish_module_path(current_dir: &std::path::Path) -> PathBuf {\n    let spacetimedb_dir = current_dir.join(\"spacetimedb\");\n    if spacetimedb_dir.is_dir() {\n        spacetimedb_dir\n    } else {\n        current_dir.to_path_buf()\n    }","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/eddf9f5014579a50d4b67630e28b6e15cad9c4af/crates/cli/src/subcommands/publish.rs#L794-L830","documentation":"Thrown by `spacetime publish` when the server responds with PublishResult::PermissionDenied: the target database name exists but is registered to a different identity than the one in your login token. The CLI decodes your JWT without signature verification, takes the first 12 characters of your identity, and suggests pushing to a fresh domain named after them.","triggerScenarios":"`spacetime publish <name>` where <name> was created/registered by another identity; publishing while logged in as a different user than the database owner; targeting a name already taken on the selected server. (An anonymous session hits the separate 'log in as the owner' bail instead.)","commonSituations":"A teammate originally published the database under their account; name collisions on shared servers (testnet/mainnet); still logged in with an old token after switching accounts or servers; CI publishing with a token from the wrong user.","solutions":["Publish to a fresh, unused name — e.g. the suggested `spacetime publish <first-12-chars-of-your-identity>` from the error message","Run `spacetime whoami` to confirm which identity you are, then `spacetime login` as the actual owner of the database","Ask the current owner to publish the update, or have them delete/re-register the database under your identity","Verify you are targeting the intended server with `spacetime server list` — the name may be free on a different server"],"exampleFix":"# before\nspacetime publish quickstart-db   # name registered to another identity\n\n# after\nspacetime publish ab12cd34ef56     # or any unused name; identity prefix shown in the error","handlingStrategy":"validation","validationCode":"# before publishing (CI), confirm the identity and prefer names derived from it\nspacetime whoami\nNAME=\"$(spacetime whoami | tail -c 13)\"   # first 12 chars heuristic; or pin a known-owned name\nspacetime publish \"$NAME\"","typeGuard":null,"tryCatchPattern":"// Rust (internal API users): match the typed result before it becomes an error\nmatch publish_result {\n    PublishResult::PermissionDenied { name } => { /* prompt for a new domain or re-login */ }\n    other => { /* proceed */ }\n}","preventionTips":["Derive publish names from your own identity or a namespace you own instead of generic names that collide","Run `spacetime whoami` in CI before publish to fail fast on the wrong account","Document which teammate/account owns each database name to avoid accidental takeovers"],"tags":["publish","authorization","identity","cli"],"backgroundTag":"permission-denied","analyzedSha":"eddf9f5014579a50d4b67630e28b6e15cad9c4af","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}