This guide provides solutions to common issues you might encounter while setting up, developing, or using Web3 Guardian.
- Installation Issues
- Backend Issues
- Extension Issues
- API Issues
- Database Issues
- Performance Issues
- Security Issues
- Development Issues
Problem: Getting Python version errors during installation.
ERROR: This package requires Python >=3.13Solution:
- Check your Python version:
python --version
- Install Python 3.13+ from python.org
- Use pyenv for multiple Python versions:
pyenv install 3.13.0 pyenv local 3.13.0
Problem: Extension build fails with Node.js version errors.
error: The engine "node" is incompatible with this moduleSolution:
- Install Node.js 18+:
# Using nvm nvm install 18 nvm use 18 # Or download from nodejs.org
- Clear npm cache:
npm cache clean --force rm -rf node_modules npm install
Problem: Docker services fail to start.
Solution:
- Check Docker version:
docker --version docker-compose --version
- Ensure Docker daemon is running
- Check for port conflicts:
docker-compose down docker system prune -f docker-compose up -d
Problem: Server fails to start with import errors.
ModuleNotFoundError: No module named 'src'Solution:
- Activate virtual environment:
cd backend source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Set PYTHONPATH:
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
Problem: Environment variables are not being recognized.
Solution:
- Check
.envfile exists in the backend directory - Verify file format (no spaces around
=):# Correct API_KEY=your_key_here # Incorrect API_KEY = your_key_here
- Load environment manually:
source .env python main.py
Problem: Tenderly API calls are failing.
TenderlyError: Failed to authenticate with Tenderly APISolution:
- Verify API credentials in
.env:TENDERLY_API_KEY=your_actual_api_key TENDERLY_ACCOUNT_SLUG=account TENDERLY_PROJECT_SLUG=project TENDERLY_SECRET_TOKEN=your-tenderly-secret-token
- Test API connection:
curl -H "X-Access-Key: YOUR_API_KEY" \ https://api.tenderly.co/api/v1/account/account/projects - Check Tenderly dashboard for project settings
Problem: RAG pipeline fails with Gemini API errors.
google.auth.exceptions.DefaultCredentialsErrorSolution:
- Verify Gemini API key:
GEMINI_API_KEY=your_actual_api_key
- Test API access:
import google.generativeai as genai genai.configure(api_key="your_actual_api_key") model = genai.GenerativeModel('gemini-pro') response = model.generate_content("Hello") print(response.text)
Problem: Extension fails to load with manifest errors.
Solution:
- Check manifest.json syntax:
cd extension node -e "console.log(JSON.parse(require('fs').readFileSync('src/manifest.json')))"
- Rebuild extension:
npm run build:dev
- Load unpacked extension from
dist/folder
Problem: Extension doesn't detect Web3 transactions.
Solution:
- Check console for errors in developer tools
- Verify content script permissions in manifest.json:
{ "content_scripts": [{ "matches": ["<all_urls>"], "js": ["content/content.js"] }] } - Test on a known Web3 site (e.g., Uniswap)
Problem: Background service worker crashes.
Solution:
- Check service worker errors in
chrome://extensions/ - Verify background script registration:
{ "background": { "service_worker": "background/background.js" } } - Add error handling:
chrome.runtime.onStartup.addListener(() => { console.log('Background script started'); });
Problem: Getting 429 Too Many Requests errors.
{
"error": "Rate limit exceeded",
"retry_after": 60
}Solution:
- Implement exponential backoff:
async function makeRequestWithRetry(url, options, maxRetries = 3) { for (let i = 0; i < maxRetries; i++) { try { const response = await fetch(url, options); if (response.status === 429) { const retryAfter = response.headers.get('Retry-After') || Math.pow(2, i); await new Promise(resolve => setTimeout(resolve, retryAfter * 1000)); continue; } return response; } catch (error) { if (i === maxRetries - 1) throw error; } } }
- Check rate limit configuration in backend
Problem: Cross-origin request blocked.
Access to fetch at 'http://localhost:8000/api/analyze/contract' from origin 'chrome-extension://...' has been blocked by CORS policy
Solution:
- Update CORS settings in backend:
app.add_middleware( CORSMiddleware, allow_origins=["chrome-extension://*", "moz-extension://*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], )
- Add extension ID to allowed origins
Problem: API requests fail with authentication errors.
Solution:
- Check API key format
- Verify headers:
const response = await fetch('/api/analyze/contract', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer your-token' }, body: JSON.stringify(data) });
Problem: Cannot connect to PostgreSQL database.
psycopg2.OperationalError: could not connect to serverSolution:
- Check PostgreSQL is running:
# macOS brew services start postgresql # Ubuntu sudo systemctl start postgresql # Windows net start postgresql-x64-14
- Verify connection string:
DATABASE_URL=postgresql://username:password@localhost:5432/web3guardian
- Create database if it doesn't exist:
createdb web3guardian
Problem: Alembic migrations fail.
sqlalchemy.exc.ProgrammingError: relation "contract_analysis" does not existSolution:
- Reset migrations:
alembic downgrade base alembic upgrade head
- Generate new migration:
alembic revision --autogenerate -m "Initial migration" alembic upgrade head
Problem: Cannot connect to Redis server.
redis.exceptions.ConnectionError: Error connecting to RedisSolution:
- Start Redis server:
# macOS brew services start redis # Ubuntu sudo systemctl start redis # Windows redis-server
- Test connection:
redis-cli ping
- Check Redis URL:
REDIS_URL=redis://localhost:6379/0
Problem: API endpoints are responding slowly.
Solution:
- Enable Redis caching:
REDIS_CACHE_TTL=3600 ENABLE_CACHING=True
- Monitor database queries:
# Enable query debugging DB_ECHO=True - Add database indexes:
CREATE INDEX idx_contract_address ON contract_analysis(contract_address);
Problem: Backend consuming too much memory.
Solution:
- Limit database connection pool:
DB_POOL_SIZE=5 DB_MAX_OVERFLOW=10
- Configure worker processes:
gunicorn main:app -w 2 --max-requests 1000 --max-requests-jitter 100
- Monitor memory usage:
pip install memory-profiler python -m memory_profiler main.py
Problem: Extension causing browser slowdown.
Solution:
- Optimize content script:
// Use debouncing for frequent operations const debounce = (func, wait) => { let timeout; return function executedFunction(...args) { const later = () => { clearTimeout(timeout); func(...args); }; clearTimeout(timeout); timeout = setTimeout(later, wait); }; };
- Reduce API calls with caching
- Use web workers for heavy computations
Problem: HTTPS certificate issues in production.
Solution:
- Use Let's Encrypt certificates:
certbot --nginx -d api.web3guardian.dev
- Update nginx configuration:
server { listen 443 ssl; ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem; }
Problem: Security headers not present in API responses.
Solution:
- Add security middleware:
from fastapi.middleware.trustedhost import TrustedHostMiddleware from fastapi.middleware.httpsredirect import HTTPSRedirectMiddleware app.add_middleware(HTTPSRedirectMiddleware) app.add_middleware(TrustedHostMiddleware, allowed_hosts=["api.web3guardian.dev"])
Problem: Changes not reflected during development.
Solution:
- For backend:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
- For extension:
npm run build:dev -- --watch
- Clear browser cache and reload extension
Problem: Python imports not resolving correctly.
Solution:
- Use absolute imports:
from src.utils.config import settings
- Add to PYTHONPATH:
export PYTHONPATH="${PYTHONPATH}:$(pwd)"
- Use relative imports within packages:
from .config import settings
Problem: Tests failing with import errors.
Solution:
- Install test dependencies:
pip install -r requirements-dev.txt
- Set up test environment:
export TESTING=True export DATABASE_URL=postgresql://test:test@localhost/test_web3guardian
- Run tests with proper path:
python -m pytest tests/
-
Backend logs:
tail -f logs/web3guardian.log
-
Extension logs:
- Open Chrome DevTools
- Go to Extensions tab
- Click "Inspect views: service worker"
-
Database logs:
# PostgreSQL tail -f /var/log/postgresql/postgresql-14-main.log
Enable debug mode for more detailed information:
# Backend
DEBUG=True
LOG_LEVEL=DEBUG
# Extension
npm run build:devUse built-in health check endpoints:
# Backend health
curl http://localhost:8000/health
# Database connectivity
python scripts/check_db.py
# Redis connectivity
redis-cli ping-
API response times:
curl -w "@curl-format.txt" -o /dev/null -s "http://localhost:8000/api/analyze/contract"
-
Memory usage:
ps aux | grep python -
Database performance:
SELECT query, mean_time, calls FROM pg_stat_statements ORDER BY mean_time DESC LIMIT 10;
If you can't resolve your issue using this guide:
- GitHub Issues: Create an issue
- Discord Community: Join our Discord
- Email Support: support@web3guardian.dev
- Documentation: docs.web3guardian.dev
When reporting issues, please include:
- Operating system and version
- Python/Node.js versions
- Full error messages and stack traces
- Steps to reproduce the issue
- Relevant configuration (without sensitive data)
Last updated: August 4, 2025