Skip to main content
Common issues and solutions for Prvue.

Setup Issues

Terraform Errors

Error: “Failed to initialize Terraform”
  • Ensure Terraform is installed: terraform version
  • Check Terraform version >= 1.5.0
  • Verify Digital Ocean token is valid
Error: “Failed to create droplet”
  • Check Digital Ocean account has sufficient credits
  • Verify region is available
  • Check droplet size is available in selected region
Error: “SSH connection failed”
  • Verify SSH public key is correct
  • Check firewall allows SSH (port 22)
  • Wait a few minutes for droplet to fully initialize

Ansible Errors

Error: “Failed to connect to host”
  • Ensure SSH access works: ssh root@SERVER_IP
  • Check inventory file is correctly generated
  • Verify SSH key is added to droplet
Error: “Docker installation failed”
  • Check internet connectivity on droplet
  • Verify Ubuntu 22.04 is being used
  • Check Ansible logs for detailed error
Error: “Orchestrator service failed to start”
  • Check environment variables are set correctly
  • Verify Node.js is installed: node --version
  • Check orchestrator logs: journalctl -u preview-orchestrator -f

Deployment Issues

Webhook Not Triggering

Symptoms: PR opened but no preview deployment Solutions:
  1. Check webhook is configured:
  2. Verify webhook secret matches:
  3. Check orchestrator logs:
  4. Test webhook manually:

Missing or Invalid preview-config.yml

Symptoms: Deployment fails with “preview-config.yml is required at repository root but was not found” or a validation error (e.g. “framework is required”, “health_check_path is not valid”). Cause: The orchestrator requires a valid preview-config.yml at the repository root. Required fields: framework, database, health_check_path, app_port, app_port_env, app_entrypoint. Solutions:
  1. Add preview-config.yml in the repo root (see Configuration Reference).
  2. Ensure all required fields are present and valid (e.g. health_check_path must start with /, app_port must be a positive number).
  3. If the file exists but deployment still fails, check orchestrator logs for the exact validation message (e.g. invalid YAML or missing field).

Build Failures

Symptoms: Preview deployment fails during build Solutions:
  1. Check Docker build logs:
  2. Verify Dockerfile exists and is correct
  3. Check build commands in preview-config.yml
  4. Ensure dependencies are installable

pnpm install --prod fails (e.g. prepare script / husky)

Symptoms: Build fails at RUN pnpm install --frozen-lockfile --prod (or similar) with exit code 1. Cause: Lifecycle scripts like prepare or postinstall in package.json can depend on devDependencies (e.g. husky). With --prod, devDependencies are not installed, so the script fails when it runs. Fixes (in your app or its Dockerfile):
  • Husky: Set ENV HUSKY=0 before the install step in your Dockerfile so the prepare script is a no-op in Docker/CI.
  • General: Move the script’s dependency to dependencies if it must run in production builds, or in the Dockerfile run install with --ignore-scripts and then run only the commands you need (e.g. build).
  • Prvue: When the repo has no Dockerfile, we inject a default that sets HUSKY=0 so this case is avoided for our template.

Health Check Failures

Symptoms: Containers start but preview URL doesn’t work Solutions:
  1. Verify health check endpoint exists:
  2. Check health check path in preview-config.yml:
  3. Check container logs:
  4. Verify app is listening on correct port:

Port Conflicts

Symptoms: “Port already in use” error Solutions:
  1. Check allocated ports:
  2. Find process using port:
  3. Cleanup old deployment (use the full deployment id from GET /api/previews, e.g. my-org-my-app-12):
    See Orchestrator API for full endpoint details.

Nginx Configuration Errors

Symptoms: Preview URL returns 502 Bad Gateway Solutions:
  1. Check nginx config syntax:
  2. Verify preview config exists:
  3. Check nginx error logs:
  4. Verify app container is running:
  5. Test proxy directly:

Runtime Issues

Container Crashes

Symptoms: Preview works initially but stops responding Solutions:
  1. Check container status:
  2. View container logs:
  3. Check resource usage:
  4. Restart container:

Database Connection Issues

Symptoms: App can’t connect to database Solutions:
  1. Verify database container is running:
  2. Check database logs:
  3. Test database connection:
  4. Verify connection string in app:

Cleanup Not Working

Symptoms: Old previews not being cleaned up Solutions:
  1. Check cleanup service is running:
  2. Verify TTL configuration:
  3. Manually trigger cleanup (use deployment id from GET /api/previews, e.g. my-org-my-app-12):
  4. Check deployment age:

Performance Issues

Slow Builds

Solutions:
  1. Use Docker layer caching
  2. Optimize Dockerfile (multi-stage builds)
  3. Use smaller base images
  4. Cache dependencies in separate layer

High Resource Usage

Solutions:
  1. Reduce max concurrent previews
  2. Lower container resource limits
  3. Use smaller droplet size
  4. Enable cleanup of old previews

Memory Issues

Symptoms: Droplet runs out of memory Solutions:
  1. Check memory usage:
  2. Reduce container memory limits
  3. Cleanup old previews
  4. Upgrade droplet size

Security Issues

Webhook Signature Verification Failed

Solutions:
  1. Verify webhook secret matches:
  2. Check GitHub webhook configuration
  3. Verify payload is not modified

Unauthorized Repository Access

Solutions:
  1. Check ALLOWED_REPOS environment variable
  2. Verify repository format: owner/repo
  3. Check orchestrator logs for rejection messages

Debugging Tips

Enable Debug Logging

Set LOG_LEVEL=debug in the orchestrator environment (or set Ansible variable orchestrator_log_level: debug). Debug lines then appear in the same file as info logs: /opt/preview-deployer/logs/orchestrator.log. View them with:
To set via systemd override:

Check All Services

Manual Testing

Test orchestrator API (see Orchestrator API for full endpoint reference):
Test webhook:

Getting Help

If you’re still stuck:
  1. Check logs for error messages
  2. Review Architecture Documentation
  3. Check Configuration Reference
  4. Open an issue on GitHub with:
    • Error messages
    • Logs (sanitized)
    • Steps to reproduce
    • System information

Common Error Messages

”Repository not in allowed list”

  • Add repository to ALLOWED_REPOS environment variable
  • Restart orchestrator service

”Port allocation out of range”

  • PR number too large (>56,000)
  • Use smaller PR numbers or upgrade port allocation strategy

”Health check timeout”

  • Verify health check endpoint exists
  • Check health check path in config
  • Increase timeout in docker-manager.ts

”Docker build failed”

  • Check Dockerfile syntax
  • Verify all dependencies are available
  • Check build logs for specific errors

”Nginx reload failed”

  • Check nginx config syntax: nginx -t
  • Verify preview config file format
  • Check nginx error logs