diegosouzapw/OmniRoute · error · Error

Remote image fetch error

Error message

Remote image fetch error ${response.status}

What it means

HTTP-status error from fetchRemoteImage(): the upstream responded with a non-2xx, non-3xx status (404, 403, 500, ...). It is the generic failure branch after redirects were handled; the status in the message identifies the upstream outcome.

Solutions

  1. Check the image URL is still valid (404) and accessible (401/403 auth on the media host)
  2. Retry later if the upstream returned 5xx
  3. Ensure any required auth/headers for the media host are supplied via the fetch options
  4. Replace the asset with a working mirror
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/shared/network/remoteImageFetch.ts:232 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/shared/network/remoteImageFetch.ts:232

    });

    if (response.status >= 300 && response.status < 400) {
      const location = response.headers.get("location");
      if (!location) {
        throw new Error(`Remote image redirect missing Location header (${response.status})`);
      }
      if (redirectCount >= maxRedirects) {
        throw new Error(`Remote image exceeded ${maxRedirects} redirect limit`);
      }
      currentUrl = requireHttps(
        validateRemoteImageUrl(new URL(location, currentUrl), guard),
        options.enforceHttps === true
      );
      continue;
    }

    if (!response.ok) {
      throw new Error(`Remote image fetch error ${response.status}`);
    }

    return {
      buffer: await readResponseBuffer(response, maxBytes),
      contentType: response.headers.get("content-type") || "application/octet-stream",
      url: currentUrl.toString(),
    };
  }

  throw new Error(`Remote image exceeded ${maxRedirects} redirect limit`);
}

/** Backward-compatible image-specific entry point. */
export async function fetchRemoteImage(
  input: string | URL,
  options: RemoteImageFetchOptions = {}
): Promise<RemoteImageFetchResult> {
  return fetchRemoteMedia(input, options);

View on GitHub (pinned to a179ffed5b)