Deployment Troubleshooting Guide
Comprehensive troubleshooting guide for Hyperscape deployments across Cloudflare Pages, Railway, and Vast.ai.Table of Contents
Cloudflare Pages
Build Fails with Module Resolution Errors
Symptoms:CSP Errors Loading Google Fonts
Symptoms:CORS Errors Loading Assets from R2
Symptoms:Multi-line Commit Messages Break Deploy
Symptoms:Railway
Database Connection Fails
Symptoms:- Get DATABASE_URL from Railway dashboard (PostgreSQL plugin)
- Add to Railway environment variables
- Redeploy
CSRF Errors from Cloudflare Pages
Symptoms:Port Conflicts
Symptoms:Vast.ai
Xorg Fails to Start
Symptoms:WebGPU Not Available
Symptoms:PulseAudio Not Working
Symptoms:Stream Not Appearing on Platforms
Symptoms:- Stream key configured but no stream on Twitch/Kick/X
- FFmpeg running but no output
- Twitch:
rtmp://live.twitch.tv/app - Kick:
rtmps://fa723fc1b171.global-contribute.live-video.net/app - X:
rtmp://sg.pscp.tv:80/x
DATABASE_URL Not Persisting
Symptoms:/tmp/hyperscape-secrets.env before git reset, then copied back after.
Verify:
PM2 Process Crashes Immediately
Symptoms:Maintenance Mode Fails
Symptoms:Bun Not Found
Symptoms:Database Issues
Schema Migration Fails
Symptoms:Database Connection Timeout
Symptoms:Stale Schema After Pull
Symptoms:- Missing columns
- Type errors
- Constraint violations
Streaming Issues
No Audio in Stream
Symptoms:- Video works but no audio
- Silent stream
Audio/Video Desync
Symptoms:- Audio plays ahead or behind video
- Gradual drift over time
Stream Buffering on Viewers
Symptoms:- Viewers experience frequent buffering
- Stream quality drops
FFmpeg Crashes
Symptoms:Security & Secrets
JWT_SECRET Missing Error
Symptoms:Stream Keys Not Working
Symptoms:- Stream keys configured but streams don’t appear
- FFmpeg shows “Connection refused”
Solana Keypair Not Found
Symptoms:Secrets Lost After Git Reset
Symptoms:- DATABASE_URL works initially but fails after deployment
- Stream keys stop working after git pull
/tmp/hyperscape-secrets.env before git reset:
Common Error Messages
”Failed to resolve module specifier”
Fix: Update Vite config with polyfill aliases (commit e012ed2).”WebGPU is not supported”
Fix: Use Chrome 113+, Edge 113+, or Safari 18+. Check webgpureport.org.”CSRF token validation failed”
Fix: CSRF now skipped for cross-origin (commit 8626299). Update server code.”Connection refused” (database)
Fix: Set DATABASE_URL, run database warmup (commit dda4396).”Keypair file not found”
Fix: Set SOLANA_DEPLOYER_PRIVATE_KEY, run decode-key.ts (commit 8a677dc).”PulseAudio: Connection refused”
Fix: Start PulseAudio, create chrome_audio sink. See Streaming Audio Capture.”FFmpeg: No such file or directory”
Fix: Install FFmpeg (apt-get install ffmpeg) or set FFMPEG_PATH.
”Port already in use”
Fix: Kill process on port (lsof -ti:5555 | xargs kill -9) or use different port.
Diagnostic Commands
Check All Services
Check Environment Variables
Check Logs
Performance Issues
High CPU Usage
Symptoms:- CPU > 90%
- Lag or frame drops
High Memory Usage
Symptoms:- Memory > 4GB
- PM2 restarts process
Stream Lag or Stuttering
Symptoms:- Choppy video
- Audio dropouts
- Frame drops