Summary
On a root-owned global npm install (distro Node, sudo npm install -g @egchq/egc), the dashboard dies silently on first launch: egc init prints EGC Dashboard starting at http://localhost:7890, the detached process exits immediately, and the port refuses connections. No error is shown anywhere.
Root cause (confirmed in the field)
Two stacked problems:
- Silent by design on the init/install path:
scripts/lib/dashboard-launch.js spawns scripts/dashboard.js detached with stdio: 'ignore' and prints the success line before knowing whether the server survived, so any startup failure is invisible. The CLI path (scripts/dashboard.js start) does have a 3 second readiness check; the init/install path has none.
- First-launch dependency install inside a root-owned directory:
scripts/dashboard.js start runs npm install inside the installed package's dashboard/ directory when dashboard/node_modules is missing. On a root-owned prefix that fails with EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@egchq/egc/dashboard/node_modules'.
Same class of problem as the npm link note fixed in #1231: a step that assumes the package directory is writable.
Evidence
Reported and reproduced by @rathaur-ankit in #1218 (Ubuntu 26.04 LTS, distro Node 22 with npm 9, zsh, sudo npm install -g): initial report, follow-up after egc init, and a foreground run confirming the EACCES with a screenshot. See the thread from #1218 (comment) onward.
Scope note
The dashboard component is under an active architecture decision (rework vs replace), so the fix direction for problem 2 is intentionally left open here. Problem 1 (announcing success with no readiness check on the init/install path) is worth fixing regardless of that decision.
Credit
Found, reproduced and diagnosed in the field by @rathaur-ankit.
Summary
On a root-owned global npm install (distro Node,
sudo npm install -g @egchq/egc), the dashboard dies silently on first launch:egc initprintsEGC Dashboard starting at http://localhost:7890, the detached process exits immediately, and the port refuses connections. No error is shown anywhere.Root cause (confirmed in the field)
Two stacked problems:
scripts/lib/dashboard-launch.jsspawnsscripts/dashboard.jsdetached withstdio: 'ignore'and prints the success line before knowing whether the server survived, so any startup failure is invisible. The CLI path (scripts/dashboard.js start) does have a 3 second readiness check; the init/install path has none.scripts/dashboard.js startrunsnpm installinside the installed package'sdashboard/directory whendashboard/node_modulesis missing. On a root-owned prefix that fails withEACCES: permission denied, mkdir '/usr/local/lib/node_modules/@egchq/egc/dashboard/node_modules'.Same class of problem as the npm link note fixed in #1231: a step that assumes the package directory is writable.
Evidence
Reported and reproduced by @rathaur-ankit in #1218 (Ubuntu 26.04 LTS, distro Node 22 with npm 9, zsh,
sudo npm install -g): initial report, follow-up afteregc init, and a foreground run confirming the EACCES with a screenshot. See the thread from #1218 (comment) onward.Scope note
The dashboard component is under an active architecture decision (rework vs replace), so the fix direction for problem 2 is intentionally left open here. Problem 1 (announcing success with no readiness check on the init/install path) is worth fixing regardless of that decision.
Credit
Found, reproduced and diagnosed in the field by @rathaur-ankit.