mihomo-party-org/clash-party · warning
Core process watchdog exited unexpectedly, code: ${code}, si
Error message
Core process watchdog exited unexpectedly, code: ${code}, signal: ${signal} What it means
The app spawns a helper watchdog process that monitors the core (mihomo) child process. This log line is emitted when the watchdog itself exits without being told to — an unexpected exit with a non-null exit code or signal. It means core crash auto-restart protection is degraded until the watchdog is restarted (typically on next core start).
Source
Thrown at src/main/core/manager.ts:215
const watchdogStdin = watchdogProcess.stdin as typeof watchdogProcess.stdin & {
unref?: () => void
}
watchdogStdin.unref?.()
watchdogProcess.unref()
watchdogProcess.once('error', (error) => {
if (coreProcessWatchdog?.process === watchdogProcess) {
coreProcessWatchdog = null
}
watchdogProcess.stdin.destroy()
managerLogger.warn('Failed to start core process watchdog', error)
})
watchdogProcess.once('exit', (code, signal) => {
if (coreProcessWatchdog?.process !== watchdogProcess) return
coreProcessWatchdog = null
managerLogger.warn(
`Core process watchdog exited unexpectedly, code: ${code}, signal: ${signal}`
)
})
}
function shellQuote(value: string): string {
return `'${value.replace(/'/g, "'\\''")}'`
}
function hookTouchCommand(file: string): string {
return process.platform === 'win32' ? `type nul > ${file}` : `: > ${shellQuote(file)}`
}
function coreHookDir(): string {
if (process.platform === 'win32' && process.env.ProgramData) {
return path.join(process.env.ProgramData, 'mihomo-party', 'core-hooks')
}
View on GitHub (pinned to 911e090537)
Solutions
- Check preceding manager logs for why the watchdog exited (code/signal) and fix the root cause (reinstall the app to restore binaries).
- Verify the watchdog executable exists, is executable, and is not blocked by antivirus — whitelist the app directory.
- Confirm the platform/arch matches a shipped binary; reinstall or update the app if the sidecar is missing.
- Restart the core (or the app) so startCoreProcessWatchdog spawns the watchdog again.
Example fix
// before
watchdogProcess.once('exit', (code, signal) => {
managerLogger.warn(`Core process watchdog exited unexpectedly, code: ${code}, signal: ${signal}`)
})
// after
watchdogProcess.once('exit', (code, signal) => {
managerLogger.warn(`Core process watchdog exited unexpectedly, code: ${code}, signal: ${signal}`)
scheduleWatchdogRestart() // re-spawn watchdog to restore crash protection
}) Defensive patterns
Strategy: retry
Validate before calling
// Before relying on the watchdog, verify the binary is present and executable:
import { accessSync, constants } from 'node:fs'
try {
accessSync(watchdogPath, constants.F_OK | constants.X_OK)
} catch {
console.error(`Watchdog binary missing or not executable at ${watchdogPath} — reinstall the app`)
} Try / catch
watchdogProcess.once('exit', (code, signal) => {
if (coreProcessWatchdog?.process !== watchdogProcess) return
coreProcessWatchdog = null
managerLogger.warn(`Core process watchdog exited unexpectedly, code: ${code}, signal: ${signal}`)
// retry: respawn with backoff
setTimeout(() => startCoreProcessWatchdog().catch(err => managerLogger.error('Watchdog respawn failed', err)), 5000)
}) Prevention
- Reinstall/repair the app if sidecar binaries are missing or quarantined by antivirus; whitelist the install directory.
- Match the app build to your OS/arch so a valid watchdog binary ships.
- Watch for OOM kills in system logs and provide adequate memory.
- Restart the core/app after a watchdog crash so protection is re-established.
When it happens
Trigger: Watchdog binary crashes (bug, missing/broken executable, incompatible platform binary); the OS kills it (OOM killer, resource limits); a dependent library the watchdog needs fails to load; the system shuts down the process group.
Common situations: Corrupted or quarantined sidecar binary after an update or antivirus scan; running on an OS/arch lacking a matching watchdog binary; memory pressure causing OOM kills; permission errors preventing execution.
Related errors
- Core PID ${proc.pid ?? 'unknown'} did not exit after SIGINT;
- Core is not running, restarting core before config patch
AI-assisted analysis of mihomo-party-org/clash-party@911e090537 (2026-08-30).
Data as JSON: /api/errors/6c6c1108daf231b2.
Report an issue: GitHub.