denoland/deno · warning

Deno.autoUpdate: check failed:

Error message

Deno.autoUpdate: check failed:

What it means

This is the catch-all handler around the entire async update check in cli/rt/desktop.rs:1118-1120: any exception during the cycle is swallowed and logged with e.message. It covers network failures fetching latest.json or the patch file, and errors thrown out of op_desktop_apply_patch (e.g., SHA-256 mismatch). The app keeps running; the interval timer retries on the next tick.

Source

Thrown at cli/rt/desktop.rs:1190

        }}
        const patchResp = await fetch(base + "/" + patchName, {{
          cache: "no-store",
          redirect: "error",
        }});
        if (!patchResp.ok) return;
        const patchBytes = new Uint8Array(await patchResp.arrayBuffer());
        op_desktop_apply_patch(patchBytes, patchSha256);
        if (typeof onUpdateReady === "function") {{
          try {{ onUpdateReady(manifest.version); }} catch (e) {{
            console.error("Deno.autoUpdate onUpdateReady threw:", e);
          }}
        }}
        if (autoUpdateTimer) {{
          clearInterval(autoUpdateTimer);
          autoUpdateTimer = null;
        }}
      }} catch (e) {{
        console.warn("Deno.autoUpdate: check failed:", e.message);
      }}
    }};

    setTimeout(check, 1000);
    if (interval) {{
      autoUpdateTimer = setInterval(check, interval);
    }}
  }}

  Object.defineProperties(Deno, {{
    desktopVersion: propReadOnly(_version),
    autoUpdate: propWritable(autoUpdate),
  }});
}})();
"#,
    version = serde_json::to_string(&version).unwrap(),
    rolled_back = if rolled_back { "true" } else { "false" },
    release_base_url = serde_json::to_string(&release_base_url).unwrap(),

View on GitHub (pinned to f7822238ca)

Solutions

  1. Read the appended e.message first: 'fetch failed' points to network/DNS/TLS; hash/patch errors point to a manifest-artifact mismatch
  2. From the same machine, curl -f the latest.json and patch URLs to confirm they are reachable over https with no redirects
  3. If the sha256 mismatches, republish the patch artifact and update its sha256 in latest.json
  4. Keep the interval option set so transient failures retry on the next tick instead of stopping updates

Example fix

# before: typo'd host, every check logs 'check failed: fetch failed'
Deno.autoUpdate({ url: "https://updatess.example.com/myapp" });

# after: verify the endpoint, then enable with a retry interval
$ curl -f https://updates.example.com/myapp/latest.json
Deno.autoUpdate({ url: "https://updates.example.com/myapp", interval: 3_600_000 });
Defensive patterns

Strategy: retry

Validate before calling

// preflight the update host before enabling autoUpdate
const health = await fetch(`${url}/latest.json`, { redirect: "error", cache: "no-store" });
if (!health.ok) throw new Error(`update host unhealthy: ${health.status}`);
Deno.autoUpdate({ url, interval: 3_600_000 }); // interval => failed checks retry

Prevention

When it happens

Trigger: fetch rejecting because the machine is offline, DNS fails, TLS fails, or the server redirects (redirect: 'error'); the patch download returning !resp.ok is silent, but a rejected arrayBuffer() logs here; op_desktop_apply_patch throwing when the downloaded patch's hash does not match the manifest sha256; anything thrown by user callbacks is caught separately, so this message is infrastructure, not callback, failure.

Common situations: Laptops resuming from sleep with dead sockets; corporate proxies intercepting https; self-signed or expired certificates on the update host; re-uploading a patch artifact without updating its sha256 in the manifest; update host down during deploys.

Related errors


AI-assisted analysis of denoland/deno@f7822238ca (2026-08-20). Data as JSON: /api/errors/d8703a536d56eed3. Report an issue: GitHub.