diegosouzapw/OmniRoute · error

Plugin ' ' not found

Error message

Plugin '${name}' not found

What it means

PluginManager.activate (and similar lifecycle ops) looked up the plugin by name in the DB and got no row — the name does not correspond to any installed plugin. Generic sentinel thrown before any load work begins.

Solutions

  1. Verify the plugin name spelling against the installed plugin list
  2. Install the plugin before activating it
  3. Check the DB was not reset (plugins table empty)
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at src/lib/plugins/manager.ts:375 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/685ad1279014221b. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/plugins/manager.ts:375

      pluginDir: destDir,
      enabled: manifest.enabledByDefault,
    });

    log.info("manager.upgraded", { name, version: manifest.version });

    if (manifest.enabledByDefault) {
      await this.activate(name);
    }

    return row;
  }

  /**
   * Activate a plugin — load into VM, register hooks, update DB.
   */
  async activate(name: string): Promise<void> {
    const row = getPluginByName(name);
    if (!row) throw new Error(`Plugin '${name}' not found`);
    // Guard on in-memory state, not DB status. DB status survives a restart but
    // loadedPlugins/hooks do not, so a DB-only check makes activate() a no-op for
    // every plugin already marked active — including the loadAll() boot path, whose
    // whole job is reloading exactly those. Hooks being fail-open, the plugin then
    // silently enforces nothing while the UI still reports it as active.
    if (row.status === "active" && this.loadedPlugins.has(name)) return;

    const manifest = JSON.parse(row.manifest) as PluginManifestWithDefaults;

    // Path traversal guard: use realpath to resolve symlinks
    const entryPoint = join(row.pluginDir, manifest.main);
    let resolvedPluginDir: string;
    try {
      resolvedPluginDir = await realpath(row.pluginDir);
    } catch {
      throw new Error(`Plugin directory '${row.pluginDir}' does not exist`);
    }
    const resolvedEntry = await realpath(entryPoint).catch(() => null);

View on GitHub (pinned to a179ffed5b)