Skip to content

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

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){thrownewMissingRequirementError(toolName);}}

Environment

  • File: src/lib/clients/system.ts lines 8-16
  • Severity: Critical
  • Already reported: No

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions