Skip to content

fix(gallery): allow uninstalling orphaned meta backends + force reinstall#9434

Merged
mudler merged 1 commit intomasterfrom
fix/meta-backend-orphan-cleanup
Apr 19, 2026
Merged

fix(gallery): allow uninstalling orphaned meta backends + force reinstall#9434
mudler merged 1 commit intomasterfrom
fix/meta-backend-orphan-cleanup

Conversation

@mudler
Copy link
Copy Markdown
Owner

@mudler mudler commented Apr 19, 2026

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.

…tall

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.
@mudler mudler merged commit 372eb08 into master Apr 19, 2026
17 of 18 checks passed
@mudler mudler deleted the fix/meta-backend-orphan-cleanup branch April 19, 2026 22:10
@mudler mudler added the bug Something isn't working label Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant