[PR #279] [MERGED] Fix stale LXC entries and improve orphaned script cleanup #304

Closed
opened 2025-11-20 04:14:02 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/279
Author: @michelroegl-brunner
Created: 11/7/2025
Status: Merged
Merged: 11/7/2025
Merged by: @michelroegl-brunner

Base: mainHead: fix/262


📝 Commits (1)

  • bd3ca74 Fix stale LXC entries and improve orphaned script cleanup

📊 Changes

2 files changed (+121 additions, -44 deletions)

View changed files

📝 src/app/_components/InstalledScriptsTab.tsx (+12 -0)
📝 src/server/api/routers/installedScripts.ts (+109 -44)

📄 Description

Problem

  • Deleted LXC containers (like Planka) were still showing in the installed scripts list
  • New LXC installations weren't showing container ID or IP address correctly
  • Cleanup function was not reliably detecting deleted containers

Solution

  • Improved cleanup function: Now uses pct list to verify containers exist (more reliable than checking config files)
  • Batch processing: Groups scripts by server for more efficient checking
  • Double-check logic: Verifies both pct list and config file existence before deletion
  • Manual cleanup button: Added "🧹 Cleanup Orphaned Scripts" button for on-demand cleanup
  • Better error handling: Improved logging and error handling throughout the cleanup process

Changes

  • Modified cleanupOrphanedScripts to use pct list for container verification
  • Added batch processing by server to reduce SSH connections
  • Added manual cleanup button in Installed Scripts tab
  • Improved error handling and logging

Testing

  • Cleanup function now properly detects and removes orphaned scripts
  • Manual cleanup button allows users to trigger cleanup on-demand
  • Better reliability when checking if containers exist on Proxmox servers

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE-Local/pull/279 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 11/7/2025 **Status:** ✅ Merged **Merged:** 11/7/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `fix/262` --- ### 📝 Commits (1) - [`bd3ca74`](https://github.com/community-scripts/ProxmoxVE-Local/commit/bd3ca74175ffce4c824d4198d06b3451f03a5fc2) Fix stale LXC entries and improve orphaned script cleanup ### 📊 Changes **2 files changed** (+121 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `src/app/_components/InstalledScriptsTab.tsx` (+12 -0) 📝 `src/server/api/routers/installedScripts.ts` (+109 -44) </details> ### 📄 Description ## Problem - Deleted LXC containers (like Planka) were still showing in the installed scripts list - New LXC installations weren't showing container ID or IP address correctly - Cleanup function was not reliably detecting deleted containers ## Solution - **Improved cleanup function**: Now uses `pct list` to verify containers exist (more reliable than checking config files) - **Batch processing**: Groups scripts by server for more efficient checking - **Double-check logic**: Verifies both `pct list` and config file existence before deletion - **Manual cleanup button**: Added "🧹 Cleanup Orphaned Scripts" button for on-demand cleanup - **Better error handling**: Improved logging and error handling throughout the cleanup process ## Changes - Modified `cleanupOrphanedScripts` to use `pct list` for container verification - Added batch processing by server to reduce SSH connections - Added manual cleanup button in Installed Scripts tab - Improved error handling and logging ## Testing - Cleanup function now properly detects and removes orphaned scripts - Manual cleanup button allows users to trigger cleanup on-demand - Better reliability when checking if containers exist on Proxmox servers --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2025-11-20 04:14:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE-Local#304