Skip to content

[Bug] check Command silently succeeds when required tool is missing false positive in dependency check #301

@zakaziko86

Description

@zakaziko86

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

  1. Uninstall Docker completely
  2. Run genlayer up
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions