{"record":{"id":"d0e1e93898e3ed33","repo":"stablyai/orca","slug":"plain-node-entry-guard-daemon-entry-js-was-kille","errorCode":null,"errorMessage":"[plain-node-entry-guard] daemon-entry.js was killed by ${result.signal} under plain Node.","messagePattern":"\\[plain-node-entry-guard\\] daemon-entry\\.js was killed by (.+?) under plain Node\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/build-plugins/plain-node-entry-guard.ts","lineNumber":208,"sourceCode":"async function smokeLoadDaemonEntry(outputDir: string, timings: SmokeTimings): Promise<void> {\n  const entryPath = join(outputDir, 'daemon-entry.js')\n  const result = await runDaemonEntry(entryPath, timings)\n  if (result.error) {\n    throw new Error(\n      `[plain-node-entry-guard] could not smoke-load daemon-entry.js under plain Node: ` +\n        `${result.error.message}`\n    )\n  }\n  // Almost always means the daemon stopped rejecting an empty argv and started\n  // listening instead.\n  if (result.timedOut) {\n    throw new Error(\n      `[plain-node-entry-guard] daemon-entry.js did not exit within ${timings.timeoutMs}ms on an ` +\n        `empty argv under plain Node, so the smoke killed it.`\n    )\n  }\n  if (result.signal) {\n    throw new Error(\n      `[plain-node-entry-guard] daemon-entry.js was killed by ${result.signal} under plain Node.`\n    )\n  }\n  const stderr = result.stderr\n  if (/Cannot find module|MODULE_NOT_FOUND/.test(stderr)) {\n    throw new Error(\n      `[plain-node-entry-guard] daemon-entry.js failed to load under plain Node:\\n${stderr}`\n    )\n  }\n  if (result.status === 0 || !stderr.includes(DAEMON_USAGE_PREFIX)) {\n    throw new Error(\n      `[plain-node-entry-guard] daemon-entry.js did not reject an empty argv under plain Node ` +\n        `(expected a non-zero exit and the \"${DAEMON_USAGE_PREFIX}\" error, got exit ` +\n        `${result.status}). stderr:\\n${stderr}`\n    )\n  }\n}\n","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/build-plugins/plain-node-entry-guard.ts#L190-L226","documentation":"The smoke-loaded daemon-entry.js process was terminated by an OS signal (result.signal is non-null), but the spawn itself did not error and the process did not time out (those cases are checked first at lines 193 and 201). This means an external force killed the process — e.g., an OOM killer, a CI runner resource cull, or a manual kill — rather than a controlled exit or the plugin's own timeout mechanism.","triggerScenarios":"The Node process running daemon-entry.js was killed by SIGKILL (OOM killer on memory-constrained CI runners), SIGTERM (container orchestration), or another external signal. Since the plugin's own timeout path (line 201) is checked first, this fires only when the signal arrives from outside the plugin's timeout escalation.","commonSituations":"CI runners with tight memory limits where daemon-entry.js's module graph (including native modules) exceeds the cgroup limit. Containerized build environments with aggressive OOM policies. Concurrent builds competing for resources.","solutions":["Check the signal name in the error — SIGKILL typically means OOM; check `dmesg` or CI runner logs for OOM killer activity.","Increase available memory for the build runner, or reduce concurrency so the smoke test has headroom.","If the signal is reproducible only on specific runners, profile daemon-entry.js memory usage at startup to identify a memory regression in the module graph."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check available memory before running the smoke test on CI\nimport { freemem, totalmem } from 'os'\nfunction assertSufficientMemoryForSmoke() {\n  const freeMB = freemem() / 1024 / 1024\n  if (freeMB < 512) {\n    console.warn(`Low memory (${freeMB}MB free) — smoke test may be OOM-killed`)\n  }\n}","typeGuard":null,"tryCatchPattern":"// Distinguish OOM from real failures\ntry {\n  await smokeLoadDaemonEntry(outputDir, timings)\n} catch (error) {\n  if (error.message.includes('killed by SIGKILL')) {\n    console.error('Likely OOM — check CI runner memory limits')\n  }\n  throw error\n}","preventionTips":["Ensure CI runners have sufficient memory for the daemon smoke test (the module graph includes native modules).","Avoid running multiple memory-intensive builds concurrently on the same runner.","Monitor CI for intermittent SIGKILL failures which indicate resource pressure."],"tags":["build-config","smoke-test","daemon","signal","oom","ci"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}