Bug Description
checkCommand in src/lib/clients/system.ts (lines 8-16) silently succeeds
when a required binary (e.g., docker) is not installed.
Root Cause
When a binary is missing, child_process.exec throws an error with
error.code = 'ENOENT' but error.stderr is empty or undefined.
The guard if (error.stderr) evaluates to false, so the error is
swallowed and the function resolves successfully.
Impact
SimulatorService.checkInstallRequirements() sets requirementsInstalled.docker = true
even when Docker is not installed. The subsequent docker.ping() then fails
with a cryptic error instead of a clear "Docker is not installed" message.
Steps to Reproduce
- Uninstall Docker completely
- Run
genlayer up
- Observe: CLI proceeds as if Docker is available, then crashes with
confusing errors instead of "Docker is not installed"
Expected Behavior
CLI should immediately show: "Docker is not installed. Please install Docker first."
Suggested Fix
} catch (error: any) {
if (error.code === 'ENOENT' || error.stderr) {
throw new MissingRequirementError(toolName);
}
}
Environment
- File:
src/lib/clients/system.ts lines 8-16
- Severity: Critical
- Already reported: No
Bug Description
checkCommandinsrc/lib/clients/system.ts(lines 8-16) silently succeedswhen a required binary (e.g.,
docker) is not installed.Root Cause
When a binary is missing,
child_process.execthrows an error witherror.code = 'ENOENT'buterror.stderris empty orundefined.The guard
if (error.stderr)evaluates tofalse, so the error isswallowed and the function resolves successfully.
Impact
SimulatorService.checkInstallRequirements()setsrequirementsInstalled.docker = trueeven when Docker is not installed. The subsequent
docker.ping()then failswith a cryptic error instead of a clear "Docker is not installed" message.
Steps to Reproduce
genlayer upconfusing errors instead of "Docker is not installed"
Expected Behavior
CLI should immediately show:
"Docker is not installed. Please install Docker first."Suggested Fix
Environment
src/lib/clients/system.tslines 8-16