Common Issues and Solutions
This guide covers the most frequently encountered issues when working with SpoonOS and their solutions.
Installation Issues
Python Version Compatibility
Problem: ImportError
or ModuleNotFoundError
when importing SpoonOS modules
Symptoms:
ImportError: No module named 'spoon_ai'
ModuleNotFoundError: No module named 'asyncio'
Solution:
-
Ensure Python 3.10+ is installed:
python --version
# Should show Python 3.10.0 or higher -
Create a new virtual environment:
python -m venv spoon-env
source spoon-env/bin/activate # Linux/macOS
# or
spoon-env\\Scripts\\activate # Windows -
Install dependencies:
pip install -r requirements.txt
Dependency Conflicts
Problem: Package version conflicts during installation
Symptoms:
ERROR: pip's dependency resolver does not currently have a solution
Conflicting dependencies: package-a requires package-b>=2.0, but package-c requires package-b<2.0
Solution:
- Use a fresh virtual environment
- Install packages one by one to identify conflicts
- Check
requirements.txt
for version pinning issues - Use
pip install --upgrade
for outdated packages
Configuration Issues
API Key Problems
Problem: Authentication errors with LLM providers
Symptoms:
AuthenticationError: Invalid API key
Unauthorized: API key not found
Solution:
-
Verify API keys are set correctly:
echo $OPENAI_API_KEY
echo $ANTHROPIC_API_KEY -
Check
.env
file format:# Correct format
OPENAI_API_KEY=sk-your-actual-key-here
# Incorrect (no quotes needed)
OPENAI_API_KEY="sk-your-actual-key-here" -
Validate API key format:
- OpenAI: Starts with
sk-
- Anthropic: Starts with
sk-ant-
- Google: 39-character string
- OpenAI: Starts with
-
Test API key validity:
curl -H "Authorization: Bearer $OPENAI_API_KEY" \\
https://api.openai.com/v1/models
Configuration File Errors
Problem: JSON parsing errors in config.json
Symptoms:
JSONDecodeError: Expecting ',' delimiter
ConfigurationError: Invalid configuration format
Solution:
-
Validate JSON syntax using online validator or:
python -m json.tool config.json
-
Common JSON errors:
// Wrong: trailing comma
{
"key": "value",
}
// Correct
{
"key": "value"
} -
Use CLI validation:
python main.py
> validate-config
Agent Issues
Agent Loading Failures
Problem: Agent fails to load or initialize
Symptoms:
AgentError: Agent 'my_agent' not found
ImportError: cannot import name 'MyAgent'
Solution:
-
Check agent configuration in
config.json
:{
"agents": {
"my_agent": {
"class": "SpoonReactAI",
"description": "My custom agent"
}
}
} -
Verify agent class exists:
from spoon_ai.agents import SpoonReactAI
# Should not raise ImportError -
Check for typos in agent names and class names
-
List available agents:
python main.py
> list-agents
Tool Loading Issues
Problem: Tools not available or failing to load
Symptoms:
ToolError: Tool 'crypto_tool' not found
ModuleNotFoundError: No module named 'spoon_toolkits'
Solution:
-
Install spoon-toolkit package:
pip install -e spoon-toolkit/
-
Check tool configuration:
{
"tools": [
{
"name": "crypto_tool",
"type": "builtin",
"enabled": true
}
]
} -
Verify environment variables for tools:
echo $OKX_API_KEY
echo $COINGECKO_API_KEY -
List available tools:
python main.py
> list-toolkit-categories
> list-toolkit-tools crypto
LLM Provider Issues
Provider Connection Failures
Problem: Cannot connect to LLM providers
Symptoms:
ConnectionError: Failed to connect to OpenAI API
TimeoutError: Request timed out
Solution:
-
Check internet connectivity:
ping api.openai.com
ping api.anthropic.com -
Verify API endpoints are accessible:
curl -I https://api.openai.com/v1/models
-
Check firewall and proxy settings
-
Test with different provider:
python main.py
> llm-status
Rate Limiting
Problem: API rate limits exceeded
Symptoms:
RateLimitError: Rate limit exceeded
HTTPError: 429 Too Many Requests
Solution:
-
Implement exponential backoff in configuration:
{
"llm": {
"retry_attempts": 3,
"retry_delay": 1.0,
"exponential_backoff": true
}
} -
Use multiple API keys for load balancing
-
Reduce request frequency
-
Upgrade to higher tier API plan
MCP (Model Context Protocol) Issues
MCP Server Connection Problems
Problem: Cannot connect to MCP servers
Symptoms:
MCPError: Failed to connect to MCP server
ConnectionRefusedError: [Errno 111] Connection refused
Solution:
-
Verify MCP server is running:
curl http://localhost:8765/health
-
Check MCP server configuration:
{
"mcp_servers": [
{
"name": "my_server",
"url": "http://localhost:8765",
"transport": "sse"
}
]
} -
Start MCP server:
python mcp_server.py
-
Check server logs for errors
MCP Tool Discovery Issues
Problem: MCP tools not discovered or available
Symptoms:
MCPError: No tools found on server
ToolError: MCP tool 'my_tool' not available
Solution:
-
Verify tools are registered on MCP server:
@mcp.tool()
def my_tool():
return "Hello from MCP" -
Check MCP server tool listing:
curl http://localhost:8765/tools
-
Restart MCP server after adding tools
-
Verify tool permissions and authentication
Performance Issues
Slow Response Times
Problem: Agent responses are very slow
Symptoms:
- Long delays before responses
- Timeout errors
- High CPU/memory usage
Solution:
-
Check system resources:
python main.py
> system-info -
Optimize LLM configuration:
{
"llm": {
"temperature": 0.7,
"max_tokens": 1000,
"timeout": 30
}
} -
Enable caching:
{
"cache": {
"enabled": true,
"ttl": 3600
}
} -
Reduce tool complexity and number of tools
Memory Issues
Problem: High memory usage or out-of-memory errors
Symptoms:
MemoryError: Unable to allocate memory
Process killed (OOM)
Solution:
-
Monitor memory usage:
python main.py
> system-info -
Reduce conversation history:
python main.py
> new-chat -
Optimize agent configuration:
{
"config": {
"max_steps": 5,
"max_tokens": 500
}
} -
Use lighter LLM models (e.g., GPT-3.5 instead of GPT-4)
Blockchain Integration Issues
RPC Connection Problems
Problem: Cannot connect to blockchain RPC endpoints
Symptoms:
ConnectionError: Failed to connect to RPC
HTTPError: 403 Forbidden
Solution:
-
Verify RPC URL is correct:
curl -X POST -H "Content-Type: application/json" \\
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \\
$RPC_URL -
Check RPC provider limits and authentication
-
Try alternative RPC endpoints:
# Ethereum
export RPC_URL="https://eth.llamarpc.com"
export RPC_URL="https://rpc.ankr.com/eth" -
Verify network connectivity and firewall settings
Transaction Failures
Problem: Blockchain transactions fail or revert
Symptoms:
TransactionError: Transaction reverted
InsufficientFundsError: Not enough balance
Solution:
-
Check wallet balance:
python main.py
> token-by-symbol ETH -
Verify gas settings:
{
"blockchain": {
"gas_limit": 21000,
"gas_price": "20000000000"
}
} -
Check transaction parameters and recipient address
-
Verify private key and wallet configuration
Debugging Techniques
Enable Debug Logging
# Set environment variables
export DEBUG=true
export LOG_LEVEL=debug
# Run with verbose output
python main.py
Use System Diagnostics
python main.py
> system-info
> llm-status
> validate-config
Check Configuration
# Validate configuration
python main.py
> validate-config
# Check migration status
python main.py
> check-config
Test Individual Components
# Test LLM connection
from spoon_ai.llm import LLMManager
llm = LLMManager()
response = await llm.generate("Hello, world!")
# Test tool execution
from spoon_toolkits.crypto import GetTokenPriceTool
tool = GetTokenPriceTool()
result = await tool.execute(symbol="BTC")
Getting Help
Documentation Resources
📚 Working Examples
🎯 Comprehensive Graph Demo
GitHub: View Source
Perfect for troubleshooting:
- Graph system setup and configuration
- Memory management and state persistence issues
- Parallel execution and routing problems
- Production deployment patterns
🔍 MCP Spoon Search Agent
GitHub: View Source
Great for debugging:
- MCP server connection and integration issues
- Tool discovery and loading problems
- API rate limiting and error handling
- Multi-tool orchestration challenges
📊 Graph Crypto Analysis
GitHub: View Source
Excellent for testing:
- Real API integration and authentication
- Data processing and validation issues
- Performance optimization problems
- Complex workflow debugging
Community Support
- GitHub Issues: Report bugs and feature requests
- Discord: Real-time community support
- Documentation: Comprehensive guides and working examples
Diagnostic Information
When reporting issues, include:
- Python version (
python --version
) - SpoonOS version
- Operating system
- Error messages and stack traces
- Configuration files (sanitized)
- Steps to reproduce
Log Collection
# Enable debug logging
export DEBUG=true
export LOG_LEVEL=debug
# Capture logs
python main.py 2>&1 | tee spoon_debug.log
# Include relevant log sections in issue reports
Prevention Tips
Regular Maintenance
- Keep dependencies updated
- Rotate API keys regularly
- Monitor system resources
- Backup configuration files
- Test in development environment first
Best Practices
- Use version control for configurations
- Implement proper error handling
- Monitor API usage and costs
- Set up alerts for critical issues
- Document custom configurations
Environment Management
- Use separate environments for development/production
- Pin dependency versions in requirements.txt
- Use environment variables for sensitive data
- Regularly test backup and recovery procedures
See Also
Prevention Tips
Regular Maintenance
- Keep dependencies updated
- Rotate API keys regularly
- Monitor system resources
- Backup configuration files
- Test in development environment first
Best Practices
- Use version control for configurations
- Implement proper error handling
- Monitor API usage and costs
- Set up alerts for critical issues
- Document custom configurations
Environment Management
- Use separate environments for development/production
- Pin dependency versions in requirements.txt
- Use environment variables for sensitive data
- Regularly test backup and recovery procedures