Troubleshooting Guide
This guide covers common issues and their solutions when running WaterCrawl self-hosted with Docker.
Common Issues
Services Not Starting
Symptoms
- Services fail to start
- Docker containers exit immediately
- Error messages in docker logs
Solutions
-
Check container logs:
docker compose logs [service_name]
-
Verify Docker Compose configuration:
docker compose config
-
Check system resources:
docker stats
-
Ensure all required ports are available:
netstat -tulpn | grep LISTEN
-
Check for proper environment variables in .env:
cat docker/.env | grep -v "^#" | grep -v "^$"
Database Connection Issues
Symptoms
- App fails to connect to database
- Database-related error messages
- Slow database operations
Solutions
-
Verify PostgreSQL is running:
docker compose ps db
-
Check database logs:
docker compose logs db
-
Ensure database credentials in .env match:
grep -E "POSTGRES_|DATABASE" docker/.env
-
Restart the database service:
docker compose restart db
-
Check if the database is healthy:
docker compose exec db pg_isready -U postgres
File Upload/Download Issues
Symptoms
- Unable to upload or download files
- MinIO-related errors
- Broken links to files
Solutions
-
Check MinIO configuration in .env:
grep "MINIO_" docker/.env
-
Verify MinIO service is running:
docker compose ps minio
-
Check MinIO logs:
docker compose logs minio
-
Important: Ensure MinIO external endpoint is properly configured when running on non-localhost environments:
# These settings MUST match your domain
MINIO_EXTERNAL_ENDPOINT=your-domain.com
MINIO_BROWSER_REDIRECT_URL=https://your-domain.com/minio-console/
MINIO_SERVER_URL=https://your-domain.com/ -
Test MinIO connectivity:
docker compose exec app python -c "from django.conf import settings; from storages.backends.s3boto3 import S3Boto3Storage; s = S3Boto3Storage(); print(f'Connection successful: {s.connection is not None}')"
Celery Worker Issues
Symptoms
- Crawl tasks not being processed
- Tasks stuck in "pending" state
- Worker crashes
Solutions
-
Check Celery logs:
docker compose logs celery
-
Verify Redis is running properly:
docker compose ps redis
docker compose logs redis -
Restart the Celery workers:
docker compose restart celery celery-beat
-
Check Celery task queue status:
docker compose exec app python manage.py shell -c "from django_celery_results.models import TaskResult; print(TaskResult.objects.filter(status='PENDING').count())"
Nginx Configuration Issues
Symptoms
- 502 Bad Gateway errors
- Cannot access web interface
- Routing problems between services
Solutions
-
Check Nginx logs:
docker compose logs nginx
-
Verify Nginx configuration generated from template:
docker compose exec nginx cat /etc/nginx/conf.d/default.conf
-
Restart Nginx:
docker compose restart nginx
-
Test connectivity to app service:
docker compose exec nginx curl -I http://app:9000
Permission Issues
Symptoms
- Permission denied errors
- Cannot write to volumes
- File access problems
Solutions
-
Check volume permissions:
ls -la docker/volumes/
-
Fix permissions if needed:
chmod -R 777 docker/volumes/
-
Restart affected services:
docker compose restart
Rebuilding and Upgrading
If you're experiencing persistent issues, you might need to rebuild the services:
-
Stop all containers:
docker compose down
-
Optionally backup data:
cp -r docker/volumes docker/volumes_backup
cp docker/.env docker/.env.backup -
Pull the latest images:
docker compose pull
-
Start services:
docker compose up -d
-
Apply migrations:
docker compose exec app python manage.py migrate
Advanced Debugging
Database Inspection
docker compose exec db psql -U postgres -d postgres
Django Shell Access
docker compose exec app python manage.py shell
Container Shell Access
docker compose exec [service_name] sh
Docker Logs with Time
docker compose logs --timestamps [service_name]
Check Environment Variables in Container
docker compose exec [service_name] env
Memory Usage Issues
If you're experiencing out-of-memory errors:
# View memory usage
docker stats
# Increase memory limits in your container orchestration
# Edit docker-compose.yml to add:
# deploy:
# resources:
# limits:
# memory: 2G
Getting Help
If you're unable to resolve an issue using this guide, you can:
- Check the GitHub Issues for similar problems
- Open a new issue with details about your problem
- Contact support at [email protected]