# Remote Desktop & Dashboard Troubleshooting

## Common Issues & Fixes

### 1. "Session Expired" or Connection Refused
**Cause:** The Gateway or Dashboard is not bound to the network interface, or the session state is stale.
**Fix:** 
- Ensure both services are bound to `0.0.0.0` using the `--host 0.0.0.0 --insecure` flags.
- Restart the Gateway to clear stale sessions: `hermes gateway restart`.

### 2. Port Conflicts (Address already in use)
**Cause:** A ghost process or a previous instance is still holding port 9119 (Dashboard) or 8642 (Gateway).
**Fix:**
- Identify and kill the process: `fuser -k 9119/tcp` or `fuser -k 8642/tcp`.
- Restart the service.

### 3. Service Not Starting (D-Bus / Systemd Scope)
**Cause:** `systemctl --user` commands fail because the D-Bus session is not active in the current terminal.
**Fix:**
- Use `nohup` to start services in the background:
  `nohup /home/rurouni/.hermes/hermes-agent/venv/bin/python -m hermes_cli.main dashboard --port 9119 --host 0.0.0.0 --insecure > /home/rurouni/.hermes/dashboard.log 2>&1 &`
- Use `loginctl enable-linger rurouni` to ensure user services persist after logout.

### 4. Remote Access via Tailscale
**Requirement:** Always use the `--insecure` flag when binding to `0.0.0.0` to allow the dashboard to accept connections from the Tailscale network.
