tonhowtf/omniget · error · anyhow::Error

spicetify nao respondeu em 4 minutos

Error message

spicetify {} nao respondeu em 4 minutos

What it means

spicetify's run() wraps the child process in tokio::time::timeout with 240 seconds. If `spicetify <args>` has not finished within 4 minutes, the timeout fires and this error is produced, embedding the full argument list. The child's output is then lost because output() is cancelled.

Solutions

  1. Run the failing spicetify command manually to see where it hangs (often an interactive prompt or Spotify state)
  2. Kill any stuck spicetify/Spotify processes and retry the operation
  3. For update/upgrade commands, check network/proxy connectivity to the spicetify CDN
  4. Pre-seed non-interactive flags or config so spicetify never prompts; consider raising the 240s timeout for slow networks

Example fix

// before
let output = tokio::time::timeout(std::time::Duration::from_secs(240), cmd.output())
    .await
    .map_err(|_| anyhow!("spicetify {} nao respondeu em 4 minutos", args.join(" ")))??;
// after
let output = tokio::time::timeout(std::time::Duration::from_secs(600), cmd.output())
    .await
    .map_err(|_| anyhow!("spicetify {} timed out after 10 minutes", args.join(" ")))??;
Defensive patterns

Strategy: retry

Validate before calling

// probe that spicetify is responsive before long operations
let probe = tokio::time::timeout(
    std::time::Duration::from_secs(10),
    tokio::process::Command::new("spicetify").arg("--version").output(),
).await;
if probe.is_err() { eprintln!("spicetify not responding; kill stuck processes first"); }

Try / catch

match spicetify::run(&["apply"]).await {
    Err(e) if e.to_string().contains("nao respondeu") => {
        // kill stuck spicetify/Spotify, then retry once
    }
    other => other.map(|_| ()),
}

Prevention

When it happens

Trigger: Any spicetify subcommand (config, backup, apply, update, upgrade) that hangs: waiting on interactive prompt (stdin is nulled but the tool may still block), network stalls during market/CLI update, or spicetify awaiting a Spotify restart.

Common situations: First-run `spicetify backup` while Spotify holds locks; `spicetify update spicetify` on a slow connection; spicetify prompting for confirmation that can never be answered because stdin is /dev/null; Spotify client in a bad state during `apply`.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/b2376d1d6048ddd6. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/spicetify.rs:92

                }
            }
        } else if c != '\r' {
            out.push(c);
        }
    }
    out
}

pub async fn run(bin: &Path, args: &[&str]) -> anyhow::Result<CmdOutput> {
    let mut cmd = crate::core::process::command(bin);
    cmd.args(args)
        .env("NO_COLOR", "1")
        .stdin(std::process::Stdio::null())
        .stdout(std::process::Stdio::piped())
        .stderr(std::process::Stdio::piped());
    let output = tokio::time::timeout(std::time::Duration::from_secs(240), cmd.output())
        .await
        .map_err(|_| anyhow!("spicetify {} nao respondeu em 4 minutos", args.join(" ")))??;
    Ok(CmdOutput {
        ok: output.status.success(),
        code: output.status.code(),
        stdout: strip_ansi(&String::from_utf8_lossy(&output.stdout)),
        stderr: strip_ansi(&String::from_utf8_lossy(&output.stderr)),
    })
}

/// Falha vira `Err` com a mensagem que o Spicetify imprimiu, para a UI
/// mostrar o motivo real ("Spotify not found", "already patched"…).
pub async fn run_ok(bin: &Path, args: &[&str]) -> anyhow::Result<CmdOutput> {
    let out = run(bin, args).await?;
    if out.ok {
        return Ok(out);
    }
    let msg = if out.stderr.trim().is_empty() {
        out.stdout.trim().to_string()
    } else {

View on GitHub (pinned to 8600b91f42)