ERROR: wait_tcp_port: port 9999 did not respond within 10s #43

Closed
opened 2026-04-12 12:50:51 +00:00 by casper-stevens · 2 comments
Member

➜ hero_proc git:(development) ✗ make run
source /Users/casperstevens/hero_proc/scripts/build_lib.sh 2>/dev/null && cargo_env && cargo build --release --workspace --exclude hero_proc_integration_test --exclude hero_proc_integration_tests
Finished release profile [optimized] target(s) in 0.49s
Installed hero_proc -> /Users/casperstevens/hero/bin/hero_proc
Installed hero_proc_server -> /Users/casperstevens/hero/bin/hero_proc_server
Installed hero_proc_ui -> /Users/casperstevens/hero/bin/hero_proc_ui
No screen session found.
No screen session found.
✓ Services stopped
✓ Directories ready, stale state cleared
Starting hero_proc_server...
✓ Screen session 'hero_proc_server' started
Waiting for hero_proc_server health (max 60s)...
✓ Health check passed: /Users/casperstevens/hero_proc/target/release/hero_proc
Starting hero_proc_ui...
✓ Screen session 'hero_proc_ui' started
Waiting for hero_proc_ui socket (max 30s)...
✓ Unix socket ready: /Users/casperstevens/hero/var/sockets/hero_proc/ui.sock
No screen session found.
✓ Screen session 'hero_proc_ui_nc' started
✓ nc bridge started: TCP 127.0.0.1:9999 → /Users/casperstevens/hero/var/sockets/hero_proc/ui.sock (tool=ncat, session=hero_proc_ui_nc)
ERROR: wait_tcp_port: port 9999 did not respond within 10s
make: *** [run] Error 1

➜ hero_proc git:(development) ✗ make run source /Users/casperstevens/hero_proc/scripts/build_lib.sh 2>/dev/null && cargo_env && cargo build --release --workspace --exclude hero_proc_integration_test --exclude hero_proc_integration_tests Finished `release` profile [optimized] target(s) in 0.49s Installed hero_proc -> /Users/casperstevens/hero/bin/hero_proc Installed hero_proc_server -> /Users/casperstevens/hero/bin/hero_proc_server Installed hero_proc_ui -> /Users/casperstevens/hero/bin/hero_proc_ui No screen session found. No screen session found. ✓ Services stopped ✓ Directories ready, stale state cleared Starting hero_proc_server... ✓ Screen session 'hero_proc_server' started Waiting for hero_proc_server health (max 60s)... ✓ Health check passed: /Users/casperstevens/hero_proc/target/release/hero_proc Starting hero_proc_ui... ✓ Screen session 'hero_proc_ui' started Waiting for hero_proc_ui socket (max 30s)... ✓ Unix socket ready: /Users/casperstevens/hero/var/sockets/hero_proc/ui.sock No screen session found. ✓ Screen session 'hero_proc_ui_nc' started ✓ nc bridge started: TCP 127.0.0.1:9999 → /Users/casperstevens/hero/var/sockets/hero_proc/ui.sock (tool=ncat, session=hero_proc_ui_nc) ERROR: wait_tcp_port: port 9999 did not respond within 10s make: *** [run] Error 1
Owner

Root Cause

The nc_detect() function in build_lib.sh prefers ncat over socat. The ncat command used for the TCP→Unix socket bridge was:

ncat -l 127.0.0.1 9999 --keep-open -U /path/to/sock

This is broken — ncat's -U flag means "use Unix domain socket mode", which overrides the TCP listen. So ncat either tries to listen on the Unix socket (ignoring TCP) or exits silently. Nothing ever listens on TCP port 9999, and wait_tcp_port times out.

It worked on some machines because they only had socat installed (no ncat), so nc_detect() fell through to socat, which handles TCP→Unix proxying natively.

Fix (in development)

  1. Prefer socat over ncat in nc_detect() and nc_install() — socat natively supports TCP-LISTEN:...,fork UNIX-CLIENT:...
  2. Fix the ncat fallback to use per-connection exec: ncat -l 127.0.0.1 $port --keep-open -c 'ncat -U $sock'
  3. Install recommendation changed to brew install socat on macOS

Workaround (immediate)

brew install socat

If you already have ncat installed, socat will now be preferred automatically once the fix lands.

## Root Cause The `nc_detect()` function in `build_lib.sh` prefers **ncat** over **socat**. The ncat command used for the TCP→Unix socket bridge was: ```bash ncat -l 127.0.0.1 9999 --keep-open -U /path/to/sock ``` This is broken — ncat's `-U` flag means "use Unix domain socket mode", which **overrides** the TCP listen. So ncat either tries to listen on the Unix socket (ignoring TCP) or exits silently. Nothing ever listens on TCP port 9999, and `wait_tcp_port` times out. It worked on some machines because they only had **socat** installed (no ncat), so `nc_detect()` fell through to socat, which handles TCP→Unix proxying natively. ## Fix (in development) 1. **Prefer socat over ncat** in `nc_detect()` and `nc_install()` — socat natively supports `TCP-LISTEN:...,fork UNIX-CLIENT:...` 2. **Fix the ncat fallback** to use per-connection exec: `ncat -l 127.0.0.1 $port --keep-open -c 'ncat -U $sock'` 3. **Install recommendation changed** to `brew install socat` on macOS ## Workaround (immediate) ```bash brew install socat ``` If you already have ncat installed, socat will now be preferred automatically once the fix lands.
Owner

Fix pushed in commit 069ffe9 on development.

Changes:

  • nc_detect() / nc_install() now prefer socat over ncat
  • ncat fallback fixed to use ncat -l ... --keep-open -c 'ncat -U $sock'
  • Install recommendation changed to brew install socat on macOS

Please pull development and re-run make run. If you don't have socat yet: brew install socat

Fix pushed in commit `069ffe9` on `development`. **Changes:** - `nc_detect()` / `nc_install()` now prefer **socat** over ncat - ncat fallback fixed to use `ncat -l ... --keep-open -c 'ncat -U $sock'` - Install recommendation changed to `brew install socat` on macOS Please pull `development` and re-run `make run`. If you don't have socat yet: `brew install socat`
timur closed this issue 2026-04-12 13:07:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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/hero_proc#43
No description provided.