{"record":{"id":"73ed3f19e49eba2c","repo":"mihomo-party-org/clash-party","slug":"global-proxy-not-found","errorCode":null,"errorMessage":"GLOBAL proxy not found","messagePattern":"GLOBAL proxy not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/core/mihomoApi.ts","lineNumber":256,"sourceCode":"  const instance = await getAxios()\n  return await instance.delete('/connections')\n}\n\nexport const mihomoRules = async (): Promise<IMihomoRulesInfo> => {\n  const instance = await getAxios()\n  return await instance.get('/rules')\n}\n\nexport const mihomoRulesDisable = async (rules: Record<string, boolean>): Promise<void> => {\n  const instance = await getAxios()\n  return await instance.patch('/rules/disable', rules)\n}\n\nexport const mihomoProxies = async (): Promise<IMihomoProxies> => {\n  const instance = await getAxios()\n  const proxies = (await instance.get('/proxies')) as IMihomoProxies\n  if (!proxies.proxies['GLOBAL']) {\n    throw new Error('GLOBAL proxy not found')\n  }\n  return proxies\n}\n\nfunction isMihomoGroup(proxy: IMihomoProxy | IMihomoGroup | undefined): proxy is IMihomoGroup {\n  return Boolean(proxy && 'all' in proxy)\n}\n\nconst PROVIDER_DETAIL_FETCH_THRESHOLD = 8\n\nasync function mihomoProxyProvider(name: string): Promise<IMihomoProxyProvider> {\n  const instance = await getAxios()\n  return await instance.get(`/providers/proxies/${encodeURIComponent(name)}`)\n}\n\nasync function resolveProviderProxies(\n  names: Set<string>,\n  providerNames: Set<string>,","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/mihomo-party-org/clash-party/blob/911e090537acdf7c50bee1c3aebecc2ef119a8b5/src/main/core/mihomoApi.ts#L238-L274","documentation":"mihomoProxies fetches `/proxies` from the mihomo RESTful API and requires the reserved `GLOBAL` group to be present in the response, since the app's group/selector logic is built around it. If the API responds successfully but the proxy map lacks a `GLOBAL` entry, it throws this error because downstream consumers (runtime config, group switching) would otherwise crash on undefined.","triggerScenarios":"Calling mihomoProxies (directly or via the `proxies`/`runtime` IPC handlers) while the connected core's `/proxies` response contains no `GLOBAL` key — e.g. querying an external controller of a non-mihomo/older Clash core, hitting a wrong port where another service responds, or a core version whose response shape differs.","commonSituations":"Pointing the app's external-controller at a stale Clash core (premium/legacy) that doesn't expose GLOBAL the same way; controller URL misconfigured to a different app; core upgraded/downgraded with an incompatible API; transient core restart mid-request returning an empty/partial payload.","solutions":["Confirm the external-controller address/port targets the running mihomo core (curl http://127.0.0.1:<port>/proxies) and that 'GLOBAL' appears in the JSON.","Restart the mihomo core so it regenerates the full proxy set including GLOBAL.","Update the core to current mihomo (Meta) — legacy Clash cores have divergent /proxies payloads.","Check that a config with proxies actually loaded; a core started with an empty/invalid profile may expose no groups."],"exampleFix":"// before: controller pointing at wrong/legacy core\nexternalController: '127.0.0.1:9090' // legacy clash\n\n// after: run mihomo (Meta) core and match the port\nexternalController: '127.0.0.1:9097' // mihomo, verified via /version","handlingStrategy":"try-catch","validationCode":"// probe the controller before relying on /proxies\nconst res = await axios.get(`http://${controller}/version`)\nif (!String(res.data?.version ?? '').includes('meta')) {\n  console.warn('Controller does not look like a mihomo (Meta) core; GLOBAL may be absent')\n}","typeGuard":"function hasGlobal(p: IMihomoProxies): boolean {\n  return Boolean(p && typeof p === 'object' && p.proxies && 'GLOBAL' in p.proxies)\n}","tryCatchPattern":"try {\n  const proxies = await mihomoProxies()\n} catch (e) {\n  if ((e as Error).message === 'GLOBAL proxy not found') {\n    await restartCore() // regenerate full proxy set\n    return mihomoProxies()\n  }\n  throw e\n}","preventionTips":["Point external-controller at the actual mihomo core and verify with /version.","Avoid legacy Clash cores whose /proxies payload differs.","Retry once after a core restart; transient restarts can yield partial payloads."],"tags":["mihomo","api","proxy-group","global-missing"],"backgroundTag":"unexpected-api-response","analyzedSha":"911e090537acdf7c50bee1c3aebecc2ef119a8b5","analyzedAt":"2026-08-30T13:00:49.174Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}