Problem: The virtual environment is corrupted or missing the activate script.
Solution:
# Remove corrupted venv
./scripts/clean_venv.sh
# Or manually:
rm -rf venv
# Run deployment again
./scripts/deploy.sh local
Problem: The python3-venv package is not installed on your system.
Solution:
On Debian/Ubuntu:
sudo apt update
sudo apt install python3-venv
On RHEL/CentOS/Fedora:
sudo yum install python3-venv
# Or on newer versions:
sudo dnf install python3-venv
On macOS (with Homebrew):
# Usually pre-installed, but if needed:
brew install python3
After installing, recreate the virtual environment:
./scripts/clean_venv.sh
./scripts/deploy.sh local
Problem: Docker service is not started.
Solution:
On Linux:
sudo systemctl start docker
sudo systemctl enable docker # Enable on boot
On macOS/Windows:
Verify:
docker info
Problem: Your user is not in the docker group.
Solution:
On Linux:
sudo usermod -aG docker $USER
# Log out and log back in, or run:
newgrp docker
Problem: Another service is using a required port.
Solution:
Check what’s using the port:
# For port 8000
sudo lsof -i :8000
# Or
sudo netstat -tuln | grep 8000
Options:
docker-compose.ymlsudo kill -9 <PID>Problem: Package installation fails, often due to missing system libraries.
Solution:
Install system dependencies:
On Debian/Ubuntu:
sudo apt update
sudo apt install build-essential python3-dev libpq-dev
On RHEL/CentOS:
sudo yum groupinstall "Development Tools"
sudo yum install python3-devel postgresql-devel
For specific services:
libpq-dev (Debian) or postgresql-devel (RHEL)Problem: Dependencies not installed or wrong virtual environment.
Solution:
# Activate venv
source venv/bin/activate
# Reinstall dependencies
pip install -r requirements-dev.txt
find services -name "requirements.txt" -exec pip install -r {} \;
Problem: AWS CLI not configured.
Solution:
# Configure AWS credentials
aws configure
# Or set environment variables
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
export AWS_DEFAULT_REGION=us-east-1
# Verify
aws sts get-caller-identity
Problem: Another process is using Terraform state.
Solution:
cd infrastructure/terraform
# Check for lock file
ls -la .terraform.tfstate.lock.info
# If stuck, force unlock (use with caution)
terraform force-unlock <LOCK_ID>
Problem: kubectl not installed.
Solution:
Install kubectl:
# On Linux
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# On macOS
brew install kubectl
Problem: kubectl context not configured or cluster not accessible.
Solution:
# Check current context
kubectl config current-context
# List available contexts
kubectl config get-contexts
# Switch context
kubectl config use-context <context-name>
# For EKS, update kubeconfig
aws eks update-kubeconfig --name <cluster-name> --region <region>
Problem: Docker image cannot be pulled.
Solution:
docker images | grep gennet
./scripts/deploy.sh local # This builds images
docker tag gennet/service:latest registry/gennet/service:latest
docker push registry/gennet/service:latest
Problem: Service not responding to health checks.
Solution:
Check service logs:
# Local
docker-compose logs -f <service-name>
# Production
kubectl logs -f deployment/<service-name> -n gennet-system
Common causes:
Problem: Services can’t connect to database.
Solution:
docker-compose ps postgres
kubectl get pods -n gennet-system | grep postgres
2. Check connection string:
```bash
# Should match docker-compose.yml or Kubernetes config
echo $DATABASE_URL
# Local
docker-compose exec postgres psql -U gennet -d gennet -c "SELECT 1;"
Problem: Network configuration or service discovery issues.
Solution:
Local (Docker Compose):
docker-compose.yml network configurationProduction (Kubernetes):
nslookup <service-name>.gennet-system.svc.cluster.localkubectl get endpoints -n gennet-systemBefore asking for help, collect:
./scripts/validate_setup.sh
docker-compose ps docker-compose logs
kubectl get all -n gennet-system kubectl logs -l app=gennet -n gennet-system
3. **Error Messages:**
- Full error output
- Relevant log lines
- Steps to reproduce
### Debug Mode
Run with verbose output:
```bash
# Enable bash debugging
bash -x ./scripts/deploy.sh local
# Enable Docker debug
export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0
Local:
docker-compose logsProduction:
kubectl logs# Stop and remove everything
docker-compose down -v
rm -rf venv
./scripts/clean_venv.sh
# Clean Docker
docker system prune -a
# Start fresh
./scripts/deploy.sh local
# Check what's running
docker-compose ps
kubectl get pods -n gennet-system
# View logs
docker-compose logs -f [service]
kubectl logs -f deployment/[service] -n gennet-system
# Restart service
docker-compose restart [service]
kubectl rollout restart deployment/[service] -n gennet-system
# Check resources
docker stats
kubectl top pods -n gennet-system
pip list --outdated
npm outdated
./scripts/validate_setup.sh