Troubleshooting
Quick fixes
- Tunnel already exists →
moley tunnel stop - DNS not resolving → wait 5 minutes, then check the Cloudflare dashboard
- Permission denied → check your API token scopes (Zone:Read, DNS:Edit, Cloudflare Tunnel:Edit, Access:Edit)
DNS issues
1
Check DNS resolution
dig your-domain.com
nslookup your-domain.com 1.1.1.1
2
Test access
curl -v https://your-domain.com
3
Check Cloudflare dashboard
- DNS record exists and points to your tunnel
- Proxy status (orange cloud) is enabled
- Wait up to 5 minutes for propagation
Tunnel failures
1
Check your API token
cat ~/.moley/config.yml
moley config set --cloudflare.token=your_token
2
Check cloudflared is on your PATH
cloudflared --version
Moley shells out to cloudflared to run the tunnel process. If this command fails, install cloudflared — no tunnel login step is needed.
3
Run with debug logs
moley --log-level=debug tunnel run
moley tunnel --dry-run run
Orphaned resources
If moley tunnel stop fails or resources remain after a crash:
# Force orphan detection
rm -f moley.lock
moley tunnel stop --log-level=debug
# Manual cleanup (last resort)
cloudflared tunnel list
cloudflared tunnel delete <tunnel-id>