Troubleshooting Guide
This document provides solutions to common issues encountered when using FoxCloud.
Deployment Issues
1. Authentication Errors
Problem: Deployment fails with authentication errors.
Solutions:
- Verify Cloudflare API token has correct permissions:
- Workers Scripts: Edit permission
- Account Settings: Read permission
- Check that
CLOUDFLARE_API_TOKEN
and CLOUDFLARE_ACCOUNT_ID
are correctly set
- Ensure the token hasn’t expired
- Verify you’re using the correct account ID
2. Build Failures
Problem: Build process fails with errors.
Solutions:
- Ensure all dependencies are installed:
- Check for TypeScript compilation errors:
- Verify Node.js version is 18 or higher
- Clear node_modules and reinstall:
rm -rf node_modules package-lock.json
npm install
3. Environment Variable Issues
Problem: Application doesn’t recognize environment variables.
Solutions:
- Verify variables are set using the correct method:
- For development: Check
wrangler.toml
- For production: Use
wrangler secret put
- Check for typos in variable names (case-sensitive)
- Redeploy after setting variables
- Verify variables are being passed to the handler function
Runtime Issues
1. WebSocket Connection Failures
Problem: Clients cannot establish WebSocket connections.
Solutions:
- Verify proxy servers support WebSocket connections
- Check that proxy IPs and ports are correct
- Ensure proxy servers are accessible from the internet
- Verify SSL certificates on proxy servers
- Check firewall settings on proxy servers
2. Subscription Page Not Working
Problem: Subscription page returns errors or blank content.
Solutions:
- Verify UUID environment variable is set correctly
- Check that UUIDs are valid version 4 UUIDs
- Ensure PROXY_IP environment variable is set
- Verify proxy IPs are accessible
- Check Cloudflare Worker logs for errors
3. Configuration Generation Issues
Problem: Generated configurations don’t work with clients.
Solutions:
- Verify UUID in configuration matches environment variable
- Check that proxy IP in configuration is correct
- Ensure domain name matches your deployment
- Verify TLS settings (SNI, fingerprint) are correct
- Test with different client applications
Client-Side Issues
1. Connection Timeouts
Problem: Clients time out when connecting.
Solutions:
- Verify proxy server is running and accessible
- Check network connectivity to proxy server
- Verify firewall settings allow connections
- Test proxy server with other tools (curl, ping)
- Check for rate limiting on proxy server
2. Authentication Failures
Problem: Clients fail authentication with “invalid UUID” errors.
Solutions:
- Verify UUID in client matches server configuration
- Check for extra spaces or characters in UUID
- Ensure UUID is properly formatted (8-4-4-4-12)
- Verify UUID is active on the server
- Generate a new UUID if needed
3. TLS/SSL Errors
Problem: Clients report SSL/TLS certificate errors.
Solutions:
- Verify proxy server has valid SSL certificate
- Check that SNI setting matches proxy domain
- Verify client fingerprint settings match server
- Update client to latest version
- Try different TLS settings in client
1. Slow Connections
Problem: Proxy connections are slower than expected.
Solutions:
- Choose proxy servers closer to users
- Use multiple proxy IPs for load balancing
- Monitor proxy server performance
- Check for network congestion
- Optimize proxy server configuration
2. High Latency
Problem: High latency in WebSocket connections.
Solutions:
- Check Cloudflare Worker execution time limits
- Optimize code for faster processing
- Use proxy servers with better connectivity
- Monitor network path for bottlenecks
- Consider using Cloudflare’s performance features
UI Issues
1. Dashboard Not Loading
Problem: Web dashboard fails to load or displays errors.
Solutions:
- Check Cloudflare Worker logs for errors
- Verify HTML templates are correctly formatted
- Test with different browsers
- Check for Content Security Policy issues
- Verify asset paths are correct
2. Theme Issues
Problem: Dark/light theme not working correctly.
Solutions:
- Check browser console for JavaScript errors
- Verify CSS variables are correctly defined
- Test with different browser versions
- Clear browser cache and cookies
- Check for conflicting browser extensions
Development Issues
1. Development Server Issues
Problem: npm run dev
fails or behaves unexpectedly.
Solutions:
- Ensure Wrangler is properly installed:
- Check for port conflicts
- Verify Node.js version compatibility
- Clear Wrangler cache:
- Check for syntax errors in code
2. TypeScript Errors
Problem: TypeScript compilation fails with type errors.
Solutions:
- Install Cloudflare Workers types:
npm install --save-dev @cloudflare/workers-types
- Verify tsconfig.json includes correct types
- Check for missing type definitions
- Update TypeScript to compatible version
- Use type assertions where necessary
Security Issues
1. Unauthorized Access
Problem: Suspicious activity or unauthorized access attempts.
Solutions:
- Rotate UUIDs immediately
- Implement access logging
- Monitor connection patterns
- Use rate limiting
- Consider implementing IP whitelisting
2. Data Exposure
Problem: Concerns about sensitive data exposure.
Solutions:
- Audit environment variable usage
- Verify no sensitive data in logs
- Check for proper error handling
- Review HTML template security
- Implement Content Security Policy
GitHub Actions Issues
1. CI/CD Pipeline Failures
Problem: GitHub Actions workflows fail.
Solutions:
- Verify repository secrets are correctly set
- Check workflow file syntax
- Ensure required permissions are granted
- Review action versions for compatibility
- Check Cloudflare service status
2. Deployment Failures
Problem: Automatic deployments fail.
Solutions:
- Check Cloudflare API token permissions
- Verify account limits and quotas
- Review deployment logs for specific errors
- Test manual deployment
- Check for breaking changes in dependencies
Monitoring and Logging
1. Missing Logs
Problem: Unable to access application logs.
Solutions:
- Use Wrangler to tail logs:
- Check Cloudflare Dashboard for logs
- Implement custom logging in code
- Verify log level settings
- Check for log retention policies
2. Error Tracking
Problem: Difficulty tracking down errors.
Solutions:
- Implement structured error handling
- Add context to error messages
- Use try/catch blocks appropriately
- Log errors with sufficient detail
- Consider using error tracking services
Advanced Troubleshooting
1. Debugging with Console Logs
Add console.log statements to track execution flow:
console.log('Debug: Variable value:', variable);
# Tail logs in real-time
wrangler tail
# Test locally
wrangler dev
# Check current configuration
wrangler whoami
3. Network Debugging
# Test proxy server connectivity
curl -v https://your-proxy-server:port
# Check DNS resolution
nslookup your-proxy-server
Getting Help
If you’re unable to resolve an issue:
- Check existing GitHub issues
- Create a new issue with:
- Clear description of the problem
- Steps to reproduce
- Error messages and logs
- Environment information
- What you’ve tried so far
- Include relevant configuration (without sensitive data)
- Provide screenshots if applicable
- Tag the issue appropriately
By following this troubleshooting guide, you should be able to resolve most common issues with FoxCloud.