Description
When running spacetime start on Windows (native, not WSL), the command fails to start if WSL has previously forwarded the same port. This happens because WSL's automatic port forwarding can hold onto port 3000 even after the WSL session ends, blocking the native Windows spacetime process.
Steps to Reproduce
- Install SpacetimeDB CLI on Windows using the PowerShell installer
- Previously run any WSL2 service that used port 3000 (or have WSL auto-forward enabled)
- Run
spacetime start from PowerShell or Git Bash
- Observe the error:
Error: failed to bind to 0.0.0.0:3000
Expected Behavior
spacetime start should either:
- Detect the port conflict and suggest an alternative port
- Provide a clearer error message mentioning WSL port forwarding as a potential cause
- Support a
--port flag to specify an alternative port directly
Actual Behavior
The CLI exits with a generic bind error that doesn't help diagnose the WSL-specific issue.
Environment
- OS: Windows 11
- SpacetimeDB CLI version: 2.0.5
- WSL version: WSL 2 (Ubuntu 24.04)
Workaround
# Kill WSL processes holding the port
wsl --shutdown
# Or manually kill the specific port forwarding
netsh interface portproxy delete v4tov4 listenport=3000 listenaddress=0.0.0.0
Description
When running
spacetime starton Windows (native, not WSL), the command fails to start if WSL has previously forwarded the same port. This happens because WSL's automatic port forwarding can hold onto port 3000 even after the WSL session ends, blocking the native Windowsspacetimeprocess.Steps to Reproduce
spacetime startfrom PowerShell or Git BashError: failed to bind to 0.0.0.0:3000Expected Behavior
spacetime startshould either:--portflag to specify an alternative port directlyActual Behavior
The CLI exits with a generic bind error that doesn't help diagnose the WSL-specific issue.
Environment
Workaround