{"record":{"id":"f67d786bd08c83f9","repo":"mihomo-party-org/clash-party","slug":"profileupdater-failed-to-init-profile-item-nam","errorCode":null,"errorMessage":"[ProfileUpdater] Failed to init profile ${item.name}:","messagePattern":"\\[ProfileUpdater\\] Failed to init profile (.+?):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/main/core/profileUpdater.ts","lineNumber":129,"sourceCode":"  )\n}\n\nexport async function initProfileUpdater(): Promise<void> {\n  const { autoUpdateProfileOnStart = true } = await getAppConfig()\n  const { items = [], current } = await getProfileConfig()\n  const currentItem = await getCurrentProfileItem()\n\n  for (const item of items.filter((i) => i.id !== current)) {\n    await auditPluginProfileVault(item)\n\n    if (item.type === 'remote' && item.autoUpdate && item.interval) {\n      await addProfileUpdater(item)\n\n      if (autoUpdateProfileOnStart) {\n        try {\n          await addProfileItem(item)\n        } catch (e) {\n          await logger.warn(`[ProfileUpdater] Failed to init profile ${item.name}:`, e)\n        }\n      }\n    }\n\n    if (item.type === 'plugin' && item.autoUpdate && item.interval) {\n      await addProfileUpdater(item)\n    }\n  }\n\n  await auditPluginProfileVault(currentItem)\n\n  if (currentItem?.type === 'remote' && currentItem.autoUpdate && currentItem.interval) {\n    const currentId = currentItem.id\n    await addProfileUpdater(currentItem)\n\n    if (autoUpdateProfileOnStart) {\n      try {\n        await addProfileItem(currentItem)","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/mihomo-party-org/clash-party/blob/911e090537acdf7c50bee1c3aebecc2ef119a8b5/src/main/core/profileUpdater.ts#L111-L147","documentation":"In initProfileUpdater, when autoUpdateProfileOnStart is enabled, each profile item is initialized via addProfileItem(item); a rejection is caught and logged with this warning including the profile name. The profile's initial on-start refresh failed, but updater registration (addProfileUpdater) already succeeded, so future scheduled updates still occur.","triggerScenarios":"App startup with auto-update-on-start enabled and addProfileItem rejects for a specific item: remote URL unreachable, HTTP error, content validation failure, or item stored with stale/invalid fields (e.g. missing url for type 'remote').","commonSituations":"First launch after import with no network yet; imported profile with malformed or expired subscription URL; proxy/auth changes invalidating old requests; plugin items whose source vanished.","solutions":["Identify the failing item via ${item.name} in the message and test its update URL manually.","Correct or re-import the profile item if its URL/fields are stale or invalid.","Once the network is available, trigger a manual profile update to recover; scheduled updates remain active regardless."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for (const item of items) {\n  if (item.type === 'remote' && !item.url) {\n    logger.warn(`skipping ${item.name}: remote item missing url`)\n    continue\n  }\n}","typeGuard":"const isUpdatableRemote = (i: IProfileItem): boolean =>\n  i.type === 'remote' && typeof i.url === 'string' && /^https?:\\/\\//.test(i.url)","tryCatchPattern":"try {\n  await addProfileItem(item)\n} catch (e) {\n  logger.warn(`[ProfileUpdater] Failed to init profile ${item.name}:`, e)\n}","preventionTips":["Validate profile items (url present and well-formed) at import time, not at update time.","Defer on-start updates until the network is confirmed up.","Test failing items' URLs manually to separate auth vs network vs content issues."],"tags":["profile-update","startup","init","subscription"],"backgroundTag":"profile-update-failed","analyzedSha":"911e090537acdf7c50bee1c3aebecc2ef119a8b5","analyzedAt":"2026-08-30T13:00:49.174Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}