- Error: Bad Gateway (502)
- Request ID: 97fe10cf1f6079a3-DEN
- Status: Service unavailable
- Server process crashes on startup
- Missing dependencies
- Port binding issues
- Environment variable problems
- Incorrect service name
- Wrong build/start commands
- Health check path mismatch
- Environment variables not set
- OAuth configuration errors
- Database connection failures
- Memory/CPU limits exceeded
- Code syntax errors
- Go to Render Dashboard
- Find your service:
pacmac-marketplace - Check Deploy tab for build logs
- Check Logs tab for runtime errors
- Verify Environment tab has correct variables
Your service might be at a different URL:
https://pacmac-marketplace.onrender.comhttps://pacmac-web.onrender.comhttps://new-pacmac.onrender.com- Check Render dashboard for exact URL
We've created multiple server versions:
# Minimal server (current)
npm start # Uses server-minimal.js
# Simple server
npm run start-simple # Uses server-simple.js
# Full server with OAuth
npm run start-full # Uses server.jsRequired in Render dashboard:
NODE_ENV=production
PORT=3000
Optional (for full features):
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
SESSION_SECRET=your-session-secret
- Go to Render dashboard
- Click "Manual Deploy"
- Select "Deploy latest commit"
- Monitor build logs for errors
# Test minimal server
npm run dev-minimal
curl http://localhost:3000/health
# Test simple server
npm run dev-simple
curl http://localhost:3000/health
# Test full server
npm run dev
curl http://localhost:3000/health# Test health endpoint
curl https://your-render-url.onrender.com/health
# Test root endpoint
curl https://your-render-url.onrender.com/
# Test with verbose output
curl -v https://your-render-url.onrender.com/healthSolution: Check package.json dependencies are installed
npm installSolution: Use PORT environment variable
PORT=3000 node server-minimal.jsSolution: Use minimal server without OAuth
npm start # Uses server-minimal.jsSolution: Verify health check path in render.yaml
healthCheckPath: /health- Purpose: Basic server for deployment testing
- Features: Health check, static files, basic endpoints
- Dependencies: Express only
- Use Case: Initial deployment verification
- Purpose: Simple server with basic API
- Features: Health check, marketplace API, demo data
- Dependencies: Express, CORS
- Use Case: Testing without OAuth
- Purpose: Complete marketplace server
- Features: OAuth, Stripe, full API, verification
- Dependencies: Express, Passport, Stripe, SendGrid
- Use Case: Production with all features
- Deploy server-minimal.js
- Verify health endpoint works
- Confirm basic functionality
- Switch to server-simple.js
- Test marketplace API
- Verify static file serving
- Switch to server.js
- Configure OAuth
- Test complete functionality
- Check Render Dashboard for deployment logs
- Verify Service URL in Render dashboard
- Test Health Endpoint once deployed
- Check Environment Variables are set correctly
- Review Build Logs for any errors
Last Updated: January 2025 Status: Troubleshooting Bad Gateway Error