Connection Issues
”Connection refused” error
If you’re seeing a connection refused error when the CLI tries to connect to the hub: Check if the hub is running:If the hub is running on a different machine, make sure
HAPI_API_URL points to the correct host and port.”Invalid token” error
Authentication failed when connecting to the hub: Re-run authentication:~/.hapi/settings.json has correct cliApiToken:
If the file is missing or corrupted, the hub will regenerate it on next start.
Relay connectivity issues
If you’re usinghapi hub --relay and experiencing connectivity problems:
Force TCP mode:
Self-signed certificate errors
If you see “self signed certificate” errors when using HTTPS: Best solution: Use a publicly trusted certificateSession Issues
Runner won’t start
If the runner daemon fails to start: Check runner status:Sessions not appearing in web app
Verify the hub is running:/api/events.
Server-Sent Events (SSE) provide real-time updates to the web app. If SSE fails, sessions won’t update in real-time.
Agent Issues
Claude Code not found
HAPI can’t locate the Claude Code CLI: Install Claude Code:Cursor Agent not found
HAPI can’t locate the Cursor Agent CLI: Install Cursor Agent CLI:agent is on your PATH:
Other agents not found
For Codex:Hub Startup Issues
Port already in use
If port 3006 is already taken: Check what’s using the port:Database issues
If the database becomes corrupted: Backup and reset:Telegram Issues
Bot not responding
Verify bot token is correct:Telegram Mini Apps require HTTPS - they won’t work with plain HTTP URLs.
Can’t bind Telegram account
Ensure you’re using the correct token: The token you enter in the Telegram Mini App must match yourCLI_API_TOKEN.
Check hub logs:
Diagnostics
Run full diagnostics
HAPI includes a built-in diagnostics tool:- Hub connectivity
- Token validity
- Agent availability
- Runner status
- Recent logs
- Active processes
Clean up runaway processes
If you have stuck HAPI processes:Notification Issues
PWA push notifications not working
Enable notifications in browser: Check your browser settings and allow notifications for the HAPI web app. Re-subscribe to push: In the web app, go to Settings and toggle notifications off, then on again. Check VAPID configuration:Telegram notifications not arriving
Verify Telegram notifications are enabled:Performance Issues
Slow terminal response
Check network latency:- Tailscale for peer-to-peer connections
- Self-hosted on local network
- Cloudflare Tunnel with nearby data center
High CPU usage
Check runner sessions:Still Having Issues?
If you’ve tried the above solutions and still experiencing problems:GitHub Issues
Report bugs and get help from the community
Telegram Group
Join the discussion and ask questions
- Output from
hapi doctor - Relevant error messages
- HAPI version (
hapi --version) - Operating system and version
- Steps to reproduce the issue