NeuronAgent Troubleshooting Guide
Common issues and solutions for NeuronAgent deployment and usage.
Server Issues
Server Won't Start
Symptoms:
- Server fails to start
- Error messages about database connection
- Port already in use
Solutions:
-
Check Database Connection
psql -h localhost -p 5432 -U neurondb -d neurondb -c "SELECT 1;" -
Verify Environment Variables
env | grep -E "DB_|SERVER_" -
Check Port Availability
lsof -i :8080 # Or use different port export SERVER_PORT=8081 -
Check Logs
tail -f /tmp/neurondb-agent.log
Database Connection Failed
Symptoms:
- "Failed to connect to database" errors
- Connection timeout errors
Solutions:
-
Verify NeuronDB Extension
SELECT * FROM pg_extension WHERE extname = 'neurondb'; -
Check Database Permissions
GRANT ALL PRIVILEGES ON DATABASE neurondb TO neurondb; GRANT ALL ON SCHEMA neurondb_agent TO neurondb; -
Verify Connection String
# Test connection manually psql "host=localhost port=5432 user=neurondb dbname=neurondb" -
Check Firewall/Security Groups
- Ensure PostgreSQL port (5432) is accessible
- Check firewall rules
- Verify security group settings (AWS, GCP, etc.)
API Issues
401 Unauthorized Errors
Symptoms:
- All API requests return 401
- "Invalid API key" errors
Solutions:
-
Generate API Key
go run cmd/generate-key/main.go \ -org my-org \ -user my-user \ -rate 1000 \ -roles user,admin -
Verify API Key Format
# Should be: Authorization: Bearer <key> curl -H "Authorization: Bearer YOUR_KEY" http://localhost:8080/api/v1/agents -
Check Key in Database
SELECT key_prefix, organization_id, user_id FROM neurondb_agent.api_keys; -
Verify Key Hash
- Ensure key is hashed correctly
- Check bcrypt hashing is working
429 Rate Limit Exceeded
Symptoms:
- Requests fail with 429 status
- "Rate limit exceeded" errors
Solutions:
-
Check Rate Limit Settings
SELECT key_prefix, rate_limit_per_minute FROM neurondb_agent.api_keys; -
Increase Rate Limit
UPDATE neurondb_agent.api_keys SET rate_limit_per_minute = 1000 WHERE key_prefix = 'your_prefix'; -
Implement Backoff
- Use exponential backoff in client
- Respect Retry-After headers
500 Internal Server Errors
Symptoms:
- Random 500 errors
- Server crashes
Solutions:
-
Check Server Logs
tail -100 /tmp/neurondb-agent.log -
Verify Database Schema
SELECT tablename FROM pg_tables WHERE schemaname = 'neurondb_agent'; -
Run Migrations
# From this repository root psql -d neurondb -f sql/neuron-agent.sql # Apply other schema files under sql/ as needed (e.g. neuronagent_*.sql) -
Check Resource Limits
- Memory usage
- CPU usage
- Database connections
WebSocket Issues
WebSocket Connection Fails
Symptoms:
- WebSocket upgrade fails
- Connection immediately closes
Solutions:
-
Check Authentication
// Use API key in query or headerconst ws = new WebSocket('ws://localhost:8080/ws?session_id=...&api_key=...'); -
Verify Session ID
SELECT id FROM neurondb_agent.sessions WHERE id = 'session-id'; -
Check CORS Settings
- Verify CORS middleware is configured
- Check origin is allowed
-
Test with curl
curl --include \ --no-buffer \ --header "Connection: Upgrade" \ --header "Upgrade: websocket" \ --header "Sec-WebSocket-Key: test" \ --header "Sec-WebSocket-Version: 13" \ http://localhost:8080/ws?session_id=...
WebSocket Disconnects Frequently
Symptoms:
- Connection drops after short time
- Ping/pong not working
Solutions:
-
Check Keepalive Settings
- Verify ping/pong is enabled
- Check timeout settings
-
Network Issues
- Check for proxy timeouts
- Verify load balancer settings
- Check firewall rules
-
Server Load
- Monitor server resources
- Check for memory leaks
- Verify connection cleanup
Connector Issues
Slack Connector Errors
Error: "Slack authentication failed"
Solutions:
- Verify bot token is valid
- Check token has necessary scopes:
channels:readchannels:historychat:writeconversations.list
- Regenerate token if needed
Error: "channel not found"
Solutions:
- Use channel ID instead of name
- Ensure bot is member of channel
- Check channel ID format (starts with C, D, or G)
GitHub Connector Errors
Error: "GitHub API error: 403"
Solutions:
- Check token permissions
- Verify repository access
- Check rate limit:
curl -H "Authorization: token TOKEN" https://api.github.com/rate_limit
Error: "invalid GitHub path format"
Solutions:
- Use format:
owner/repo/path/to/file - URL-encode special characters
- Verify repository exists and is accessible
GitLab Connector Errors
Error: "GitLab connection failed"
Solutions:
- Verify token is valid
- Check project ID is correct
- Ensure token has
apiscope
Workflow Issues
Workflow Execution Fails
Symptoms:
- Workflow status stuck at "running"
- Workflow fails immediately
Solutions:
-
Check Workflow Definition
neuronagent-cli workflow validate workflow.yaml -
Verify Dependencies
- Check all step dependencies exist
- Ensure no circular dependencies
- Verify step IDs are unique
-
Check Step Execution
SELECT * FROM neurondb_agent.workflow_step_executions WHERE workflow_execution_id = 'execution-id'; -
Review Error Messages
SELECT error_message FROM neurondb_agent.workflow_executions WHERE id = 'execution-id';
Workflow Timeout
Symptoms:
- Workflow never completes
- Status remains "running"
Solutions:
-
Set Timeout
- Add timeout to workflow configuration
- Set timeout per step
-
Check Step Execution
- Verify steps are actually executing
- Check for hanging operations
-
Monitor Resources
- Check database connections
- Verify no deadlocks
- Monitor CPU and memory
Sandbox Issues
Docker Sandbox Not Working
Symptoms:
- Container isolation not working
- Commands fail in sandbox
Solutions:
-
Verify Docker is Running
docker ps -
Check Docker Permissions
# Ensure user can access Docker socket sudo usermod -aG docker $USER -
Test Docker Client
docker run --rm alpine:latest echo "test" -
Check Resource Limits
- Verify memory limits are reasonable
- Check CPU limits
- Ensure disk space available
Sandbox Timeout Issues
Symptoms:
- Commands timeout unexpectedly
- Timeout errors
Solutions:
-
Increase Timeout
config := tools.SandboxConfig{Timeout: 10 * time.Minute, // Increase timeout} -
Check Command Complexity
- Verify commands aren't too complex
- Check for infinite loops
- Monitor resource usage
Memory and Performance Issues
High Memory Usage
Symptoms:
- Server uses excessive memory
- Out of memory errors
Solutions:
-
Check Connection Pool
// Reduce connection pool sizeMaxOpenConns: 10,MaxIdleConns: 5, -
Monitor Memory Chunks
SELECT COUNT(*) FROM neurondb_agent.memory_chunks; -- Clean up old chunks if needed -
Check for Memory Leaks
- Use memory profiler
- Monitor goroutine count
- Check for unclosed resources
Slow Performance
Symptoms:
- API responses are slow
- Database queries take long
Solutions:
-
Check Database Indexes
SELECT indexname, tablename FROM pg_indexes WHERE schemaname = 'neurondb_agent'; -
Analyze Queries
EXPLAIN ANALYZE SELECT * FROM neurondb_agent.agents WHERE name = 'test'; -
Optimize Vector Search
- Check HNSW index exists
- Verify index parameters
- Monitor search performance
Logging and Debugging
Enable Debug Logging
export LOG_LEVEL=debug go run cmd/agent-server/main.go
View Logs
# Server logs tail -f /tmp/neurondb-agent.log # Docker logs (if using Docker) docker compose logs -f agent-server # Database logs tail -f /var/log/postgresql/postgresql.log
Debug WebSocket
const ws = new WebSocket('ws://localhost:8080/ws?session_id=...');ws.onopen = () => console.log('Connected');ws.onmessage = (e) => console.log('Message:', e.data);ws.onerror = (e) => console.error('Error:', e);ws.onclose = (e) => console.log('Closed:', e.code, e.reason);
Getting Help
If you continue to experience issues:
- Check Documentation: Review API Documentation and Architecture Guide
- Review Logs: Collect relevant log entries
- Gather Information:
- Server version
- Database version
- Error messages
- Steps to reproduce
- Contact Support: support@neurondb.ai