mihomo-party-org/clash-party · warning
[ProfileUpdater] Failed to init current profile:
Error message
[ProfileUpdater] Failed to init current profile:
What it means
The second half of initProfileUpdater performs the same on-start refresh for the currently selected profile (currentId): addProfileItem(currentItem) is wrapped in try/catch that logs this warning on failure. Afterwards the code still fetches the latest item and schedules scheduleDelayedCurrentUpdate, so a delayed retry path exists; this warning only means the immediate refresh failed.
Source
Thrown at src/main/core/profileUpdater.ts:149
}
}
if (item.type === 'plugin' && item.autoUpdate && item.interval) {
await addProfileUpdater(item)
}
}
await auditPluginProfileVault(currentItem)
if (currentItem?.type === 'remote' && currentItem.autoUpdate && currentItem.interval) {
const currentId = currentItem.id
await addProfileUpdater(currentItem)
if (autoUpdateProfileOnStart) {
try {
await addProfileItem(currentItem)
} catch (e) {
await logger.warn(`[ProfileUpdater] Failed to init current profile:`, e)
}
}
const latestCurrentItem = (await getProfileItem(currentId)) ?? currentItem
scheduleDelayedCurrentUpdate(latestCurrentItem)
}
if (
currentItem?.type === 'plugin' &&
currentItem.autoUpdate &&
currentItem.interval &&
currentItem.id !== 'default'
) {
await addProfileUpdater(currentItem)
}
}
export async function addProfileUpdater(item: IProfileItem): Promise<void> {View on GitHub (pinned to 911e090537)
Solutions
- Rely on the subsequent scheduleDelayedCurrentUpdate which retries shortly after — verify the delayed update succeeds.
- Check the current profile's URL and item integrity (getProfileItem(currentId)) and re-import if fields are missing.
- Ensure network is available at startup (delay autoUpdateProfileOnStart or gate it on connectivity).
Defensive patterns
Strategy: retry
Validate before calling
const currentItem = await getProfileItem(currentId)
if (!currentItem) {
logger.warn('current profile missing; selecting first available')
return
} Try / catch
try {
await addProfileItem(currentItem)
} catch (e) {
logger.warn('[ProfileUpdater] Failed to init current profile:', e)
// scheduleDelayedCurrentUpdate below already provides a retry path
} Prevention
- Rely on the built-in scheduleDelayedCurrentUpdate as the retry; ensure it always runs even after failure.
- Verify currentId resolves to an existing item after data restores or migrations.
- On autostart, wait for network-ready events before enabling autoUpdateProfileOnStart work.
When it happens
Trigger: Startup with autoUpdateProfileOnStart enabled and addProfileItem(currentItem) rejects — network not ready yet, subscription endpoint error, or the current profile item is corrupt/missing required fields.
Common situations: App autostarts with the OS before network interfaces are up; the selected subscription returns an error right after boot; currentId points to a deleted/migrated profile item after an app data restore.
Related errors
- [ProfileUpdater] Failed to update current profile:
- [ProfileUpdater] Failed to update ${logLabel}:
- [ProfileUpdater] Failed to init profile ${item.name}:
- Get device failed
- Request failed with status ${res.status}: ${url}
AI-assisted analysis of mihomo-party-org/clash-party@911e090537 (2026-08-30).
Data as JSON: /api/errors/6c275d6f213f8911.
Report an issue: GitHub.