Troubleshooting¶
"Your connection is not private" (LAN HTTPS)¶
Cause: Self-signed TLS certificate not trusted by browser.
Solutions:
- Click "Advanced" > "Proceed" (quick, per-session)
- Trust CA Certificate (permanent, recommended):
- Access
http://192.168.1.50:3001/connect/trust - Download
katulong-ca.crt - Install in system keychain:
- macOS: Double-click > "Always Trust"
- Windows: Right-click > "Install Certificate" > "Trusted Root Certification Authorities"
- Linux: Copy to
/usr/local/share/ca-certificates/>sudo update-ca-certificates
- Access
LAN pairing shows passkey flow instead of QR code¶
Cause: Browser cached old JavaScript before access method detection was implemented.
Solution:
- Hard refresh:
Cmd+Shift+R(Mac) orCtrl+Shift+F5(Windows/Linux) - Clear browser cache
- Check console for errors
Verification:
curl -k https://192.168.1.50:3002/auth/status
# Should return: {"setup": true, "accessMethod": "lan"}
WebSocket connection rejected¶
Common Causes:
-
Missing Session Cookie:
- Verify
katulong_sessioncookie exists in DevTools > Application > Cookies - Re-authenticate if expired
- Verify
-
Origin Mismatch:
- Check Origin header in DevTools > Network > WebSocket request
- Origin must match Host header (e.g., both
katulong.local:3002)
-
Credential Revoked:
- Check if device was removed from Settings > LAN or Remote
- Re-pair or re-register passkey
Debug Logs:
# Server logs show rejection reason
tail -f /tmp/server.log | grep WebSocket
# Example: "WebSocket rejected: not authenticated"
P2P DataChannel not connecting¶
Cause: Firewall blocking WebRTC traffic or STUN server unreachable.
Fallback: Katulong automatically falls back to WebSocket if P2P fails.
Verify:
- DevTools > Console: Look for "P2P DataChannel connected" or "Using WebSocket fallback"
- Terminal still works (just higher latency via WebSocket)
- WebSocket fallback adds ~20-50ms latency, still fully functional
"Setup token required" but I'm on localhost¶
Cause: Access method detected as "internet" instead of "localhost".
Common Scenarios:
-
Reverse Proxy / Tunnel: Host header doesn't match localhost patterns
- Solution: Access directly via
http://localhost:3001
- Solution: Access directly via
-
Docker / VM: Container may expose ports, but Host header is still
localhost- Verify with
curl localhost:3001/auth/status
- Verify with
Verification:
curl http://localhost:3001/auth/status
# Should return: {"setup": false} or {"setup": true, "accessMethod": "localhost"}
Session expired immediately after login¶
Causes:
- System Clock Skew: Server and client clocks out of sync
- Cookie Scope: Cookie domain doesn't match request domain
Solution:
- Verify system time:
date - Check cookie domain matches URL
- Clear cookies and re-authenticate
Cannot pair device on LAN (PIN rejected)¶
Common Mistakes:
- PIN Expired (30 seconds): Generate new pairing code
- Wrong PIN: Double-check 8-digit PIN on authenticated device
- Code Already Used: Pairing codes are single-use, generate new code
Debug:
# Server logs show pairing attempts
tail -f /tmp/server.log | grep pair
# Example: "Pairing failed: invalid PIN"
SSH connection refused¶
Causes:
-
SSH Server Not Running:
-
Firewall Blocking Port 2222:
-
Wrong Password: SSH password is
SSH_PASSWORDenv var orSETUP_TOKENenv var
Solution: