Troubleshooting
This page covers common issues you may encounter when setting up and using Cloud Relay, with solutions for each.
Wrangler Issues
Section titled “Wrangler Issues””wrangler: command not found” or “npm not found”
Section titled “”wrangler: command not found” or “npm not found””Wrangler or npm is not installed or not in your PATH. The dashboard shows this in the Prerequisites card as a failed check.
Solution: Install Node.js (which includes npm), then install wrangler:
# Preferred: use via npx (no global install needed)npx wrangler --version
# Or install globallynpm install -g wrangler“wrangler login” Opens Browser but Auth Fails
Section titled ““wrangler login” Opens Browser but Auth Fails”The OAuth flow didn’t complete or the browser couldn’t redirect back.
Solution:
- Check that your browser is not blocking popups from
dash.cloudflare.com - Try an incognito/private window
- If behind a corporate proxy, try authenticating via API token instead:
Generate an API token in the Cloudflare dashboard under My Profile > API Tokens with the Edit Cloudflare Workers template.
Terminal window export CLOUDFLARE_API_TOKEN=your-api-token
”Wrangler is not authenticated”
Section titled “”Wrangler is not authenticated””The dashboard or CLI reports that wrangler is not authenticated with Cloudflare. This means npx wrangler whoami failed.
Solution:
wrangler loginThen click “Start Relay” again or re-run oak ci cloud-init. The auth check phase runs every time to ensure credentials are still valid.
Deployment Issues
Section titled “Deployment Issues””Worker deployment failed”
Section titled “”Worker deployment failed””The wrangler deploy phase failed. The dashboard shows the raw wrangler output in a collapsible detail section.
Common causes:
Account not verified: Cloudflare requires email verification before Workers can be deployed. Check your email for a verification link.
Subdomain not set:
New accounts need to choose a *.workers.dev subdomain. Go to Workers & Pages > Overview in the Cloudflare dashboard.
Durable Object migration error: On first deploy, Wrangler creates a Durable Object migration. If this fails, ensure the scaffold is intact. Re-scaffold with:
oak ci cloud-init --force“npm install failed”
Section titled ““npm install failed””The npm install phase failed. Check the detail output in the dashboard for specific errors.
Common causes:
- Network issues — npm can’t reach the registry
- Permission errors — the scaffold directory isn’t writable
- Corrupted node_modules — delete and retry:
Terminal window rm -rf oak/cloud-relay/node_modulesoak ci cloud-init
“Deployment succeeded but could not detect Worker URL”
Section titled ““Deployment succeeded but could not detect Worker URL””Wrangler deployed successfully but the output format was unexpected. The URL couldn’t be parsed.
Solution: Check your Cloudflare dashboard for the Worker URL, then connect manually:
oak ci cloud-connect https://your-worker.your-subdomain.workers.devConnection Issues
Section titled “Connection Issues””Connection Refused” or “Could not connect to Worker relay”
Section titled “”Connection Refused” or “Could not connect to Worker relay””The daemon cannot reach the Worker URL.
Checklist:
- Verify the Worker is deployed:
curl https://your-worker.workers.dev/health - Check the URL is correct:
oak ci cloud-url - Ensure your network allows outbound WebSocket connections (wss://)
- Check that the daemon is running:
oak ci status
Instance Shows “Offline” in Cloud Status
Section titled “Instance Shows “Offline” in Cloud Status”The local daemon is not connected to the Worker. Cloud agents see this as the instance being unavailable.
Causes and solutions:
| Cause | Solution |
|---|---|
| Daemon not running | oak ci start |
| Daemon restarting | Wait for auto-reconnect (exponential backoff, up to 60s) |
| Network interruption | Connection auto-recovers when network returns |
| Token mismatch | Re-scaffold: rm -rf oak/cloud-relay && oak ci cloud-init |
| Worker not deployed | Click “Start Relay” or run oak ci cloud-init |
WebSocket Disconnects Frequently
Section titled “WebSocket Disconnects Frequently”If the connection drops repeatedly:
- Check network stability — Unstable networks cause frequent reconnects. The daemon uses exponential backoff and recovers automatically.
- Check daemon logs for errors:
Terminal window tail -50 .oak/ci/daemon.log - Check Worker logs for server-side issues:
Terminal window cd oak/cloud-relaynpx wrangler tail
Authentication Issues
Section titled “Authentication Issues””Token Invalid” or “Unauthorized”
Section titled “”Token Invalid” or “Unauthorized””The token presented does not match what the Worker expects.
For relay_token (daemon to Worker):
- Check
.oak/config.yamlhas the correcttokenundercloud_relay - Re-scaffold to reset both sides:
rm -rf oak/cloud-relay && oak ci cloud-init
For agent_token (cloud agent to Worker):
- Verify the token in your cloud agent’s MCP server configuration matches the one shown in the dashboard
- Ensure the Authorization header format is
Bearer <token>(with the space), or just the raw token - Re-scaffold to generate fresh tokens and update the agent config
Token Lost
Section titled “Token Lost”The agent_token is displayed in the dashboard (Cloud page, when connected) and stored in .oak/config.yaml. If you’ve lost it:
- Check the dashboard’s Cloud page — click the reveal button next to the agent token
- Check
.oak/config.yamlfor theagent_tokenvalue - Check
oak/cloud-relay/wrangler.tomlfor the token values - If all else fails, re-scaffold:
rm -rf oak/cloud-relay && oak ci cloud-init
Timeout Errors
Section titled “Timeout Errors”Cloud Agent Reports Timeout
Section titled “Cloud Agent Reports Timeout”MCP tool calls take too long and the cloud agent’s HTTP request times out.
Causes:
- Large codebase search — Semantic search on very large codebases can be slow on first run. Subsequent searches use cached embeddings.
- Network latency — The request travels: cloud agent -> Worker -> WebSocket -> local daemon -> process -> WebSocket -> Worker -> cloud agent. Each hop adds latency.
- Daemon under load — If the local daemon is processing heavy background tasks (indexing, summarization), tool calls may be slower.
Solutions:
- Ensure codebase indexing is complete before using cloud relay (
oak ci status) - Keep the local daemon’s workload reasonable — avoid triggering full re-indexes while using cloud relay
- Check daemon logs for slow queries:
tail -f .oak/ci/daemon.log
Checking Logs
Section titled “Checking Logs”Daemon Logs
Section titled “Daemon Logs”The local daemon logs relay activity to .oak/ci/daemon.log:
# Recent cloud relay entriestail -100 .oak/ci/daemon.logLook for entries containing cloud, relay, or websocket for relay-specific logs.
Worker Logs
Section titled “Worker Logs”Stream real-time logs from the deployed Worker:
cd oak/cloud-relaynpx wrangler tailThis shows all incoming requests, authentication results, and relay activity. Press Ctrl+C to stop.
Getting Help
Section titled “Getting Help”If you encounter an issue not covered here:
- Check the Oak CI Troubleshooting page for general daemon issues
- Review daemon logs (
.oak/ci/daemon.log) and Worker logs (npx wrangler tail) for error details - Open an issue on GitHub with the relevant log output