{"record":{"id":"23d6735f2b638fd5","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":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/publish.rs","lineNumber":671,"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":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/publish.rs#L653-L689","documentation":"The publish was denied with `PublishResult::PermissionDenied { name }`, but unlike the anonymous case the CLI does hold a token. It decodes the JWT locally (`decode_identity`, no signature verification), takes the first 12 characters of the identity as a suggested top-level domain, and returns this error: the database `name` exists on the server but is registered to a different identity than the one you are logged in as.","triggerScenarios":"Logged-in publish to a database name owned by another identity/account, or to a name you previously created under a different login; also when the stored token belongs to an old identity after re-logging in as a new user.","commonSituations":"Team shares a database name and a second developer tries `spacetime publish shared-name`; switching accounts via `spacetime login` and pushing to names created by the previous account; name collisions with other users on maincloud.","solutions":["Publish to your own suggested domain exactly as printed (e.g. `spacetime publish <suggested_tld>`)","Run `spacetime login` as the account that originally created the database, then retry","Check `spacetime list` to see which databases your current identity actually owns","Ask the owner to share/publish the module, or pick a unique name to avoid the collision"],"exampleFix":"# before\nspacetime publish someoneelses-db -s maincloud\n# after\nspacetime publish 1a2b3c4d5e6f7g -s maincloud   # identity-derived name from the error message","handlingStrategy":"try-catch","validationCode":"# Confirm ownership before publishing to an existing name\nspacetime list | grep -q \"^mydb\" || echo 'mydb not owned by current identity — expect PermissionDenied'","typeGuard":null,"tryCatchPattern":"// In automation: parse the suggested domain out of the failure and retry once\nlet out = run_cli(\"spacetime publish mydb\");\nif let Some(sugg) = parse_after(out, \"spacetime publish \") {\n    run_cli(&format!(\"spacetime publish {}\", sugg.trim()));\n}","preventionTips":["Use identity-derived or team-agreed unique database names from the start","Log in with the account that owns the database before publishing","Run `spacetime list` to see which names your identity owns before pushing to shared names"],"tags":["spacetimedb","publish","authorization","identity","permission-denied"],"backgroundTag":"resource-ownership-mismatch","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}