BigPizzaV3/CodexPlusPlus · critical · anyhow::Error
启动静默入口失败: ;回滚 live 配置也失败:
Error message
启动静默入口失败:{error};回滚 live 配置也失败:{restore_error} What it means
Thrown when the spawned launch process (the silent launcher entry) fails via spawn(request), and restoring the previously captured RelayLiveSnapshot of the live config also fails during cleanup. The message carries both the original launch error and the restore error, indicating the live config may be left in the pre-launch (but not guaranteed-original) state.
Solutions
- Read the embedded {error} — fix the underlying launch failure first (e.g. ensure the launcher binary exists and is executable).
- Manually verify/restore config.toml since automatic restore failed; check for locks on the file.
- Check filesystem permissions and disk space in the Codex home directory.
- Retry the launch after closing other Codex/manager processes that may hold config.toml.
Example fix
// before: spawn fails and rollback fails, config possibly inconsistent
// after: pre-check launcher availability before sync
if !launcher_binary_exists() {
return Err(anyhow::anyhow!("launcher binary missing; skipping live sync"));
}
let snapshot = RelayLiveSnapshot::capture(home)?; Defensive patterns
Strategy: try-catch
Validate before calling
// pre-check before sync+spawn
if !PathBuf::from(launcher_path).exists() {
return Err(anyhow::anyhow!("launcher binary missing"));
}
let snapshot = RelayLiveSnapshot::capture(home)?; Type guard
fn snapshot_restorable(snapshot: &Option<RelayLiveSnapshot>, home: &Path) -> bool {
snapshot.as_ref().map(|s| s.can_restore(home)).unwrap_or(true)
} Try / catch
if let Err(error) = spawn(request) {
if let Err(restore_error) = snapshot.map(|s| s.restore(home)) {
eprintln!("launch failed: {error}; restore also failed: {restore_error:?} — repair config.toml manually");
}
return Err(error);
} Prevention
- Verify the launcher binary exists and is executable before spawning.
- Close other Codex/manager instances that may lock config.toml.
- Keep a periodic backup of config.toml to recover from failed rollbacks.
- Test spawn in a dry-run mode before syncing live config.
When it happens
Trigger: Calling a launch command (commands.rs) after a successful sync_active_relay_to_home, where spawn(request) returns Err (launcher binary missing, port conflict, exec failure) and snapshot.restore(home) then errors (config.toml write failure, permissions, IO).
Common situations: Launcher executable not found or not built; antivirus/permissions blocking process spawn; config.toml locked by another process so restore cannot write back.
Understand the failure class
Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.
Related errors
- 同步当前供应商失败: ;回滚 live 配置也失败:
- 无法启动 Codex app-server(
- 当前聚合供应商配置不完整
- 供应商配置总开关已关闭,未同步 live 配置
- Cannot run remote git over SSH
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/041d2f710a607e1e.
Report an issue: GitHub.
Appendix: source
Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:957
F: FnOnce(&LaunchRequest) -> anyhow::Result<()>,
{
let snapshot = if let Some(settings) = settings {
let snapshot = RelayLiveSnapshot::capture(home)?;
if let Err(error) = sync_active_relay_to_home(settings, home) {
if let Err(restore_error) = snapshot.restore(home) {
anyhow::bail!("同步当前供应商失败:{error};回滚 live 配置也失败:{restore_error}");
}
return Err(error);
}
Some(snapshot)
} else {
None
};
if let Err(error) = spawn(request) {
if let Some(snapshot) = snapshot {
if let Err(restore_error) = snapshot.restore(home) {
anyhow::bail!("启动静默入口失败:{error};回滚 live 配置也失败:{restore_error}");
}
}
return Err(error);
}
Ok(())
}
#[derive(Debug)]
struct RelayLiveSnapshot {
config: Option<Vec<u8>>,
auth: Option<Vec<u8>>,
}
impl RelayLiveSnapshot {
fn capture(home: &Path) -> anyhow::Result<Self> {
Ok(Self {
config: read_optional_file_bytes(&home.join("config.toml"))?,
auth: read_optional_file_bytes(&home.join("auth.json"))?,View on GitHub (pinned to b1ed92e5e4)