Skip to content

Fix Windows error when setup port 8788 is already in use - #4

Closed
donvito wants to merge 1 commit into
mainfrom
melvin/fix-wizard-port-in-use-5dff
Closed

Fix Windows error when setup port 8788 is already in use#4
donvito wants to merge 1 commit into
mainfrom
melvin/fix-wizard-port-in-use-5dff

Conversation

@donvito

@donvito donvito commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Problem

On Windows, starting GAIA Personal Setup while another instance (or anything else) already owns 127.0.0.1:8788 failed with:

Error: listen tcp 127.0.0.1:8788: bind: Only one usage of each socket address ...

The message was also printed twice (cobra + our wrapper), which made a double-click launch look more broken than it was. Most often this happens when the user opens Setup a second time while the first window is still open.

Fix

  • Probe /api/health before binding. If GAIA is already running, reopen the dashboard in the browser and exit cleanly instead of failing.
  • If the port is busy with a non-GAIA process, return a clear, actionable error (open URL / close other window / use --addr).
  • Bind before printing the “keep this window open” banner so failures are not preceded by success-looking text.
  • Set SilenceErrors so “Error:” is only printed once.

Test plan

  • go test ./...
  • go vet ./...
  • Manual: second wizard against a live GAIA listener → “Setup is already running” + exit 0
  • Manual: foreign listener on same port → helpful port-busy error (single Error line)
Open in Web Open in Cursor 

When a second GAIA Personal Setup window is opened, reopen the existing
dashboard instead of failing with a cryptic bind error. Also silence
duplicate cobra Error lines and print actionable guidance if another
program owns the port.

Co-authored-by: Melvin Vivas <melvindave@gmail.com>
@donvito donvito closed this Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants