Troubleshooting - pratikchaudhari64/personal_devserver GitHub Wiki

Troubleshooting

Common Issues

502 Bad Gateway

Cause: Service not running or wrong port

Fix:

# Check if service is running
docker ps

# Check logs
docker logs <service_name>

# Verify internal port matches docker-compose
docker exec <service_name> netstat -tlnp

Cannot Connect to ngrok

Cause: Port mismatch or firewall

Fix:

# Ensure using port 8000
ngrok http 8000  # NOT 80

# Check Docker port mapping
docker port personals_nginx

Service Not Starting

Check health status:

docker compose ps
docker logs personals_notion_app

Common fixes:

  • Missing dependencies in Dockerfile
  • Port already in use
  • Health check failing

Changes Not Reflecting

Always rebuild after changes:

docker compose down
docker compose up --build -d

For nginx config changes only:

docker exec personals_nginx nginx -s reload

Path Issues

Wrong: /notionapp returns 404 Right: /notionapp/ (trailing slash matters)

Fix in nginx.conf:

location /notionapp { 
    return 301 /notionapp/;
}
location /notionapp/ {
    proxy_pass http://notion_app:5000/;
}

Container Name Conflicts

Error: "name already in use"

Fix:

docker rm -f <container_name>
# Or remove container_name from docker-compose

Memory Issues

Add limits to docker-compose.yml:

services:
  my_app:
    mem_limit: 512m

Debug Commands

# View all logs
docker compose logs -f

# Enter container
docker exec -it <container> sh

# Network debugging
docker network inspect personal_devserver_app_network

# Resource usage
docker stats

Still Stuck?

  1. Check Security for firewall issues
  2. Verify all files are in correct directories
  3. Try minimal setup first (just nginx)
  4. Open issue on GitHub with error logs
⚠️ **GitHub.com Fallback** ⚠️