Troubleshooting Guide
Common issues and solutions for PolyOracle AI setup and operation.
Installation Issues
Backend Installation Problems
Python Version Issues
Error: Python 3.11+ required, found 3.9
Solution:
- Install Python 3.11+ from python.org
- Use pyenv:
pyenv install 3.11.0 && pyenv global 3.11.0
- Verify version:
python --version
Package Installation Failures
Error: Failed building wheel for some-package
Solutions:
- Update pip:
pip install --upgrade pip
- Install build tools:
pip install wheel setuptools
- Try alternative install:
pdm install
- On Mac:
xcode-select --install
LangGraph Import Errors
ImportError: No module named 'langgraph'
Solution:
pip install -e ".[dev]"
# Or
pip install langgraph langchain-openai
Frontend Installation Problems
Node.js Version Issues
Error: Node.js 18+ required
Solutions:
- Install Node.js 18+ from nodejs.org
- Use nvm:
nvm install 18 && nvm use 18
- Verify:
node --version
pnpm Not Found
Command 'pnpm' not found
Solutions:
npm install -g pnpm
# Or use npx
npx pnpm install
Next.js Build Errors
Error: Cannot resolve module '@/components/...'
Solution:
- Check
tsconfig.json
paths configuration - Verify component file exists
- Restart development server:
pnpm dev
API Configuration Issues
OpenAI API Problems
Invalid API Key
Error: Incorrect API key provided
Solutions:
- Verify key format starts with
sk-
- Check for extra spaces or newlines
- Generate new key at platform.openai.com
- Ensure key has sufficient credits
Rate Limit Exceeded
Error: Rate limit reached for requests
Solutions:
- Reduce research depth temporarily
- Add delays between requests
- Upgrade OpenAI plan if needed
- Use Anthropic as backup LLM
Exa API Issues
Search Fails
Error: EXA_API_KEY not configured
Solutions:
- Get API key from exa.ai
- Add to
.env
:EXA_API_KEY=your_key
- Restart backend server
- Verify with test search
Search Results Empty
Warning: No search results found
Solutions:
- Try broader search terms
- Check internet connectivity
- Verify Exa API has credits
- Use Tavily as backup search
Polymarket API Problems
Connection Failed
Error: Failed to connect to Polymarket API
Solutions:
- Verify API key and secret in
.env
- Check network connectivity
- Confirm API keys have trading permissions
- Try API endpoint manually:
curl https://clob.polymarket.com/ping
Proxy Contract Issues
Error: Proxy contract not found
Solutions:
- Create proxy contract on polymarket.com
- Copy correct proxy address to
.env
- Verify proxy is on Polygon network
- Check wallet has approved proxy
Runtime Errors
Backend Runtime Issues
LangGraph Server Won't Start
Error: Port 2024 already in use
Solutions:
# Kill existing process
lsof -ti:2024 | xargs kill -9
# Or use different port
langgraph dev --port 2025
Memory Errors
Error: Out of memory
Solutions:
- Reduce research depth:
max_depth: 2
- Limit concurrent requests
- Increase system memory
- Use smaller LLM model
Timeout Errors
Error: Request timeout after 300s
Solutions:
- Increase timeout in configuration
- Check internet connection stability
- Use faster LLM model
- Reduce research scope
Frontend Runtime Issues
Wallet Connection Failed
Error: No Web3 provider found
Solutions:
- Install MetaMask or similar wallet
- Enable browser extension
- Switch to Polygon network
- Refresh page and retry
API Connection Failed
Error: Cannot connect to backend
Solutions:
- Verify backend is running on correct port
- Check
LANGGRAPH_DEPLOYMENT_URL
in.env.local
- Test backend health:
curl http://localhost:2024/health
- Check firewall/network settings
Trading Issues
Order Execution Problems
Insufficient Balance
Error: Insufficient USDC balance
Solutions:
- Check wallet USDC balance
- Ensure funds are on Polygon network
- Account for gas fees (need MATIC)
- Verify proxy contract has approvals
Order Rejected
Error: Order rejected by exchange
Solutions:
- Check market is still active
- Verify order size within limits
- Check current market price hasn't moved
- Ensure sufficient liquidity
Gas Estimation Failed
Error: Cannot estimate gas
Solutions:
- Ensure wallet has MATIC for gas
- Check Polygon network status
- Try smaller order size
- Wait and retry (network congestion)
Position Management Issues
Position Not Found
Error: No position found for market
Solutions:
- Check if tokens were received
- Verify correct market ID
- Allow time for blockchain confirmation
- Check wallet transaction history
P&L Calculation Wrong
Warning: Unrealized P&L seems incorrect
Solutions:
- Refresh market data
- Check if market resolved
- Verify position size calculation
- Account for trading fees
Performance Issues
Slow Analysis
Research Takes Too Long
Warning: Research phase taking over 10 minutes
Solutions:
- Reduce research depth:
max_depth: 2
- Limit sources per query:
sources_per_query: 5
- Check internet speed
- Use cached research when available
Memory Usage High
Warning: High memory usage detected
Solutions:
- Restart backend service periodically
- Reduce concurrent analysis
- Clear research cache
- Monitor system resources
Network Issues
Intermittent Connectivity
Error: Connection lost during analysis
Solutions:
- Implement retry logic
- Save analysis state periodically
- Use more stable internet connection
- Consider VPN for stability
Data Issues
Market Data Problems
Stale Market Data
Warning: Market data is over 1 hour old
Solutions:
- Refresh market data manually
- Check Polymarket API status
- Verify internet connectivity
- Use cached data as fallback
Missing Market Information
Error: Market not found or delisted
Solutions:
- Verify market ID is correct
- Check if market was delisted
- Use alternative similar markets
- Update market list
Security Issues
API Key Exposure
Key Visible in Logs
Warning: API key detected in log output
Solutions:
- Check environment variable loading
- Verify
.env
file permissions:chmod 600 .env
- Review log configuration
- Rotate exposed keys immediately
Suspicious Activity
Alert: Unusual API usage detected
Solutions:
- Review recent trading activity
- Check API key usage in provider dashboard
- Rotate API keys if compromised
- Enable 2FA on all accounts
Getting Additional Help
Log Analysis
Enable Debug Logging:
# Backend
export LOG_LEVEL=DEBUG
make lg-server
# Frontend
export NODE_ENV=development
pnpm dev
Important Log Locations:
- Backend: Terminal output +
logs/
directory - Frontend: Browser console + Network tab
- Blockchain: Wallet transaction history
Diagnostic Commands
Backend Health Check:
curl http://localhost:2024/health
python -c "import langgraph; print('OK')"
Frontend Health Check:
pnpm lint
pnpm build --dry-run
Network Connectivity:
curl -I https://api.openai.com
curl -I https://search.exa.ai
curl -I https://clob.polymarket.com/ping
Community Support
Report Issues:
- GitHub Issues: Include error messages and system info
- Discord: Real-time community help
- Documentation: Check FAQ for common issues
Provide System Information:
python --version
node --version
pnpm --version
uname -a # or systeminfo on Windows
Include Relevant Logs:
- Sanitize API keys and private information
- Include error context (before/after error)
- Specify exact steps to reproduce issue
Preventive Measures
Regular Maintenance
Weekly Tasks:
- Update dependencies:
pip install --upgrade -r requirements.txt
- Rotate API keys if high-volume usage
- Review trading performance and adjust parameters
- Check for software updates
Monthly Tasks:
- Full system backup including configurations
- Review and optimize risk management settings
- Analyze trading patterns for improvements
- Update documentation for any workflow changes
Monitoring Setup
Automated Monitoring:
# Add to your monitoring script
health_checks = [
"backend_health",
"frontend_health",
"api_connectivity",
"wallet_balance",
"recent_trades"
]
Alerts Configuration:
- Low wallet balance warnings
- API quota approaching limits
- Unusual trading patterns
- System performance degradation
Still having issues? Check the FAQ or create an issue on GitHub with detailed error information.