Troubleshooting guide

Resolve common issues you might encounter when self-hosting Screenshothis. This guide provides step-by-step solutions, diagnostic commands, and prevention strategies to keep your instance running smoothly.
Get the latest help: Check the Screenshothis repository and GitHub Issues for the most recent troubleshooting information and community solutions.

Quick diagnostics

Start here to quickly assess your system’s health and identify issues:
1

Check application health

Test if your Screenshothis instance is responding:
# Basic health check
curl -f http://localhost:3000/health

# Detailed health status
curl -s http://localhost:3000/health | jq '.'
You should see a 200 response with health status information
2

Verify readiness

Check if the application is ready to serve requests:
# Check if application is ready
curl -f http://localhost:3000/health/ready

# Check if application is alive
curl -f http://localhost:3000/health/live
3

Review recent logs

Examine logs for error messages and clues:
# View recent application logs
docker logs screenshothis --tail 50

# Follow logs in real-time
docker logs -f screenshothis

# View logs with timestamps
docker logs -t screenshothis --since 1h

Common startup issues

Application won’t start

When your Screenshothis instance fails to start or exits immediately:

Database connection problems

PostgreSQL connectivity issues

When you can’t connect to your PostgreSQL database:

Redis connectivity issues

Cache and session problems

When Redis connections fail or caching doesn’t work:

Storage and S3 issues

Screenshot upload failures

When screenshots can’t be saved to storage:

Screenshot generation problems

Capture failures and timeouts

When screenshots fail to generate or take too long:

Performance optimization

System resource management

When your instance is slow or consuming too many resources:

Network and connectivity

External service connectivity

When you can’t reach databases, S3, or other external services:

Monitoring and diagnostics

System health monitoring

Set up monitoring to prevent issues before they occur:
1

Enable health monitoring

Create monitoring scripts for system health:
# Health check script
#!/bin/bash
# save as health-check.sh

echo "=== Screenshothis Health Check ==="
echo "Timestamp: $(date)"

# Check application health
echo "Application health:"
curl -f http://localhost:3000/health && echo " ✓ Healthy" || echo " ✗ Unhealthy"

# Check disk space
echo "Disk usage:"
df -h | awk '$5 > 80 {print "WARNING: " $0}'

# Check memory usage
echo "Memory usage:"
free -h

# Check Docker containers
echo "Container status:"
docker ps --format "table {{.Names}}\t{{.Status}}"
2

Set up automated monitoring

Add monitoring to your crontab:
# Edit crontab
crontab -e

# Add these entries:
# Health check every 5 minutes
*/5 * * * * /path/to/health-check.sh >> /var/log/screenshothis-health.log 2>&1

# Disk space check every 15 minutes
*/15 * * * * df -h | awk '$5 > 85 {print "CRITICAL: Disk space low on " $0}' | mail -s "Disk Space Alert" admin@yourdomain.com

# Log rotation check
0 2 * * * docker logs screenshothis --tail 1000 > /var/log/screenshothis-daily.log
3

Monitor application metrics

Enable detailed application monitoring:
# Add metrics to environment
echo "ENABLE_METRICS=true" >> .env.production
echo "METRICS_PORT=9090" >> .env.production

# View metrics
curl http://localhost:9090/metrics

# Monitor specific endpoints
watch -n 5 'curl -s http://localhost:3000/health | jq .'

Getting help and support

When you need additional assistance:

Collecting diagnostic information

When reporting issues, include this diagnostic information:
1

System information

# Collect system details
echo "=== System Information ===" > diagnostic.txt
uname -a >> diagnostic.txt
docker version >> diagnostic.txt
docker-compose version >> diagnostic.txt
lsb_release -a >> diagnostic.txt 2>/dev/null
2

Application logs

# Collect recent application logs
echo "=== Application Logs ===" >> diagnostic.txt
docker logs screenshothis --tail 200 >> diagnostic.txt
3

Configuration (redacted)

# Collect environment variables (remove sensitive data)
echo "=== Environment Configuration ===" >> diagnostic.txt
env | grep -v PASSWORD | grep -v SECRET | grep -v KEY | sort >> diagnostic.txt
4

Container status

# Collect container information
echo "=== Container Status ===" >> diagnostic.txt
docker ps -a >> diagnostic.txt
docker stats --no-stream >> diagnostic.txt

Prevention and maintenance

Regular maintenance tasks

Keep your Screenshothis instance healthy with regular maintenance:

Next steps