Mintplex-Labs/anything-llm · error · Error

No plugin hubID passed.

Error message

No plugin hubID passed.

What it means

Input guard in ImportedPlugin.deletePlugin: the required hubId argument is missing, so the plugin folder to delete cannot be located under the plugins root and the operation is refused before touching the filesystem.

Solutions

  1. Pass a valid hubID when loading the imported plugin.
  2. Re-import the plugin from the community hub so its hubID is recorded.
Defensive patterns

Strategy: validation

When it happens

Trigger: An imported plugin was invoked without its hubID.

Common situations: This error is raised at runtime in server/utils/agents/imported.js. It occurs when the required configuration for this provider is missing or invalid (unset environment variables, empty API key or base path), when the external service is unreachable or returns an unexpected response, or when invalid input reaches the call site. To prevent it, validate the relevant provider settings and environment variables at startup and confirm the service is reachable before this code path executes.


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/13db732b640047a0. Report an issue: GitHub.

Appendix: source

Thrown at server/utils/agents/imported.js:138

    const currentConfig = safeJsonParse(
      fs.readFileSync(configLocation, "utf8"),
      null
    );
    if (!currentConfig) return;

    const { hubId: _drop, ...safeConfig } = config;
    const updatedConfig = { ...currentConfig, ...safeConfig };
    fs.writeFileSync(configLocation, JSON.stringify(updatedConfig, null, 2));
    return updatedConfig;
  }

  /**
   * Deletes a plugin. Removes the entire folder of the object.
   * @param {string} hubId - The hub ID of the plugin.
   * @returns {boolean} - True if the plugin was deleted, false otherwise.
   */
  static deletePlugin(hubId) {
    if (!hubId) throw new Error("No plugin hubID passed.");
    const pluginFolder = path.resolve(pluginsPath, normalizePath(hubId));
    if (!this.isValidLocation(pluginFolder)) return;
    fs.rmSync(pluginFolder, { recursive: true });
    return true;
  }

  /**
  /**
   * Validates if the handler.js file exists for the given plugin.
   * @param {string} hubId - The hub ID of the plugin.
   * @returns {boolean} - True if the handler.js file exists, false otherwise.
   */
  static validateImportedPluginHandler(hubId) {
    const handlerLocation = path.resolve(
      pluginsPath,
      normalizePath(hubId),
      "handler.js"
    );

View on GitHub (pinned to 3aec848f28)