clockworklabs/SpacetimeDB · error
found is_anonymous={} in st_view, but {} in module when upda
Error message
found is_anonymous={} in st_view, but {} in module when updating view `{}` What it means
A consistency check while resolving a view for refresh: the is_anonymous flag stored in the st_views catalog row must equal the flag in the current module definition. A mismatch means the view's anonymous-ness changed between the catalog write and the loaded module — schema drift during an update or an in-flight refresh.
Source
Thrown at crates/core/src/host/module_host.rs:1192
let view_id = st_view.view_id;
let table_id = st_view
.table_id
.ok_or_else(|| anyhow::anyhow!("view {:?} does not have a backing table", view_id))?;
let (global_fn_ptr, view_def, owning_def) = module_def
.view_by_name_with_global_fn_ptr(&st_view.view_name.clone().into())
.ok_or_else(|| {
anyhow::anyhow!(
"view `{}` for view id `{}` not found in current module",
st_view.view_name,
view_id
)
})?;
let is_anonymous = view_def.is_anonymous;
if st_view.is_anonymous != is_anonymous {
return Err(anyhow::anyhow!(
"found is_anonymous={} in st_view, but {} in module when updating view `{}`",
st_view.is_anonymous,
is_anonymous,
st_view.view_name,
));
}
Ok(ResolvedViewForRefresh {
view_id,
table_id,
view_def,
view_name: st_view.view_name.into(),
global_fn_ptr,
owning_def,
})
}
pub struct CallProcedureParams {View on GitHub (pinned to 524b4487d9)
Solutions
- Re-publish the module so catalog flags are rewritten to match the current definitions.
- If persistent, recreate the database to reset view catalog state.
- Do not change a view's anonymous flag while refreshes for it are in flight; publish when the database is idle.
- Report the two module versions involved if it recurs.
Defensive patterns
Strategy: try-catch
Try / catch
try {
await refreshViews(db);
} catch (e) {
if (String(e).includes('is_anonymous=')) {
await spacetimePublish(dbName, modulePath); // rewrite catalog flags to match module
return refreshViews(db);
}
throw e;
} Prevention
- Do not flip a view between anonymous and named while refreshes are in flight.
- Publish when the database is idle.
- Keep a single declaration style per view across publishes; change flags deliberately and republish.
When it happens
Trigger: A module update flips a view between anonymous and named while refresh state from the old schema is applied; interrupted publishes leaving half-updated catalog flags; two module versions disagreeing on the view's declaration.
Common situations: Editing view declarations (anonymous vs named) between publishes; racing a subscription or view refresh against publish; rolling back to an older module version after a schema change.
Related errors
- view `{}` for view id `{}` not found in current module
- view {:?} does not have a backing table
- cannot serialize refs without a typespace
- cannot deserialize refs without a typespace
- could not serialize result: object had neither a `ok` nor an
AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16).
Data as JSON: /api/errors/04ca8c80d9194545.
Report an issue: GitHub.