{"record":{"id":"2e1649da77cd1c34","repo":"clockworklabs/SpacetimeDB","slug":"no-such-module","errorCode":null,"errorMessage":"no such module","messagePattern":"no such module","errorType":"exception","errorClass":"DBError","httpStatus":null,"severity":"error","filePath":"crates/core/src/host/module_host.rs","lineNumber":2104,"sourceCode":"    pub(in crate::host) fn record_view_command_round_trip(info: &ModuleInfo, metric: ViewCommandMetric) {\n        match metric.workload {\n            WorkloadType::Subscribe => info\n                .metrics\n                .request_round_trip_subscribe\n                .observe(metric.timer.elapsed().as_secs_f64()),\n            WorkloadType::Unsubscribe => info\n                .metrics\n                .request_round_trip_unsubscribe\n                .observe(metric.timer.elapsed().as_secs_f64()),\n            _ => {}\n        }\n    }\n\n    async fn call_sql_command(&self, cmd: SqlCommand) -> Result<SqlCommandResult, DBError> {\n        call_instance!(self, \"call_sql\", cmd, |cmd, inst| inst.call_sql(cmd), |cmd, inst| inst\n            .call_sql(cmd)\n            .await,)\n        .map_err(|_| DBError::Other(anyhow::anyhow!(\"no such module\")))\n    }\n\n    pub async fn disconnect_client(&self, client_id: ClientActorId) {\n        log::trace!(\"disconnecting client {client_id}\");\n        if let Err(e) = call_instance!(\n            self,\n            \"disconnect_client\",\n            client_id,\n            |client_id, inst| inst.disconnect_client(client_id),\n            |client_id, inst| inst.disconnect_client(client_id).await,\n        ) {\n            log::error!(\"Error from client_disconnected transaction: {e}\");\n        }\n    }\n\n    pub fn disconnect_client_inner(\n        client_id: ClientActorId,\n        info: &ModuleInfo,","sourceCodeStart":2086,"sourceCodeEnd":2122,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/eddf9f5014579a50d4b67630e28b6e15cad9c4af/crates/core/src/host/module_host.rs#L2086-L2122","documentation":"call_sql_command dispatches to the module host actor via call_instance!; when the instance cannot be reached (stopped, crashed, or never started), every failure is mapped via .map_err(|_| ...) to DBError::Other('no such module'). The mapping discards the original error, so the real cause (e.g. why the actor died) exists only in host logs.","triggerScenarios":"Issuing a SQL command while the module actor has crashed or is restarting; targeting a database whose module was never spawned; calling SQL during the publish/update teardown window.","commonSituations":"A module crash-looping after a bad publish; a race between database creation and the first SQL command; host shutdown draining in-flight commands.","solutions":["Check host logs for the module actor's actual failure - this message hides it.","Ensure the database is published and its module instance is running before issuing SQL.","Retry with backoff if the command raced a module restart.","Avoid running SQL concurrently with publish/update of the same database."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if !host_controller.module_running(db_addr).await {\n    return Err(anyhow::anyhow!(\"module for {db_addr} is not running; publish first\"));\n}","typeGuard":null,"tryCatchPattern":"Match on DBError::Other with message 'no such module' and treat it as 'module unavailable': surface a retryable health-check signal rather than a SQL error, and check host logs for the real cause.","preventionTips":["Gate SQL traffic on module readiness (publish ack) in tooling.","Monitor module actor restarts; crash-loops surface here as opaque 'no such module'.","Serialize SQL and publish/update operations per database."],"tags":["sql","module-host","actor","lifecycle","error-masking"],"backgroundTag":"module-not-found","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"}