{"record":{"id":"5092108a474831ab","repo":"mihomo-party-org/clash-party","slug":"i18next-t-mihomo-error-profilecheckfailed-509210","errorCode":null,"errorMessage":"${i18next.t('mihomo.error.profileCheckFailed')}:\n${errorLines.join('\n')}","messagePattern":"\\$\\{i18next\\.t\\('mihomo\\.error\\.profileCheckFailed'\\)\\}:\n\\$\\{errorLines\\.join\\('\n'\\)\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/core/manager.ts","lineNumber":998,"sourceCode":"      managerLogger.info('Profile check stdout', stdout)\n      managerLogger.info('Profile check stderr', stderr)\n\n      const errorLines = stdout\n        .split('\\n')\n        .filter((line) => line.includes('level=error') || line.includes('error'))\n        .map((line) => {\n          if (line.includes('level=error')) {\n            return line.split('level=error')[1]?.trim() || line\n          }\n          return line.trim()\n        })\n        .filter((line) => line.length > 0)\n\n      if (errorLines.length === 0) {\n        const allLines = stdout.split('\\n').filter((line) => line.trim().length > 0)\n        throw new Error(`${i18next.t('mihomo.error.profileCheckFailed')}:\\n${allLines.join('\\n')}`)\n      } else {\n        throw new Error(\n          `${i18next.t('mihomo.error.profileCheckFailed')}:\\n${errorLines.join('\\n')}`\n        )\n      }\n    } else {\n      throw new Error(`${i18next.t('mihomo.error.profileCheckFailed')}: ${error}`)\n    }\n  }\n}\n\n// 权限检查入口（从 permissions.ts 调用）\nexport async function checkAdminRestartForTun(): Promise<void> {\n  await checkAdminRestartForTunWithRestart(restartCore)\n}\n","sourceCodeStart":980,"sourceCodeEnd":1012,"githubUrl":"https://github.com/mihomo-party-org/clash-party/blob/911e090537acdf7c50bee1c3aebecc2ef119a8b5/src/main/core/manager.ts#L980-L1012","documentation":"This is the primary branch of the profile-check failure in the mihomo core manager: the `mihomo -t` validation run exited non-zero and stderr yielded non-empty error lines, so those lines are joined and thrown after a localized 'profileCheckFailed' prefix. It represents a concrete, diagnosed config error reported by the mihomo core itself.","triggerScenarios":"Running the profile check (on profile import, save, or manual re-check) with a config the mihomo core rejects; the core prints its specific complaint(s) to stderr, producing one or more errorLines that get embedded in the thrown message.","commonSituations":"Typo'd keys in proxies/proxy-groups; referencing a proxy in a group that doesn't exist; invalid port/UUID values; unsupported rule syntax; profiles written for an older Clash core version; hand-edited YAML with tab indentation.","solutions":["Inspect the error lines after the ':\\n' — they name the exact field/line the core rejected; correct them in the profile.","Run `mihomo -t -f <config>` yourself to iterate on fixes quickly.","Re-fetch the subscription if the profile is remotely managed and locally hand-edited.","Align core version with the profile schema (upgrade mihomo core or downgrade the profile format)."],"exampleFix":"// before\ntab-indented:\n\tkey: value\n\n// after: YAML forbids tabs for indentation\nspaced:\n  key: value","handlingStrategy":"try-catch","validationCode":"// pre-validate common schema pitfalls before the core check\nif (/\\t/.test(profileYaml)) throw new Error('YAML must not use tabs for indentation')\nconst doc = parse(profileYaml)\nfor (const g of doc['proxy-groups'] ?? []) {\n  for (const p of g.proxies ?? []) {\n    if (!doc.proxies?.some((x: any) => x.name === p) && !doc['proxy-groups']?.some((x: any) => x.name === p)) {\n      throw new Error(`Group \"${g.name}\" references unknown proxy \"${p}\"`)\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await checkProfile(configPath)\n} catch (e) {\n  const lines = String((e as Error).message).split('\\n').slice(1)\n  // first line after prefix holds the core's specific stderr complaint\n  showErrorDialog(lines.join('\\n'))\n}","preventionTips":["Use spaces, never tabs, in profile YAML.","Cross-check proxy-group member names against defined proxies after every edit.","Regenerate profiles from templates/subscriptions instead of hand-editing them."],"tags":["mihomo","config-validation","stderr","profile"],"backgroundTag":"config-validation-failed","analyzedSha":"911e090537acdf7c50bee1c3aebecc2ef119a8b5","analyzedAt":"2026-08-30T13:00:49.174Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}