mihomo-party-org/clash-party · warning
Core not ready after ${CORE_READY_MAX_RETRIES} attempts, pro
Error message
Core not ready after ${CORE_READY_MAX_RETRIES} attempts, proceeding anyway What it means
waitForCoreReady polls the mihomo controller API until it responds or CORE_READY_MAX_RETRIES attempts elapse. On the final failed attempt it logs this warning and returns anyway, letting callers (startMihomoApiStreams) proceed with stream setup against a possibly unready core. It indicates the core was slow to start or the controller endpoint never became reachable.
Source
Thrown at src/main/core/process.ts:162
}
}
export async function waitForCoreReady(): Promise<void> {
for (let i = 0; i < CORE_READY_MAX_RETRIES; i++) {
try {
const axios = await getAxios(true)
await axios.get('/')
managerLogger.info(
`Core ready after ${i + 1} attempts (${(i + 1) * CORE_READY_RETRY_INTERVAL_MS}ms)`
)
return
} catch {
if (i === 0) {
managerLogger.info('Waiting for core to be ready...')
}
if (i === CORE_READY_MAX_RETRIES - 1) {
managerLogger.warn(
`Core not ready after ${CORE_READY_MAX_RETRIES} attempts, proceeding anyway`
)
return
}
await new Promise((resolve) => setTimeout(resolve, CORE_READY_RETRY_INTERVAL_MS))
}
}
}
function normalizeProcessName(name: string): string {
return name
.trim()
.replace(/\.exe$/i, '')
.toLowerCase()
}
export async function verifyProcessOwner(View on GitHub (pinned to 911e090537)
Solutions
- Check core startup logs for a crash or config error — if the core died, fix that root cause first.
- Increase CORE_READY_MAX_RETRIES or CORE_READY_RETRY_INTERVAL_MS on slow machines so polling outlives real startup time.
- Verify the external-controller address/port is correct and not occupied; confirm the controller secret matches.
Example fix
// before
// proceed after retries silently
// after
if (!(await waitForControllerReady(30_000))) {
managerLogger.error('Core controller never became ready; aborting stream setup')
return // or restart core
} Defensive patterns
Strategy: retry
Validate before calling
const reachable = await fetch(`http://${controllerHost}:${controllerPort}`, { signal: AbortSignal.timeout(2000) }).then(r => r.ok, () => false)
if (!reachable) await restartCore() Try / catch
try {
await waitForCoreReady()
} catch {
managerLogger.warn('core readiness check failed; verifying before streaming')
if (!(await isControllerReachable())) await restartCore()
} Prevention
- Size retries*interval to exceed worst-case core startup (cold disk, AV scanning).
- Detect core process exit during polling and abort early instead of waiting out all retries.
- Log elapsed startup time to tune the constants against real machines.
When it happens
Trigger: All CORE_READY_MAX_RETRIES poll attempts throw (connection refused) because the core takes longer than retries*CORE_READY_RETRY_INTERVAL_MS to open its external-controller port, or the core failed to start entirely (bad config, port in use).
Common situations: Slow disk/AV scanning the mihomo binary on first launch; external-controller port occupied by another process; core crashing immediately due to invalid YAML so it never listens.
Related errors
- Core is still initializing
- Core PID ${proc.pid ?? 'unknown'} is still running after SIG
- Failed to copy critical file ${file}: ${result.reason}
- Login timed out
- TUN is enabled but insufficient permissions detected, auto-d
AI-assisted analysis of mihomo-party-org/clash-party@911e090537 (2026-08-30).
Data as JSON: /api/errors/525ae43ba686e353.
Report an issue: GitHub.