diegosouzapw/OmniRoute · error · Error

failedRemoveModelFromDatabase

Error message

failedRemoveModelFromDatabase

What it means

Sentinel thrown when DELETE /api/provider-models fails while removing a model from the custom-models DB (and alias mapping). Fires on non-OK status — model not found, provider mismatch, or DB write error.

Solutions

  1. Retry the delete from the model list
  2. Confirm the model still exists (it may have been removed already)
  3. Check the provider alias/query params in the DELETE URL are correct
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/CompatibleModelsSection.tsx:333 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/649436f4be22d8c9. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/CompatibleModelsSection.tsx:333

      console.error("Error importing models:", error);
      notify.error(t("failedImportModelsTryAgain"));
    } finally {
      setImporting(false);
    }
  };

  const canImport = connections.some((conn) => conn.isActive !== false);

  // Handle delete: remove from both alias and customModels DB
  const handleDeleteModel = async (modelId: string, alias?: string | null) => {
    try {
      // Remove from customModels DB
      const res = await fetch(
        `/api/provider-models?provider=${encodeURIComponent(providerStorageAlias)}&model=${encodeURIComponent(modelId)}`,
        { method: "DELETE" }
      );
      if (!res.ok) {
        throw new Error(t("failedRemoveModelFromDatabase"));
      }
      // Also delete the alias
      if (alias) {
        await onDeleteAlias(alias);
      }
      notify.success(t("modelRemovedSuccess"));
      onModelsChanged?.();
    } catch (error) {
      console.error("Error deleting model:", error);
      notify.error(error instanceof Error ? error.message : t("failedDeleteModelTryAgain"));
    }
  };

  return (
    <div className="flex flex-col gap-4">
      <p className="text-sm text-text-muted">{description}</p>

      <div className="flex items-end gap-2 flex-wrap">

View on GitHub (pinned to a179ffed5b)