Troubleshooting
Server Won’t Start
Section titled “Server Won’t Start”Port already in use
Section titled “Port already in use”ERROR: [Errno 10048] error while attempting to bind on address ('127.0.0.1', 8787)Solution: Another process is using port 8787.
# Find what's using the portGet-NetTCPConnection -LocalPort 8787 -ErrorAction SilentlyContinue | Select-Object OwningProcess | ForEach-Object { Get-Process -Id $_.OwningProcess }
# Kill the process if it's a stale Provara instanceGet-Process uvicorn -ErrorAction SilentlyContinue | Stop-Process -ForceOr change the port:
AGENT_HUB_PORT=8788Module not found
Section titled “Module not found”ModuleNotFoundError: No module named 'src.server'Solution: Run from the project root directory, or set AGENT_HUB_ROOT:
cd C:\path\to\provarauv run uvicorn src.server.main:app --host 127.0.0.1 --port 8787Missing dependencies
Section titled “Missing dependencies”ModuleNotFoundError: No module named 'fastapi'Solution: Sync dependencies:
uv syncAuthentication Issues
Section titled “Authentication Issues”401 Unauthorized
Section titled “401 Unauthorized”{"detail": "Invalid or missing token"}Causes:
- Token not set in request header
- Token doesn’t match server’s token
- Header name is wrong (must be
X-Agent-Token)
Fix:
# Check what token the server is usingGet-Content runtime\agent_hub_token.txt
# Verify your request$token = Get-Content runtime\agent_hub_token.txtInvoke-RestMethod http://127.0.0.1:8787/pending ` -Headers @{ "X-Agent-Token" = $token }For the Python SDK:
# Ensure environment variable is set$env:AGENT_HUB_TOKEN = Get-Content runtime\agent_hub_token.txtPolicy Blocks
Section titled “Policy Blocks”Command not allowed
Section titled “Command not allowed”{"detail": {"error": "policy_blocked", "reason": "not_allowed:my-command"}}Meaning: The command doesn’t match any allow pattern.
Check which patterns exist:
from src.server.exec.policy import ALLOWfor i, p in enumerate(ALLOW): print(f"[{i}] {p}")Options:
- Modify the command to match an existing pattern
- Add a new allow pattern to
policy.py - Use a workspace script instead
Command denied by pattern
Section titled “Command denied by pattern”{"detail": {"error": "policy_blocked", "reason": "deny:\\b(Remove-Item|del)"}}Meaning: The command matches a deny pattern. Deny patterns always take priority over allow patterns.
CWD blocked
Section titled “CWD blocked”{"detail": {"error": "policy_blocked", "reason": "cwd_blocked:C:\\Windows"}}Meaning: The working directory is outside the project root.
Fix: Don’t specify a cwd, or ensure it’s under the project directory.
Connection Issues
Section titled “Connection Issues”Cannot reach server
Section titled “Cannot reach server”httpx.ConnectError: [Errno 10061] Connect call failedChecklist:
- Is the server running?
Terminal window Test-NetConnection 127.0.0.1 -Port 8787 - Is it on the right port?
Terminal window $env:AGENT_HUB_PORT # Check configured port - Is a firewall blocking it?
Terminal window Get-NetFirewallRule | Where-Object { $_.DisplayName -match "uvicorn" }
Rate limited
Section titled “Rate limited”{"error": "Rate limit exceeded", "retry_after_seconds": 60}Solution: Wait for the rate limit window to expire, or increase the limit:
AGENT_HUB_RATE_LIMIT_REQUESTS=200AGENT_HUB_RATE_LIMIT_WINDOW_SECONDS=60Execution Issues
Section titled “Execution Issues”Command times out
Section titled “Command times out”{"stderr": "timeout after 60s", "exit_code": -1}Solution: Increase the timeout when queueing:
plan(command="long-running-command", timeout_s=600) # 10 minutesMaximum allowed: 3600 seconds (1 hour).
PowerShell execution policy
Section titled “PowerShell execution policy”File cannot be loaded because running scripts is disabled on this system.Solution: Provara already uses -ExecutionPolicy Bypass, but if you’re running scripts manually:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedEmpty stdout
Section titled “Empty stdout”Some commands produce output but it appears empty. This can happen with:
- Commands that write to the host instead of stdout
- Format commands that output objects not strings
Fix: Pipe to Out-String:
Get-Process python | Out-StringData Issues
Section titled “Data Issues”Stale pending commands
Section titled “Stale pending commands”Old commands accumulating in the pending queue:
# View old pending itemsGet-ChildItem runtime\pending -Filter "*.json" | Sort-Object LastWriteTime | Select-Object Name, LastWriteTime
# Remove items older than 24 hoursGet-ChildItem runtime\pending -Filter "*.json" | Where-Object { $_.LastWriteTime -lt (Get-Date).AddHours(-24) } | Remove-ItemAudit log growing too large
Section titled “Audit log growing too large”The audit log is append-only. Rotate it periodically:
# Rotate audit log$date = Get-Date -Format "yyyyMMdd"Move-Item runtime\audit.log "runtime\audit_$date.log"# Server will create a new audit.log on next writeGetting Help
Section titled “Getting Help”If you’re stuck:
- Check the server logs (stdout) for error details
- Set
AGENT_HUB_LOG_LEVEL=DEBUGfor verbose output - Check the
/healthendpoint for system status - Review
runtime/audit.logfor recent activity - Open an issue on GitHub