docs: update DEPLOYMENT-BUGS.md - TM-4 root cause was install timeout, not missing deps

This commit is contained in:
Tabula Myriad
2026-03-24 04:24:58 -04:00
parent d47988801a
commit 5a8491472a
+26 -14
View File
@@ -119,32 +119,44 @@ cd /home/openclaw/.openclaw/workspace && node dist/entry.mjs gateway
---
## Bug 4: Workspace Build Missing Transitive Dependencies
## Bug 4: Workspace `pnpm install` Timeout / Crash
**Severity:** High
**Affected:** TM-4 (blocked), any fresh clone
**Affected:** TM-4 (blocked), fresh clones
### Symptom
Gateway fails with cascading `ERR_MODULE_NOT_FOUND` errors for packages like `grammy`, `@grammyjs/transformer-throttler`, `@buape/carbon`, `discord-api-types`, etc.
Gateway fails with cascading `ERR_MODULE_NOT_FOUND` errors for packages like `grammy`, `@grammyjs/transformer-throttler`, `@buape/carbon`, `discord-api-types`.
### Root Cause
The workspace `package.json` does NOT declare all packages that the built `dist/chunks/` import. Many packages (`discord-api-types`, `@buape/carbon`, `@grammyjs/transformer-throttler`, etc.) are transitive dependencies of packages that ARE listed, but npm's install doesn't reliably hoist everything needed.
`pnpm install` on TM-4 repeatedly hung and crashed (SSH session timeout/kill). `npm install` was used as fallback but leaves package gaps because it doesn't resolve pnpm lockfile correctly. Each missing package causes a cascading load failure.
When using `pnpm`, the installation hangs (possibly due to network or lockfile issues). `npm ci` installs but leaves gaps. Each missing package causes a cascading failure.
### TM-4 Current State
- Git synced to `7f9cda56ce`
- `pnpm install` attempted — SSH session hung/froze the machine
- Workspace is in an inconsistent state
**NOTE:** Analysis of the chunk imports showed that ALL packages chunks import ARE present at the workspace `node_modules/` root — the cascade was caused by install interruption, not missing declarations.
### Fix Required
1. Fix the build system so that all imported packages are declared as dependencies in `package.json`
2. OR configure the bundler (tsdown/rolldown) to bundle all imports inline rather than leaving them as external
3. OR ensure `pnpm install` completes successfully before gateway start
1. Keep `pnpm install` — it's correct for this monorepo. Use `nohup pnpm install` to prevent SSH timeout killing the process.
2. Ensure `pnpm install` completes before running `pnpm build`.
3. Commit `d47988801a` adds `discord-api-types` to workspace root `package.json` to guarantee pnpm hoists it.
4. Future work: configure pnpm `publicHoistPattern` to ensure extension-bundled packages are also accessible at root level.
### Recovery Steps (TM-4)
```bash
ssh root@192.168.31.205
# Kill any hung processes
pkill -f npm; pkill -f pnpm
cd /home/openclaw/.openclaw/workspace
nohup pnpm install > /tmp/pnpm-install.log 2>&1 &
# Wait for completion (~2-5 min), then check:
tail -5 /tmp/pnpm-install.log
ls node_modules/discord-api-types && echo "OK"
pnpm build
# Apply dist/package.json fix (handled by build from commit d47988801a onward):
# node scripts/write-dist-package-json.mjs
cd /home/openclaw/.openclaw/workspace && node dist/entry.mjs gateway
```
---