mirror of
https://github.com/mudler/LocalAI
synced 2026-04-21 13:27:21 +00:00
Two interrelated bugs that combined to make a meta backend impossible to uninstall once its concrete had been removed from disk (partial install, earlier crash, manual cleanup). 1. DeleteBackendFromSystem returned "meta backend %q not found" and bailed out early when the concrete directory didn't exist, preventing the orphaned meta dir from ever being removed. Treat a missing concrete as idempotent success — log a warning and continue to remove the orphan meta. 2. InstallBackendFromGallery's "already installed, skip" short-circuit only checked that the name was known (`backends.Exists(name)`); an orphaned meta whose RunFile points at a missing concrete still satisfies that check, so every reinstall returned nil without doing anything. Afterwards the worker's findBackend returned empty and we kept looping with "backend %q not found after install attempt". Require the entry to be actually runnable (run.sh stat-able, not a directory) before skipping. New helper isBackendRunnable centralises the runnability test so both the install guard and future callers stay in sync. Tests cover the orphaned-meta delete path and the non-runnable short-circuit case. |
||
|---|---|---|
| .. | ||
| importers | ||
| backend_resolve.go | ||
| backend_types.go | ||
| backends.go | ||
| backends_test.go | ||
| backends_version_test.go | ||
| gallery.go | ||
| gallery_suite_test.go | ||
| gallery_test.go | ||
| metadata_type.go | ||
| models.go | ||
| models_test.go | ||
| models_types.go | ||
| request_test.go | ||
| upgrade.go | ||
| upgrade_test.go | ||
| worker.go | ||
| worker_test.go | ||