stablyai/orca · error
[verify-packaged-daemon-entry] packaged daemon-entry.js did
Error message
[verify-packaged-daemon-entry] packaged daemon-entry.js did not reach argv parsing (expected the "Usage: daemon-entry" error). stderr:
${stderr} What it means
Thrown by the packaged daemon entry verification script when daemon-entry.js launched successfully under plain Node, loaded without MODULE_NOT_FOUND errors, but did not print the expected 'Usage: daemon-entry' usage message to stderr. The script expects that with no arguments, the entry reaches its argv parsing logic and prints a usage error. The absence of this line means the entry's argument handling changed or the process exited before reaching argv parsing.
Source
Thrown at config/scripts/verify-packaged-daemon-entry.cjs:50
// <appOutDir>/resources elsewhere). execPath defaults to the packaging Node.
function verifyPackagedDaemonEntryBoots(resourcesDir, options = {}) {
const execPath = options.execPath || process.execPath
const entryPath = assertPackagedDaemonEntryExists(resourcesDir)
const result = spawnSync(execPath, [entryPath], { encoding: 'utf8', timeout: 10_000 })
if (result.error) {
throw new Error(
`[verify-packaged-daemon-entry] could not launch daemon-entry.js: ${result.error.message}`
)
}
const stderr = result.stderr || ''
if (/Cannot find module|MODULE_NOT_FOUND/.test(stderr)) {
throw new Error(
`[verify-packaged-daemon-entry] packaged daemon-entry.js failed to load under plain Node:\n${stderr}`
)
}
if (!stderr.includes('Usage: daemon-entry')) {
throw new Error(
`[verify-packaged-daemon-entry] packaged daemon-entry.js did not reach argv parsing ` +
`(expected the "Usage: daemon-entry" error). stderr:\n${stderr}`
)
}
console.log('[verify-packaged-daemon-entry] OK — packaged daemon-entry loads under plain Node')
}
module.exports = { assertPackagedDaemonEntryExists, verifyPackagedDaemonEntryBoots }
View on GitHub (pinned to 1136503c6a)
Solutions
- Run the packaged daemon-entry.js manually under plain Node with no args and check what it prints: node <resourcesDir>/app.asar.unpacked/out/main/daemon-entry.js
- If the usage message text changed, update the assertion in verify-packaged-daemon-entry.cjs line 49 to match the new expected string.
- If the no-args behavior changed intentionally (e.g., it now starts the daemon), reconsider the verification strategy — the check assumes no-args prints usage, so either restore that contract or redesign the test.
- Ensure the entry flushes stderr before exiting; a process.exit() before stderr drain can cause the line to be missed.
Example fix
// before — daemon entry changed its usage message
// if (!stderr.includes('Usage: daemon-entry')) { ... }
//
// after — update the assertion to match the new usage string
// if (!stderr.includes('Usage: orca-daemon-entry')) { ... } Defensive patterns
Strategy: validation
Validate before calling
// Before packaging, verify the daemon entry prints its usage line under plain Node.
const { spawnSync } = require('node:child_process')
function preCheckDaemonUsage(entryPath, expectedUsage = 'Usage: daemon-entry') {
const result = spawnSync(process.execPath, [entryPath], {
encoding: 'utf8',
timeout: 10_000
})
const stderr = result.stderr || ''
if (!stderr.includes(expectedUsage)) {
return { ok: false, actual: stderr.slice(0, 200) }
}
return { ok: true }
} Prevention
- Treat the 'Usage: daemon-entry' stderr output as a stable contract: document it and add a test for it in the daemon entry's own test suite.
- When refactoring the daemon entry's argv parser, search for the usage string in the verification script and update both together.
- Avoid process.exit() before stderr drains in the no-args code path; use console.error followed by process.exit to ensure the line is captured.
When it happens
Trigger: The daemon entry's argv parsing code was refactored and the usage message text or format changed; the entry now exits with a different code path when no args are provided (e.g., it starts the daemon instead of printing usage); the entry now prints usage to stdout instead of stderr; the entry crashes silently before reaching the argv check.
Common situations: A developer changed the no-args behavior of daemon-entry.js to auto-start instead of printing usage; the usage string was reworded (e.g., 'Usage: daemon-entry' became 'Usage: orca-daemon'); the argv parser library was swapped and the new one outputs differently; stderr buffering caused the usage line to not be captured within the 10-second timeout.
Related errors
- [verify-packaged-daemon-entry] could not launch daemon-entry
- [verify-packaged-daemon-entry] packaged daemon-entry.js fail
- [plain-node-entry-guard] daemon-entry.js did not exit within
- [plain-node-entry-guard] daemon-entry.js did not reject an e
- [verify-packaged-daemon-entry] missing unpacked daemon entry
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/27366fb15980e150.
Report an issue: GitHub.