Replace with generic proxmox-server hostname across all documentation and code comments.
7.1 KiB
Investigation Findings: Remote Add Failure and Updater Errors
Executive Summary
This investigation identified two critical issues in the Tauri application:
- Remote add failure: The
add_proxmox_clustercommand is defined and registered, but the error "Failed to add remote" occurs due to missing error handling in the frontend. - Updater errors: The updater commands (
check_app_updates,get_update_channel,set_update_channel) are NOT registered in the Tauri command handler, causing "Command not found" errors.
Issue 1: Remote Add Failure
Root Cause Analysis
The error "Failed to add remote" occurs in /src/pages/Proxmox/RemotesPage.tsx at line 64 and is propagated from the backend add_proxmox_cluster command.
Code Flow:
-
Frontend:
RemotesPage.tsx→handleAddRemote()(line 55-76)- Calls
addProxmoxCluster()fromproxmoxClient.ts - Catches error and displays toast notification
- Calls
-
Frontend Wrapper:
proxmoxClient.ts(line 17-33)export async function addProxmoxCluster( id: string, name: string, clusterType: ClusterType, connection: { url: string; port: number }, username: string, password: string ): Promise<ClusterInfo> { return await invoke<ClusterInfo>("add_proxmox_cluster", { id, name, cluster_type: clusterType, connection, username, password }); } -
Backend Command:
src-tauri/src/commands/proxmox.rs(line 35-105)- IS registered in
lib.rsat line 226 - Stores credentials encrypted in database
- Creates in-memory client pool (unauthenticated)
- IS registered in
Current Implementation Status:
- ✅ Command is registered:
commands::proxmox::add_proxmox_cluster(line 226) - ✅ Command implementation exists in
proxmox.rs - ✅ Database migration 034 added
usernamecolumn - ⚠️ Error handling: Frontend catches and displays error, but backend error details may not be descriptive
Recent Changes (Commit 87ccbb64):
- Removed live authentication requirement during cluster add
- Credentials are now stored encrypted and used on first API call
- Added
usernamecolumn to database schema
Issue 2: Updater Errors
Root Cause Analysis
The updater commands are DEFINED but NOT REGISTERED in the Tauri command handler.
Missing Commands:
| Command | Location | Status |
|---|---|---|
check_app_updates |
system.rs:498 |
✅ Defined ❌ NOT REGISTERED |
get_update_channel |
system.rs:589 |
✅ Defined ❌ NOT REGISTERED |
set_update_channel |
system.rs:598 |
✅ Defined ❌ NOT REGISTERED |
install_app_updates |
system.rs:579 |
✅ Defined ❌ NOT REGISTERED |
Current Command Registration:
File: src-tauri/src/lib.rs (lines 243-258)
// System / Settings
commands::system::check_ollama_installed,
commands::system::get_ollama_install_guide,
commands::system::list_ollama_models,
commands::system::pull_ollama_model,
commands::system::delete_ollama_model,
commands::system::detect_hardware,
commands::system::recommend_models,
commands::system::get_settings,
commands::system::update_settings,
commands::system::get_audit_log,
commands::system::get_app_version,
commands::system::set_sudo_password,
commands::system::get_sudo_config_status,
commands::system::test_sudo_password,
commands::system::clear_sudo_password,
MISSING:
commands::system::check_app_updatescommands::system::get_update_channelcommands::system::set_update_channelcommands::system::install_app_updates
Frontend Usage:
File: src/lib/tauriCommands.ts (lines 652-662)
export const checkAppUpdatesCmd = async (): Promise<UpdateCheckResult> =>
invoke<UpdateCheckResult>("check_app_updates");
export const installAppUpdatesCmd = async (): Promise<void> =>
invoke<void>("install_app_updates");
export const getUpdateChannelCmd = async (): Promise<string> =>
invoke<string>("get_update_channel");
export const setUpdateChannelCmd = async (channel: string): Promise<void> =>
invoke<void>("set_update_channel", { channel });
File: src/pages/Settings/Updater.tsx (lines 32, 52)
- Calls
checkAppUpdatesCmd()andsetUpdateChannelCmd() - Both will fail with "Command not found" error
Recent Changes (Commit 87ccbb64):
Before: Used tauri-plugin-updater with app.updater().check()
After: Direct Gitea HTTP API call (lines 498-576 in system.rs)
let response = client
.get(
"https://gogs.tftsr.com/api/v1/repos/sarman/tftsr-devops_investigation/releases?limit=20",
)
.header("Accept", "application/json")
.send()
.await
Key improvements:
- Added update channel filtering (stable vs beta)
- Returns full release info (version, URL, notes)
- Uses
tauri-plugin-openerfor browser launch
Files to Modify
Fix 1: Updater Commands Registration
File: src-tauri/src/lib.rs
Location: Lines 253-258 (after get_app_version)
Required Addition:
commands::system::check_app_updates,
commands::system::install_app_updates,
commands::system::get_update_channel,
commands::system::set_update_channel,
Fix 2: Remote Add Error Handling (Optional Enhancement)
File: src-tauri/src/commands/proxmox.rs
Location: Lines 35-105 (add_proxmox_cluster)
Current Behavior: Returns generic error from database or encryption failures
Recommended Enhancement: Add more descriptive error messages for:
- Invalid URL format
- Duplicate remote name
- Database connection issues
- Encryption failures
Verification Steps
After applying fixes:
-
Build the application:
cd src-tauri cargo build --release -
Test updater commands:
- Navigate to Settings > Updater
- Verify channel selection works
- Verify "Check Now" button works
- Check browser opens on "Download Update"
-
Test remote add:
- Navigate to Remotes page
- Click "Add Remote"
- Fill in configuration
- Verify remote is added successfully
- Check database entry in
proxmox_clusterstable
Related Files
| File | Purpose |
|---|---|
src-tauri/src/lib.rs |
Command registration (MISSING updater commands) |
src-tauri/src/commands/system.rs |
Updater command implementations |
src-tauri/src/commands/proxmox.rs |
Remote/cluster command implementation |
src/lib/tauriCommands.ts |
Frontend command wrappers |
src/lib/proxmoxClient.ts |
Proxmox API client |
src/pages/Settings/Updater.tsx |
Updater UI |
src/pages/Proxmox/RemotesPage.tsx |
Remote management UI |
src/components/Proxmox/AddRemoteForm.tsx |
Remote add form |
Git History Context
Commit 87ccbb64 ("fix(proxmox): remove dummy data, fix add-remote, fix updater"):
- Added
list_proxmox_containerscommand - Fixed
add_proxmox_clusterto store credentials without live auth - Replaced
tauri-plugin-updaterwith direct Gitea API - Added update channel filtering
- Issue: Forgot to register updater commands in
lib.rs
Current Branch: fix/proxmox-v1.2.1 (commit 758d783e)
Latest Release: v1.2.3 (commit 8befa472)