diegosouzapw/OmniRoute · error

Failed to download plugin

Error message

Failed to download plugin '${name}': ${response.status}

What it means

installMarketplacePlugin downloaded the plugin archive via safeOutboundFetch (public-only guard) and the response was non-2xx; the status is embedded in the message. Download failed before checksum verification could run.

Solutions

  1. Retry the install — transient upstream errors often clear
  2. Check the downloadUrl in the marketplace entry is still valid
  3. Verify network/proxy access to the plugin host
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/plugins/marketplace.ts:229 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/04c81885fbbc6d18. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/plugins/marketplace.ts:229

 * Install a plugin from the marketplace by name.
 * Downloads the plugin archive, verifies checksum if present, and installs via PluginManager.
 */
export async function installMarketplacePlugin(name: string): Promise<{ name: string; version: string }> {
  const plugins = await listMarketplacePlugins();
  const entry = plugins.find((p) => p.name === name);
  if (!entry) {
    throw new Error(`Plugin '${name}' not found in marketplace`);
  }

  // Create temp dir for download
  const tmpDir = await mkdtemp(join(tmpdir(), "plugin-mp-"));
  const tmpFile = join(tmpDir, "plugin.tar.gz");

  try {
    // Download the plugin archive
    const response = await safeOutboundFetch(entry.downloadUrl, { guard: "public-only" });
    if (!response.ok) {
      throw new Error(`Failed to download plugin '${name}': ${response.status}`);
    }
    const buffer = Buffer.from(await response.arrayBuffer());

    // Verify SHA-256 checksum if provided
    if (entry.checksum) {
      const actual = createHash("sha256").update(buffer).digest("hex");
      if (actual !== entry.checksum) {
        throw new Error(
          `Checksum mismatch for plugin '${name}': expected ${entry.checksum}, got ${actual}`
        );
      }
    }

    // Write to temp file
    await writeFile(tmpFile, buffer);

    // Delegate to pluginManager.install
    const result = await pluginManager.install(tmpDir);

View on GitHub (pinned to a179ffed5b)