Repository navigation
genlayer up --headless stalls indefinitely at Checking CLI version... #418
Description
Activity
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:upcallscheckCliVersion()(src/commands/general/start.ts:28, andinitatsrc/commands/general/init.ts:57), which awaitsupdate-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, TypeErroronerr.coderegistry returns 5xx Error: Request failed with code 500proxy returns HTML with 200 SyntaxError: Unexpected token '<'empty cache file from an interrupted run SyntaxError: Unexpected end of JSON inputhealthy registry (control) resolves in ~40ms, no warning printed There is a second, separate effect: when the request times out,
update-checkcallsreject()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 makecheckCliVersion()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 runpre-commit run --all-filesplus the full suite.Assigning to myself unless someone else is already on it.
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 stallup/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 theerr.codeaccess lives upstream inupdate-check.
Environment: Windows 11, Docker Desktop (context
desktop-linux, confirmed healthy), WSL2docker-desktopdistro confirmedRunning.Command:
genlayer up --headlessResult: Process spawns
docker compose -p genlayer up -dand stays alive but idle — no containers created, nogenlayerproject appears indocker compose ls, no network connection associated with the process, port127.0.0.1:4000never opens. Output never advances pastChecking CLI version....Ruled out before filing: npm registry connectivity (confirmed working), GitHub API rate limiting (
x-ratelimit-remaining: 58at 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.