Skip to content

genlayer up --headless stalls indefinitely at Checking CLI version... #418

Description

@Snehal707

Environment: Windows 11, Docker Desktop (context desktop-linux, confirmed healthy), WSL2 docker-desktop distro confirmed Running.

Command: genlayer up --headless

Result: Process spawns docker compose -p genlayer up -d and stays alive but idle — no containers created, no genlayer project appears in docker compose ls, no network connection associated with the process, port 127.0.0.1:4000 never opens. Output never advances past Checking CLI version....

Ruled out before filing: npm registry connectivity (confirmed working), GitHub API rate limiting (x-ratelimit-remaining: 58 at time of test), stale CLI lock/PID files (none found under %USERPROFILE%\.genlayer), orphaned child processes from a prior killed attempt (none found), Docker context/WSL2 health (confirmed healthy on both).

Possibly related to a JSON-RPC startup issue also seen with the local Studio stack, filed separately — both may share a root cause in local image/version resolution, though this isn’t confirmed.

Happy to share full logs on request.

Activity

  1. HusseinAdeiza commented on Sep 27, 2026

    @HusseinAdeiza

    I'd like to work on this.

    I reproduced it end to end on v0.40-dev. The stall is in the very first step, before Docker is ever consulted: up calls checkCliVersion() (src/commands/general/start.ts:28, and init at src/commands/general/init.ts:57), which awaits update-check. That helper does an unauthenticated HTTPS GET to the npm registry and the call site has no try/catch and no deadline, so any registry trouble takes down the whole command:

    $ node dist/index.js up --headless
    - Checking CLI version...
    TypeError: Cannot read properties of undefined (reading 'code')
        at getMostRecent (node_modules/update-check/index.js:125:11)
        at async SimulatorService.checkCliVersion (dist/index.js:59025:20)
        at async StartAction.execute (dist/index.js:59385:5)
    

    Failing modes I confirmed against update-check@1.5.4:

    condition result
    registry unreachable / blackholed rejects after ~2s, TypeError on err.code
    registry returns 5xx Error: Request failed with code 500
    proxy returns HTML with 200 SyntaxError: Unexpected token '<'
    empty cache file from an interrupted run SyntaxError: Unexpected end of JSON input
    healthy registry (control) resolves in ~40ms, no warning printed

    There is a second, separate effect: when the request times out, update-check calls reject() without destroying the socket, so the event loop never drains. The promise settles but the process stays alive and idle, which matches the reported symptom more closely than the crash above.

    A cosmetic "a new version is available" warning should never be able to block or abort up. My plan is to make checkCliVersion() best-effort: bound it with a short timeout, swallow registry errors, and keep the warning when the check does succeed. I'll add regression tests for each row in that table and run pre-commit run --all-files plus the full suite.

    Assigning to myself unless someone else is already on it.

  2. HusseinAdeiza commented on Sep 27, 2026

    @HusseinAdeiza

    PR opened: #422 (targets v0.40-dev, per the branch model in CONTRIBUTING.md).

    Summary of the change: checkCliVersion() now races the registry request against a 2s deadline and swallows rejections, so the upgrade notice can no longer abort or stall up/init. Six regression tests cover the failure modes I measured (blackholed registry, 5xx, HTML-from-proxy with 200, truncated cache file, never-responding registry) plus a control that the warning still prints.

    The commit is SSH-signed with HusseinAdeiza@users.noreply.github.com. Leaving this here rather than closing the issue, since the root cause of the socket leak and the err.code access lives upstream in update-check.

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