diegosouzapw/OmniRoute · error · Error
failedImportModels
Error message
failedImportModels
What it means
handleCompatibleImportWithProgress model import/sync via POST /api/providers/{id}/sync-models failed or returned an error payload; the i18n key 'failedImportModels' is thrown for the hook to display. Often a timeout (60s AbortSignal.timeout) on large catalogs or an upstream provider error during model enumeration.
Solutions
- Retry the sync — large provider catalogs can exceed 60s
- Show partial progress already collected before the failure
- Check the provider connection health if imports repeatedly fail
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/app/(dashboard)/dashboard/providers/[id]/hooks/useModelImportHandlers.ts:306 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/827539680a873ed4.
Report an issue: GitHub.
Appendix: source
Thrown at src/app/(dashboard)/dashboard/providers/[id]/hooks/useModelImportHandlers.ts:306
logs: [],
error: "",
importedCount: 0,
});
try {
// mode "import" merges/appends; "sync" replaces the available list (used when
// re-syncing after toggling "import only free models").
const syncUrl =
mode === "sync"
? `/api/providers/${connectionId}/sync-models`
: `/api/providers/${connectionId}/sync-models?mode=import`;
const response = await fetch(syncUrl, {
method: "POST",
signal: AbortSignal.timeout(60_000),
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.error || t("failedImportModels"));
}
if (data.freeFilterEmpty) {
setImportProgress((prev) => ({
...prev,
phase: "done",
status: t("noFreeModelsFound"),
logs: [t("noFreeModelsFound")],
total: 0,
current: 0,
importedCount: 0,
}));
return;
}
const importedModels = Array.isArray(data.importedModels) ? data.importedModels : [];
const importedCount =
typeof data.importedCount === "number" ? data.importedCount : importedModels.length;View on GitHub (pinned to a179ffed5b)