clockworklabs/SpacetimeDB · error · anyhow::Error
Response data is missing.
Error message
Response data is missing.
What it means
The login session response had success=true but no data object. The protocol requires data to be present on success (it carries approved/sessionToken), so the CLI treats its absence as a schema violation and fails the login (login.rs:191).
Source
Thrown at crates/cli/src/subcommands/login.rs:191
#[serde(rename = "sessionToken")]
session_token: Option<String>,
}
#[derive(Clone, Deserialize)]
struct WebLoginSessionResponseApproved {
session_token: String,
}
impl WebLoginSessionResponse {
fn approved(self) -> anyhow::Result<Option<WebLoginSessionResponseApproved>> {
if !self.success {
return Err(anyhow::anyhow!(self
.error
.clone()
.unwrap_or("Unknown error".to_string())));
}
let data = self.data.ok_or(anyhow::anyhow!("Response data is missing."))?;
if !data.approved {
// Approved is false, no session token expected
return Ok(None);
}
let session_token = data
.session_token
.ok_or(anyhow::anyhow!("Session token is missing in response.".to_string()))?;
Ok(Some(WebLoginSessionResponseApproved {
session_token: session_token.clone(),
}))
}
}
async fn web_login(remote: &Url, open_browser: bool) -> Result<String, anyhow::Error> {
let client = reqwest::Client::new();
let response: WebLoginTokenResponse = clientView on GitHub (pinned to 524b4487d9)
Solutions
- Retry the login flow once
- Update the CLI and server to matching versions
- Probe the endpoint with curl to confirm responses include the data object
- If the mismatch persists, capture the response body and report it to SpacetimeDB
Defensive patterns
Strategy: try-catch
Try / catch
let out = Command::new("spacetime").args(["login"]).output()?;
let stderr = String::from_utf8_lossy(&out.stderr);
if !out.status.success() && stderr.contains("data is missing") {
// schema mismatch: version skew between CLI and server — update and retry
} Prevention
- Upgrade CLI and server together
- Probe auth endpoints with curl when self-hosting
- Report persistent schema mismatches with the response body
When it happens
Trigger: `spacetime login` session polling receiving {"success": true} with the data field missing or null.
Common situations: CLI/server version skew after upgrading one side; an API gateway stripping response fields; a custom or incompatible auth front-end in front of the node.
Related errors
- Session token is missing in response.
- Unknown error
- Failed to get token: {}
- Failed to request token
- unknown reducerId ${reducerId}
AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16).
Data as JSON: /api/errors/4b6040da691fb204.
Report an issue: GitHub.