tonhowtf/omniget · error

o Goodreads respondeu HTTP

Error message

o Goodreads respondeu HTTP {} no arquivo do export

What it means

While polling the export CSV URL with HEAD requests, trigger_and_wait tolerates 404 (not ready yet), 0 (request failure), and 403 (temporarily forbidden) and keeps waiting. Any other non-200 status is treated as a hard failure of the export file endpoint and surfaces this error.

Solutions

  1. Check whether a new export was triggered recently — generating a new one deletes the old file; wait for the new export to finish and rerun.
  2. Retry after a few minutes if the status was 5xx — this is often a transient Goodreads server error.
  3. Recapture cookies and rerun if the link appears permanently gone (404 would be tolerated, so an exotic code usually means session/link invalidation).
  4. Verify general Goodreads availability in a browser to rule out an outage on their side.

Example fix

// before
// transient 502 kills the run
let code = f.head_status(&csv_url).await.unwrap_or(0);

// after (caller-level retry)
for _ in 0..3 {
    match run(&f, &opts).await {
        Ok(v) => return Ok(v),
        Err(e) if e.to_string().contains("HTTP 5") => tokio::time::sleep(Duration::from_secs(120)).await,
        Err(e) => return Err(e),
    }
}
Defensive patterns

Strategy: retry

Try / catch

match run(&fetcher, &opts).await {
    Err(e) if e.to_string().contains("no arquivo do export") => {
        // 5xx from Goodreads is often transient; retry after a delay
        tokio::time::sleep(Duration::from_secs(300)).await;
        run(&fetcher, opts).await?;
    }
    r => r?,
}

Prevention

When it happens

Trigger: head_status returning a status like 410, 500, 502, or 302-that-isn't-followed on the CSV URL: the export link expired/was deleted (a newer export overwrote it), Goodreads server error, or an intermediary/proxy erroring.

Common situations: A previous export link saved on the import page was invalidated because someone triggered a new export; Goodreads outage returning 5xx; account state changed mid-poll (e.g. signed out elsewhere invalidating the link).

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/lists/goodreads.rs:301

            .await?;
        let status = resp.status();
        if !status.is_success() && status.as_u16() != 302 {
            return Err(anyhow!(
                "o Goodreads recusou o pedido de export (HTTP {}). Ele só deixa gerar um a cada poucos dias",
                status
            ));
        }
    }

    // Espera: o CSV é gerado em segundo plano e responde 404 até ficar pronto.
    let limit = Duration::from_secs(opts.wait_secs.clamp(30, 3600));
    loop {
        let code = f.head_status(&csv_url).await.unwrap_or(0);
        if code == 200 {
            break;
        }
        if code != 404 && code != 0 && code != 403 {
            return Err(anyhow!(
                "o Goodreads respondeu HTTP {} no arquivo do export",
                code
            ));
        }
        if started.elapsed() >= limit {
            return Err(anyhow!(
                "o Goodreads ainda não gerou o CSV depois de {}s. Deixe goodreads.com/review/import aberto, espere e rode de novo — o link fica salvo lá",
                limit.as_secs()
            ));
        }
        report(
            p,
            TOOL_ID,
            "progress",
            started.elapsed().as_secs(),
            Some(limit.as_secs()),
            Some("esperando o Goodreads gerar o CSV".into()),
        );

View on GitHub (pinned to 8600b91f42)