diegosouzapw/OmniRoute · error · ObsidianTimeoutError

Obsidian API request timed out after 30s

Error message

Obsidian API request timed out after 30s

What it means

In obsidianFetch's attempt(), the AbortController fired at the 30s timeout before the Obsidian Local REST API answered; the AbortError is rethrown as ObsidianTimeoutError. Means Obsidian (or the network path to it) was unreachable or hung within the window.

Solutions

  1. Confirm the Obsidian Local REST API plugin is enabled and Obsidian is running
  2. Check the configured baseUrl/port (HTTP 27123) and network path (e.g. Tailscale)
  3. Retry — transient stalls resolve on the next attempt
  4. Increase the request timeout if queries legitimately run long
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/obsidian/api.ts:103 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/12d4617cf62a71ef. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/obsidian/api.ts:103

        if (error instanceof ObsidianServerError && retryCount < MAX_RETRIES - 1) {
          lastError = error;
          await sleep(Math.pow(2, retryCount) * 200);
          return attempt(retryCount + 1);
        }

        throw error;
      }

      const ct = response.headers.get("content-type") ?? "";
      if (ct.includes("application/json")) {
        return response.json();
      }
      return response.text();
    } catch (err) {
      if (err instanceof Error && err.name === "AbortError") {
        clearTimeout(timeout);
        throw new ObsidianTimeoutError("Obsidian API request timed out after 30s");
      }
      if (err instanceof ObsidianAuthError || err instanceof ObsidianNotFoundError) {
        clearTimeout(timeout);
        throw err;
      }
      if (err instanceof TypeError && err.message === "fetch failed") {
        clearTimeout(timeout);
        throw new ObsidianServerError(
          `Cannot reach Obsidian at ${baseUrl}. Ensure the Local REST API plugin is running ` +
          `and using the correct port. The REST API uses HTTP on port 27123 — do not use ` +
          `port 27124 (that is a separate MCP endpoint with HTTPS). If connecting via ` +
          `Tailscale, use http://<tailscale-ip>:27123.`
        );
      }
      if (retryCount < MAX_RETRIES - 1) {
        lastError = err instanceof Error ? err : new ObsidianServerError(String(err));
        await sleep(Math.pow(2, retryCount) * 200);
        return attempt(retryCount + 1);

View on GitHub (pinned to a179ffed5b)