openai/codex · error · io::Error
io::ErrorKind::NotFound
io::ErrorKind::NotFound
Error message
remote control cannot be enabled because sqlite state db is unavailable
What it means
Precondition failure in resolve_persisted_preference: remote control was requested to be enabled, but no sqlite state database is available to persist the enrollment/preference. Without the state db the enabled state cannot be remembered across restarts, so enabling is refused rather than silently running unpersisted.
Solutions
- Start the app server with the sqlite state db enabled/configured (check CODEX_HOME state path and disk availability).
- If the state db is intentionally disabled, do not expose remote-control enable to the client and return a structured error explaining the constraint.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at codex-rs/app-server-transport/src/transport/remote_control/desired_state.rs:73 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/a45d62e5c0eab320.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/app-server-transport/src/transport/remote_control/desired_state.rs:73
if self.ensure_remote_control_allowed().is_err() {
return Ok(false);
}
let _transition = self
.desired_state_rpc_lock
.acquire()
.await
.unwrap_or_else(|_| unreachable!());
if !matches!(
*self.desired_state_tx.borrow(),
RemoteControlDesiredState::Unknown
) {
return Ok(self.desired_state_tx.borrow().is_enabled());
}
let state_db = self
.state_db
.as_deref()
.ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, RemoteControlUnavailable))?;
let auth = super::auth::load_remote_control_auth(&self.auth_manager).await?;
let remote_control_target = normalize_remote_control_url(&self.remote_control_url)?;
let app_server_client_name = self.pairing_persistence_key(app_server_client_name)?;
let enrollment = state_db
.get_remote_control_enrollment(
&remote_control_target.websocket_url,
&auth.account_id,
app_server_client_name.as_deref(),
)
.await
.map_err(io::Error::other)?;
let desired_state = desired_state_from_persisted_enrollment(enrollment);
self.desired_state_tx.send_if_modified(|state| {
if !matches!(*state, RemoteControlDesiredState::Unknown) {
return false;
}
*state = desired_state;
trueView on GitHub (pinned to 339751715c)