LocalAI/core/gallery
Ettore Di Giacinto 372eb08dcf
fix(gallery): allow uninstalling orphaned meta backends + force reinstall (#9434)
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.
2026-04-20 00:10:19 +02:00
..
importers feat: refactor shared helpers and enhance MLX backend functionality (#9335) 2026-04-13 18:44:03 +02:00
backend_resolve.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
backend_types.go feat(ux): backend management enhancement (#9325) 2026-04-12 00:35:22 +02:00
backends.go fix(gallery): allow uninstalling orphaned meta backends + force reinstall (#9434) 2026-04-20 00:10:19 +02:00
backends_test.go fix(gallery): allow uninstalling orphaned meta backends + force reinstall (#9434) 2026-04-20 00:10:19 +02:00
backends_version_test.go feat: backend versioning, upgrade detection and auto-upgrade (#9315) 2026-04-11 22:31:15 +02:00
gallery.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
gallery_suite_test.go feat: Add backend gallery (#5607) 2025-06-15 14:56:52 +02:00
gallery_test.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
metadata_type.go feat(ui, gallery): Show model backends and add searchable model/backend selector (#9060) 2026-03-18 21:14:41 +01:00
models.go fix(ui): rename model config files on save to prevent duplicates (#9388) 2026-04-17 08:12:48 +02:00
models_test.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
models_types.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
request_test.go feat: Add backend gallery (#5607) 2025-06-15 14:56:52 +02:00
upgrade.go feat(distributed): sync state with frontends, better backend management reporting (#9426) 2026-04-19 17:55:53 +02:00
upgrade_test.go feat(distributed): sync state with frontends, better backend management reporting (#9426) 2026-04-19 17:55:53 +02:00
worker.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00
worker_test.go feat: add distributed mode (#9124) 2026-03-30 00:47:27 +02:00