{"record":{"id":"acf08a5a55b9da67","repo":"clockworklabs/SpacetimeDB","slug":"local-module-schema-inspection-timed-out","errorCode":null,"errorMessage":"Local module schema inspection timed out","messagePattern":"Local module schema inspection timed out","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/schema_extract.rs","lineNumber":156,"sourceCode":"            let mut child = command.spawn().context(\"Cannot start local module schema inspection\")?;\n            observation.started(child.id());\n            let mut output = Vec::new();\n            let mut stdout = child\n                .stdout\n                .take()\n                .context(\"Module inspection stdout unavailable\")?\n                .take(MAX_SCHEMA_BYTES + 1);\n            let result = tokio::select! {\n                biased;\n                _ = send.closed() => Err(anyhow::anyhow!(\"Module inspection cancelled\")),\n                result = tokio::time::timeout(deadline, async {\n                    stdout.read_to_end(&mut output).await.context(\"Cannot read local module schema\")?;\n                    ensure!(output.len() as u64 <= MAX_SCHEMA_BYTES, \"Local module schema exceeds output limit\");\n                    let status = child.wait().await.context(\"Cannot reap local module inspector\")?;\n                    observation.reaped(status);\n                    ensure!(status.success(), \"Local module schema inspection failed\");\n                    Ok(())\n                }) => result.unwrap_or_else(|_| Err(anyhow::anyhow!(\"Local module schema inspection timed out\"))),\n            };\n            if result.is_err() {\n                // Queue termination, then retain ownership through positive reaping.\n                let _ = child.start_kill();\n                let status = child\n                    .wait()\n                    .await\n                    .context(\"Cannot reap failed local module inspector\")?;\n                observation.reaped(status);\n            }\n            result?;\n            // Neither parser nor validation diagnostics may echo schema literals.\n            let SerdeWrapper::<RawModuleDef>(raw) = serde_json::from_slice(&output)\n                .map_err(|_| anyhow::anyhow!(\"Local module inspector returned invalid schema data\"))?;\n            let schema =\n                ModuleDef::try_from(raw).map_err(|_| anyhow::anyhow!(\"Local module schema validation failed\"))?;\n            Ok(schema)\n        }","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/eddf9f5014579a50d4b67630e28b6e15cad9c4af/crates/cli/src/schema_extract.rs#L138-L174","documentation":"inspect_observed wraps the child process's stdout read + wait in tokio::time::timeout(deadline, ...). When the deadline elapses before the inspector finishes, the arm maps the elapsed error to this anyhow error, then kills and reaps the child.","triggerScenarios":"The local module inspector process (extractor) does not write its schema and exit within INSPECT_TIMEOUT — e.g. a huge or pathological module, a hung extractor, or a very slow disk/CPU.","commonSituations":"Extracting schema from a large WASM module on a resource-starved CI runner; a stuck or buggy extractor binary; filesystem latency reading the module bytes.","solutions":["Retry; transient slowness may pass on a second attempt.","Free up CPU/disk resources or run on a faster machine to fit within the fixed timeout.","Reduce module size/complexity if it is unusually large.","Update SpacetimeDB — newer versions may adjust the inspector timeout."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// CLI: on timeout error, inform user the inspector exceeded its deadline and suggest retry on a faster host","preventionTips":["Run schema extraction on adequately provisioned machines","Keep modules lean to speed inspection","Update CLI for timeout tuning"],"tags":["timeout","subprocess","async","rust"],"backgroundTag":"request-timeout","analyzedSha":"eddf9f5014579a50d4b67630e28b6e15cad9c4af","analyzedAt":"2026-09-20T12:15:59.611Z","contentChangedAt":"2026-09-20T12:15:59.611Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}