This guide helps you diagnose and resolve common issues encountered during Clipron AI deployment. Issues are organized by category with step-by-step solutions.
# Check what's using port 8000sudo lsof -i :8000sudo netstat -tulpn | grep :8000
Solutions:
Copy
# Option 1: Kill the conflicting processsudo kill -9 <PID># Option 2: Change the port in configuration# Edit backend/.envPORT=8001# Option 3: Use a different port temporarilycd backendsource venv/bin/activateuvicorn main:app --port 8001
Python Virtual Environment Issues
Error: No module named 'fastapi' or similar import errorsDiagnosis:
Copy
# Check if virtual environment is activatedwhich pythonpip list | grep fastapi# Check virtual environment pathecho $VIRTUAL_ENV
Solutions:
Copy
# Recreate virtual environmentcd backendrm -rf venvpython3 -m venv venvsource venv/bin/activatepip install -r requirements.txt# Or use the installation script./install_ai_dependencies.sh
Database Connection Errors
Error: could not connect to server or database does not existDiagnosis:
Copy
# Test database connectioncd backendsource venv/bin/activatepython -c "from database import engine; engine.connect(); print('Database OK')"# Check PostgreSQL status (if using PostgreSQL)sudo systemctl status postgresql
# Increase Node.js memory limitexport NODE_OPTIONS="--max-old-space-size=4096"npm run build# Or modify package.json"scripts": { "build": "NODE_OPTIONS='--max-old-space-size=4096' react-scripts build"}# For servers with limited RAM, use swapsudo fallocate -l 2G /swapfilesudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfile
Environment Variable Issues
Error: Frontend can’t connect to backend APIDiagnosis:
Copy
# Check frontend environment variablescat frontend/.env.production# Test API connectivitycurl -I https://yourdomain.com/api/health
Solutions:
Copy
# Ensure correct API URL in frontend/.env.productionREACT_APP_API_URL=https://yourdomain.com/api# Rebuild frontend after environment changescd frontendnpm run build# Check Nginx configuration for API proxysudo nginx -tsudo systemctl reload nginx
Error: Connection refused when accessing the siteDiagnosis:
Copy
# Check if services are runningsudo systemctl status nginxsudo systemctl status clipron# Check listening portssudo netstat -tulpn | grep -E ':80|:443|:8000'# Test local connectivitycurl -I http://localhostcurl -I http://localhost:8000/health
Error: FATAL: password authentication failed for user "clipron"Solutions:
Copy
# Reset PostgreSQL passwordsudo -u postgres psqlALTER USER clipron PASSWORD 'new_password';\q# Update DATABASE_URL in .envDATABASE_URL=postgresql://clipron:new_password@localhost/clipron_db# Check pg_hba.conf authentication methodsudo nano /etc/postgresql/13/main/pg_hba.conf# Ensure line exists: local clipron_db clipron md5# Restart PostgreSQLsudo systemctl restart postgresql
Database Does Not Exist
Error: FATAL: database "clipron_db" does not existSolutions:
Copy
# Create databasesudo -u postgres createdb clipron_dbsudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE clipron_db TO clipron;"# Initialize database schemacd backendsource venv/bin/activatepython init_db.py# Or run migrationsalembic upgrade head
Connection Pool Exhausted
Error: QueuePool limit of size 20 overflow 30 reachedSolutions:
Copy
# Increase connection pool size in backend/.envDB_POOL_SIZE=50DB_MAX_OVERFLOW=100# Or in database configuration# Edit backend/database.pyengine = create_engine( DATABASE_URL, pool_size=50, max_overflow=100, pool_timeout=30)# Restart backend servicesudo systemctl restart clipron
# Stop all processes using the databasesudo systemctl stop clipronpkill -f "python main.py"# Remove lock file if it existsrm backend/clipron.db-walrm backend/clipron.db-shm# Restart servicesudo systemctl start clipron# If problem persists, recreate databaserm backend/clipron.dbpython backend/init_db.py
# Verify API keys in .env filecat backend/.env | grep -E "(GOOGLE_GEMINI|DEEPSEEK|ANTHROPIC|OPENAI)_API_KEY"# Test API keys manuallycd backendsource venv/bin/activatepython quick_ai_test.py# Check API key format and validity# Google Gemini: Should start with "AI"# DeepSeek: Should be a long alphanumeric string# Anthropic: Should start with "sk-ant-"# OpenAI: Should start with "sk-"
Rate Limit Exceeded
Error: 429 Too Many Requests from AI APIsSolutions:
Copy
# Check rate limiting configuration# Edit backend/.envAI_RATE_LIMIT_PER_MINUTE=30AI_BURST_LIMIT=5# Implement exponential backoff# This is handled automatically by the Ron Cortex engine# Monitor API usagetail -f /var/log/clipron/api_usage.log
Important: Always backup your database and configuration files before attempting major fixes. Test solutions in a staging environment when possible.
Troubleshooting Tip: When reporting issues, include the output of the health check script, relevant log entries, and your system configuration. This helps support provide faster, more accurate assistance.