clockworklabs/SpacetimeDB · error
Database `{}` does not exist
Error message
Database `{}` does not exist What it means
StandaloneEnv::migrate_plan looks up the target database by identity in the control database before migrating. A None match means no database with that identity is registered in this standalone instance, so the publish/migrate request is rejected with the abbreviated identity in the message.
Source
Thrown at crates/standalone/src/lib.rs:395
spec: spacetimedb_client_api::DatabaseDef,
style: PrettyPrintStyle,
) -> anyhow::Result<MigratePlanResult> {
let existing_db = self.control_db.get_database_by_identity(&spec.database_identity)?;
match existing_db {
Some(db) => {
let host = self.leader(db.id).await?;
self.host_controller
.migrate_plan(
db,
spec.host_type,
host.replica_id,
spec.program_bytes.to_vec().into(),
style,
)
.await
}
None => anyhow::bail!(
"Database `{}` does not exist",
spec.database_identity.to_abbreviated_hex()
),
}
}
async fn delete_database(&self, _caller_identity: &Identity, database_identity: &Identity) -> anyhow::Result<()> {
let Some(database) = self.control_db.get_database_by_identity(database_identity)? else {
return Ok(());
};
self.control_db.delete_database(database.id)?;
for instance in self.control_db.get_replicas_by_database(database.id)? {
self.delete_replica(instance.id).await?;
}
Ok(())
}View on GitHub (pinned to fb7282411b)
Solutions
- Publish by name to (re)create the database: spacetime publish <db-name> on the correct server.
- Verify the database exists on the target server: spacetime list / spacetime describe <db>.
- Check the server URL and data directory match where the database was originally created.
Example fix
# before: publishing to a missing identity spacetime publish --skip-programs my-db # -> Database `<abbrev>` does not exist # after: target the right server / recreate by name spacetime server list spacetime server use local spacetime publish my-db
Defensive patterns
Strategy: validation
Validate before calling
# before publishing to an existing identity, verify it exists on that server: spacetime list spacetime describe my-db # missing -> publish by name to create it, or fix the server URL
Try / catch
match env.migrate_plan(spec).await {
Err(e) if e.to_string().contains("does not exist") => {
// create the database (publish by name), then retry the migrate
}
other => other,
} Prevention
- Pin the correct server with spacetime server use before publishing.
- After resetting a data directory, recreate databases by name rather than reusing old identities.
- Script publishes to verify the database exists first.
When it happens
Trigger: Publishing or migrating to a database identity that does not exist on the target standalone server: fresh data directory, wrong server URL, or the database was deleted.
Common situations: Local manifest still referencing an old database identity after the standalone data dir was reset; publishing to a different spacetimedb start instance than the one where the database was created; publishing after spacetetime delete.
Related errors
- Database not found: {}
- Missing type name for ${typeBuilder.constructor.name ?? 'Typ
- Cannot use module-specific arguments ({}) when {}. {}
- wasm-bindgen detected. It seems like either you or a crate
- getrandom usage detected. It seems like either you or a cra
AI-assisted analysis of clockworklabs/SpacetimeDB@fb7282411b (2026-08-20).
Data as JSON: /api/errors/b59ff425f86d6c4d.
Report an issue: GitHub.