jlcodes99/cockpit-tools · warning
[StartupPerf][UpdaterCommand] get_update_settings failed in
Error message
[StartupPerf][UpdaterCommand] get_update_settings failed in {}ms: {} What it means
The get_update_settings command reads auto-update settings (auto_check, auto_install, last_check_time) via update_checker; on Err it logs '[StartupPerf][UpdaterCommand] get_update_settings failed in {ms}ms: {err}' and returns the error. It means the update settings could not be loaded.
Source
Thrown at src-tauri/src/commands/update.rs:49
)),
}
result
}
/// Get update settings
#[tauri::command]
pub fn get_update_settings() -> Result<UpdateSettings, String> {
let started = Instant::now();
let result = update_checker::load_update_settings();
match &result {
Ok(settings) => logger::log_info(&format!(
"[StartupPerf][UpdaterCommand] get_update_settings completed in {}ms: auto_check={}, auto_install={}, last_check_time={}",
started.elapsed().as_millis(),
settings.auto_check,
settings.auto_install,
settings.last_check_time
)),
Err(err) => logger::log_error(&format!(
"[StartupPerf][UpdaterCommand] get_update_settings failed in {}ms: {}",
started.elapsed().as_millis(),
err
)),
}
result
}
/// Patch only the updater fields changed by the caller.
#[tauri::command]
pub fn patch_update_settings(
auto_check: Option<bool>,
check_interval_hours: Option<u64>,
auto_install: Option<bool>,
last_run_version: Option<String>,
remind_on_update: Option<bool>,
skipped_version: Option<String>,
) -> Result<UpdateSettings, String> {View on GitHub (pinned to 1ed8b77992)
Solutions
- Read the inner err: deserialization errors indicate schema mismatch, I/O errors indicate file access problems.
- If the settings JSON is from an older schema, delete/reset it so defaults are regenerated.
- Check file permissions and close other app instances locking the settings file.
- Retry the command; on transient lock errors a second startup usually succeeds.
Defensive patterns
Strategy: fallback
Validate before calling
const raw = await readSettingsFileRaw().catch(() => null);
if (raw && !isValidSettingsJson(raw)) await invoke('reset_update_settings'); Type guard
function areUpdateSettings(s: unknown): s is { auto_check: boolean; auto_install: boolean; last_check_time: number | null } {
const o = s as any;
return typeof o === 'object' && o !== null && typeof o.auto_check === 'boolean' && typeof o.auto_install === 'boolean';
} Try / catch
try {
const settings = await invoke('get_update_settings');
} catch (e) {
const settings = DEFAULT_UPDATE_SETTINGS; // fallback defaults
await invoke('reset_update_settings');
} Prevention
- Migrate settings schema explicitly on app upgrades
- Provide sane defaults when the settings file is missing
- Validate settings JSON on load and self-heal by resetting
- Avoid concurrent first-run writes to the settings file
When it happens
Trigger: update_checker::get_update_settings returns Err: settings file missing/unreadable, JSON deserialization failure (schema changed between app versions), or file lock held by another instance.
Common situations: Upgrading the app after the settings schema changed, leaving incompatible JSON; config dir permissions changed; first run with partially initialized settings store.
Related errors
- [App] Silent update download failed, retrying (${retryIndex}
- [StartupPerf][UpdaterCommand] update_last_check_time failed
- [StartupPerf][UpdaterCommand] check_version_jump failed in {
- [Updater] {}
- [AccountGroups] Failed to load groups: ${String(error)}
AI-assisted analysis of jlcodes99/cockpit-tools@1ed8b77992 (2026-09-05).
Data as JSON: /api/errors/d612c2ff860ce7ab.
Report an issue: GitHub.