clockworklabs/SpacetimeDB · critical · anyhow::Error
metadata.toml at indicates that this database is from a…
Error message
metadata.toml at {} indicates that this database is from a different edition of SpacetimeDB (running {:?}, but this database is {:?}) What it means
During database bootstrap, metadata.toml beside the database is compared with the running server's edition via check_compatibility; differing editions abort opening the database. The edition is a coarse compatibility marker between SpacetimeDB release lineages — on-disk state written by one lineage is refused by the other, which is what this error reports (running edition vs database edition).
Solutions
- Run the server version whose edition matches the database (both editions are printed in the error; check metadata.toml to confirm)
- If the data is disposable, delete the database (`spacetime delete <db>` or remove its directory) and re-publish fresh
- If upgrading was intended, follow the documented upgrade path — upgrade the binary first and never downgrade below the edition that wrote the state
Defensive patterns
Strategy: validation
Validate before calling
# bash: compare the database's edition against the running binary before start EDITION=$(grep -E '^edition' /path/to/db/metadata.toml) echo "db: $EDITION ; binary: $(spacetime version)" # abort if lineages differ
Prevention
- Never downgrade a server below the edition that wrote the databases it hosts
- Record the creating version in runbooks when restoring backups, and match binaries to it
- Treat disposable dev databases as re-publishable rather than portable across editions
When it happens
Trigger: Starting or using a database whose data directory was created by a different SpacetimeDB edition: downgrading the server binary, restoring an old backup into a newer install, or pointing the server at state from another edition.
Common situations: Downgrading after trying a new release; copying data directories between environments on different versions; long-lived databases carried across breaking releases; restoring snapshots.
Related errors
- : log format version mismatch: current= segment=
- Aborted
- allocation size overflow
- Error fetching public key for issuer
- error reading commit header
AI-assisted analysis of clockworklabs/SpacetimeDB@fb7282411b (2026-08-20).
Data as JSON: /api/errors/01cf571d4fe800af.
Report an issue: GitHub.
Appendix: source
Thrown at crates/core/src/config.rs:66
current_version.patch = 0;
}
Self {
version: current_version,
edition: edition.to_owned(),
client_connection_id: None,
}
}
pub fn read(path: &MetadataTomlPath) -> anyhow::Result<Option<Self>> {
parse_config(path.as_ref())
}
pub fn write(&self, path: &MetadataTomlPath) -> io::Result<()> {
path.write(self.to_string())
}
fn check_compatibility(previous: &Self, current: &Self, metafile: &Path) -> anyhow::Result<()> {
anyhow::ensure!(
previous.edition == current.edition,
"metadata.toml at {} indicates that this database is from a different \
edition of SpacetimeDB (running {:?}, but this database is {:?})",
metafile.display(),
current.edition,
previous.edition,
);
// This is mostly redundant with the caret comparison below, but
// pre-releases make it annoying.
if previous.version == current.version {
return Ok(());
}
// Special-case: SpacetimeDB 2.x can run 1.x databases.
if previous.version.major == 1 && current.version.major == 2 {
return Ok(());
}View on GitHub (pinned to fb7282411b)