Skip to content

Troubleshooting

Devvekariya711 edited this page Nov 26, 2025 · 1 revision

Troubleshooting

Common issues and solutions for the Automated DevOps Agent.


Installation Issues

Problem: "Module 'google.adk' not found"

Solution:

pip uninstall google-adk
pip install google-adk --upgrade

Problem: "No module named 'automated_devops_agent'"

Solution:

# Make sure you're in the right directory
cd e:\KENGEL\automated_devops_agent

# Reinstall
pip install -r requirements.txt

Problem: "Permission denied" errors

Solution (Windows):

# Run as Administrator or use:
pip install --user -r requirements.txt

Solution (Linux/Mac):

# Don't use sudo, use virtual environment
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

API Key Issues

Problem: "API key not set" error

Solution:

# Check if set
echo $GOOGLE_API_KEY  # Linux/Mac
echo %GOOGLE_API_KEY%  # Windows CMD
$env:GOOGLE_API_KEY  # Windows PowerShell

# Set if empty
export GOOGLE_API_KEY="your_key"  # Linux/Mac
$env:GOOGLE_API_KEY="your_key"  # Windows PowerShell

Problem: "Invalid API key"

Solutions:

  1. Get new key: https://makersuite.google.com/app/apikey
  2. Check for spaces: echo $GOOGLE_API_KEY | wc -c
  3. Try .env file instead

Runtime Issues

Problem: "Port 8000 already in use"

Solution:

# Find what's using port 8000
lsof -i :8000  # Linux/Mac
netstat -ano | findstr :8000  # Windows

# Kill process or use different port
adk web --port 8080

Problem: Agent responses are slow

Causes:

  • Gemini API rate limits
  • Large file size
  • Network latency

Solutions:

  1. Use smaller files (< 1000 lines)
  2. Check internet connection
  3. Wait and retry
  4. Switch to gemini-2.0-flash-exp (faster)

Problem: "Connection refused" to localhost:8000

Solution:

# Check if adk web is running
ps aux | grep adk  # Linux/Mac
tasklist | findstr adk  # Windows

# Restart if needed
pkill adk  # Linux/Mac
adk web

Agent Behavior Issues

Problem: Agent not finding bugs

Explanations:

  • 74% F1 score = some bugs will be missed
  • AI is non-deterministic
  • Some bug types not in training data

Solutions:

  1. Run review multiple times
  2. Use specific prompts: "Check for SQL injection"
  3. Combine with manual review
  4. Report false negatives as issues

Problem: Too many false positives

Solutions:

  1. Review config/project_context.json coding standards
  2. Add false positive patterns to memory
  3. Use more specific prompts
  4. Adjust pylint score threshold

Problem: Autonomous fixes break code

This is why we have rollback!

# RefactoringPipeline auto-creates .bak files
# Manual rollback:
cp tools.py.bak tools.py

Memory/Context Issues

Problem: Agent not learning from past reviews

Solutions:

# Check memory file exists
cat config/project_context.json

# If corrupted, delete and restart
mv config/project_context.json config/project_context.json.old
# Agent will recreate on next run

Problem: Memory file corruption

Symptoms: JSON parse errors

Solution:

# Atomic writes prevent this, but if it happens:
# Restore from backup
ls config/project_context.json*
cp config/project_context.json.tmp config/project_context.json

Performance Issues

Problem: High memory usage

Solutions:

# Limit memory (Linux)
ulimit -v 2000000  # 2GB max

# Use Docker with limits
docker run --memory=2g devops-agent

# Clear cache
rm -rf __pycache__ .pytest_cache

Problem: Slow startup

Causes:

  • Large dependency tree
  • Cold start for Gemini API

Solutions:

  1. Use virtual environment (faster imports)
  2. First run is always slower
  3. Keep adk web running

Import/Dependency Issues

Problem: "ImportError" after update

Solution:

# Clean reinstall
pip uninstall -r requirements.txt -y
pip install -r requirements.txt

Problem: Version conflicts

Solution:

# Create fresh venv
deactivate
rm -rf .venv
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -r requirements.txt

Logging Issues

Problem: No logs generated

Check:

# Create logs directory if missing
mkdir -p logs

# Check permissions
ls -la logs/

# Test logger
python -c "from automated_devops_agent.logger import AgentLogger; print('✅ Logger works')"

Problem: Logs too large

Solution:

# Rotate logs
mv logs/agent_activity.jsonl logs/agent_activity_$(date +%Y%m%d).jsonl
# Agent will create new file

Still Having Issues?

  1. Check GitHub Issues: Search existing
  2. Open New Issue: Include:
    • Python version: python --version
    • OS: uname -a or ver
    • Error traceback
    • Steps to reproduce
  3. Email: devvekariya711@gmail.com
  4. Discussions: GitHub Discussions

Pro Tip: Before reporting, try:

# Clean reinstall
git pull origin main
pip uninstall -r requirements.txt -y
pip install -r requirements.txt
adk web