WASM islands: fix socket routing through hero_proxy (502 errors) #63

Closed
opened 2026-03-20 03:20:40 +00:00 by mik-tf · 2 comments
Owner

Problem

Multiple WASM islands show "HTTP 502: Cannot connect to backend socket" or blank pages. The islands make HTTP requests through hero_proxy_ui to backend services, but the socket paths don't match.

Affected tabs

Tab Error Expected socket
Intelligence (AI) 502 backend socket hero_aibroker_server.sock
Communication 502 socket not found ?
Books blank hero_books_server.sock
Admin → Foundry blank hero_foundry_server.sock
Admin → Redis broken hero_redis_server.sock (Redis protocol — no HTTP admin UI)

Root cause

WASM islands request paths like /hero_aibroker/, /hero_books/ etc. through hero_proxy_ui. The proxy strips the prefix and looks for hero_aibroker.sock, hero_books.sock etc. But the actual sockets are named hero_aibroker_server.sock, hero_books_server.sock.

The entrypoint.sh creates some symlinks (hero_foundry, hero_osis, hero_indexer) but not all needed aliases.

Fix

  1. Audit which proxy paths each WASM island requests (check hero_os_app config + island source)
  2. Add missing socket symlinks in entrypoint.sh
  3. Or fix the WASM islands to use the correct paths

Working sections (for reference)

Inspector, Proxy, Foundry UI, Embedder — these are embedded JS dashboards in server binaries, not WASM islands, so they don't go through the proxy socket routing.

## Problem Multiple WASM islands show "HTTP 502: Cannot connect to backend socket" or blank pages. The islands make HTTP requests through hero_proxy_ui to backend services, but the socket paths don't match. ## Affected tabs | Tab | Error | Expected socket | |-----|-------|-----------------| | Intelligence (AI) | 502 backend socket | hero_aibroker_server.sock | | Communication | 502 socket not found | ? | | Books | blank | hero_books_server.sock | | Admin → Foundry | blank | hero_foundry_server.sock | | Admin → Redis | broken | hero_redis_server.sock (Redis protocol — no HTTP admin UI) | ## Root cause WASM islands request paths like `/hero_aibroker/`, `/hero_books/` etc. through hero_proxy_ui. The proxy strips the prefix and looks for `hero_aibroker.sock`, `hero_books.sock` etc. But the actual sockets are named `hero_aibroker_server.sock`, `hero_books_server.sock`. The entrypoint.sh creates some symlinks (hero_foundry, hero_osis, hero_indexer) but not all needed aliases. ## Fix 1. Audit which proxy paths each WASM island requests (check hero_os_app config + island source) 2. Add missing socket symlinks in entrypoint.sh 3. Or fix the WASM islands to use the correct paths ## Working sections (for reference) Inspector, Proxy, Foundry UI, Embedder — these are embedded JS dashboards in server binaries, not WASM islands, so they don't go through the proxy socket routing.
Author
Owner

Additional finding: Books sub-navigation blank

Hero Books main page loads correctly (4 libraries, 40 books). But clicking "Enter library" on any library card causes the page to go blank — only the "Books" title and dock remain.

This is a client-side routing issue within the Books WASM island — the sub-route (library detail view) fails to render. The backend is healthy (/hero_books_server/health returns 200, status: degraded because embedder is not connected).

Signed-off-by: mik-tf

## Additional finding: Books sub-navigation blank Hero Books main page loads correctly (4 libraries, 40 books). But clicking "Enter library" on any library card causes the page to go blank — only the "Books" title and dock remain. This is a client-side routing issue within the Books WASM island — the sub-route (library detail view) fails to render. The backend is healthy (`/hero_books_server/health` returns 200, status: degraded because embedder is not connected). Signed-off-by: mik-tf
Author
Owner

Done

Fixed all WASM socket routing 502/404 errors. Every service now routes correctly through hero_proxy.

Fixes

Service Problem Fix
hero_aibroker Not in profile, wrong binary name, no UI Added to user.toml (server+ui), fixed binary name, added serve subcommand, symlink hero_aibroker.sock → hero_aibroker_ui.sock
hero_auth_ui No separate UI socket Symlink hero_auth_ui.sock → hero_auth_server.sock
hero_foundry_ui Socat bridge to dead TCP:8654 Replaced with symlink hero_foundry_ui.sock → hero_foundry_admin.sock
hero_shrimp bun run in TOML, not in profile Fixed to compiled binary, added to user.toml, restored socat bridge (TCP:3131)
hero_biz Not in profile Added to user.toml
hero_voice Binary failed to build — missing hero_service dep Added dependency to workspace + crate Cargo.toml

Files changed

  • hero_services: entrypoint.sh, user.toml, hero_aibroker.toml, hero_shrimp.toml, cargo-server-patches.toml
  • hero_voice: Cargo.toml, crates/hero_voice/Cargo.toml

Verification

  • make smoke: 55 passed, 0 failed — all proxy routes return 200
  • All socat bridges working (Foundry UI, Shrimp, Biz)

Commits:

  • hero_services: 82cca10
  • hero_voice: e8aa93c

Signed-off-by: mik-tf

## Done Fixed all WASM socket routing 502/404 errors. Every service now routes correctly through hero_proxy. ### Fixes | Service | Problem | Fix | |---------|---------|-----| | hero_aibroker | Not in profile, wrong binary name, no UI | Added to user.toml (server+ui), fixed binary name, added `serve` subcommand, symlink `hero_aibroker.sock → hero_aibroker_ui.sock` | | hero_auth_ui | No separate UI socket | Symlink `hero_auth_ui.sock → hero_auth_server.sock` | | hero_foundry_ui | Socat bridge to dead TCP:8654 | Replaced with symlink `hero_foundry_ui.sock → hero_foundry_admin.sock` | | hero_shrimp | `bun run` in TOML, not in profile | Fixed to compiled binary, added to user.toml, restored socat bridge (TCP:3131) | | hero_biz | Not in profile | Added to user.toml | | hero_voice | Binary failed to build — missing hero_service dep | Added dependency to workspace + crate Cargo.toml | ### Files changed - hero_services: entrypoint.sh, user.toml, hero_aibroker.toml, hero_shrimp.toml, cargo-server-patches.toml - hero_voice: Cargo.toml, crates/hero_voice/Cargo.toml ### Verification - `make smoke`: 55 passed, 0 failed — all proxy routes return 200 - All socat bridges working (Foundry UI, Shrimp, Biz) Commits: - hero_services: 82cca10 - hero_voice: e8aa93c Signed-off-by: mik-tf
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/home#63
No description provided.