Common Issues
Port Already In Use / Two Gateways Running
Symptom: Gateway fails to start with a clear error message about port conflicts.Check PID lock and port status
Gateway PID lock: Process 12345 running (127.0.0.1:8765)Port 127.0.0.1:8765: In use
start refuses, status reports it as running, and the lock is preserved. Before this fix, a cross-uid gateway could be silently displaced and a second gateway could start on the same bot token.Stop the existing gateway gracefully
SESSION_END event (had_pending_work, was_executing). Use --force to skip the drain. See Gateway Session Continuity.If gateway is stuck, force stop
If port is used by non-gateway process
Clean up stale lock file (if needed)
SSL Certificate Verify Failed on Start (Corporate Proxy / MITM)
Symptom:praisonai gateway start --config gateway.yaml fails with an SSLCertVerificationError in gateway doctor, but the same channel token works fine with --no-preflight.
Cause: Your network intercepts TLS with a corporate CA the probe’s HTTP client does not trust yet. The runtime bot adapter is often more permissive, so the token itself is usually fine.
Fix (pick one):
Point PraisonAI at your corporate CA (preferred)
PRAISONAI_SSL_CA_BUNDLE overrides any pre-existing SSL_CERT_FILE and REQUESTS_CA_BUNDLE for the probe.Use the standard SSL env vars
Skip the preflight check
gateway doctor run. A mixed SSL + token/network failure still hard-aborts. See Corporate CA bundle (SSL-inspecting networks).Gateway start aborts with ‘Turn pre-flight failed’
Symptom:praisonai gateway start exits with:
--verify-turn, on by default) sends one "ping" prompt to the agent and the model round-trip failed.
Fix (any of):
Add the model/provider API key
Reproduce interactively
Temporarily skip the turn check
gateway.preflight.verify_turn: false in bot.yaml. Use only when you know the model key is good (e.g. constrained/offline environments).--preflight — it catches most REASON_MISSING_KEY / REASON_AUTH_PERMANENT credential problems at startup instead of on the first inbound message. See Gateway Readiness → Turn pre-flight.Telegram Bot Goes Silent After Restart
Symptom: Gateway/health endpoint returns healthy, but Telegram messages aren’t received after a restart or crash.
Cause: Two processes are polling the same Telegram bot token. Telegram delivers messages to only one poller, causing the bot to appear “silent” when the wrong process gets the messages.
main: a gateway owned by another user is now treated as running, so its lock is preserved and a second gateway is refused rather than started on the same token. Before the fix, a foreign-uid gateway was reported dead, its lock was deleted, and a duplicate poller could start.Stop all gateway instances
Verify no processes are running
Gateway PID lock: No lock file foundPort 127.0.0.1:8765: Available
Start a single gateway instance
Test bot responsiveness
Daemon Running But Gateway Unreachable
Symptom:praisonai gateway status shows Daemon service: Running (launchd) but Gateway not reachable at http://127.0.0.1:8765/health.
Verify daemon is actually running
Running status and process ID.Check daemon logs for errors
Check port and PID lock status
Gateway PID lock: Process <pid> runningorNo lock file foundPort 127.0.0.1:8765: In useorAvailable
praisonai gateway stop to stop an existing gateway, or choose a different port.Verify PraisonAI version
Restart the daemon
Rapidly Growing Log Files
Symptom:~/.praisonai/logs/bot-stderr.log grows to multiple MB per minute.
Check log file size
View recent errors
Stop the daemon
Clear logs and restart
Daemon Not Installed
Symptom:praisonai gateway status shows Daemon service: Not installed (systemd).
Run the onboarding wizard
Verify installation
Installed but not running or Running.Start the service
HTTP 500 on Health Endpoint
Symptom:curl http://127.0.0.1:8765/health returns 500 Internal Server Error.
Check PraisonAI version
Upgrade PraisonAI
Restart the gateway
Test health endpoint
Windows: gateway status shows PID lock status: Unavailable
Symptom: praisonai gateway status prints an advisory PID-lock line, followed by a healthy gateway:
os.kill(pid, 0) — used by GatewayPIDLock._is_process_running to poll whether a lock is stale — can raise SystemError (“returned a result with an exception set”) instead of OSError / ProcessLookupError. Before PraisonAI v4.6.141 that exception propagated through GatewayHandler.status and short-circuited the /health probe, so operators saw no gateway status at all.
What v4.6.141 changes:
_is_process_runningnow catchesSystemErrorandValueErrorand returnsFalse(process not running).GatewayHandler.statustreats PID-lock inspection as advisory only. Any unexpected exception printsPID lock status: Unavailable (<error>)and the command continues to the/healthprobe.
Check your version
ERROR: Error checking gateway server status: returned a result with an exception set.Read the line as advisory
praisonai gateway status now prints PID lock status: Unavailable (<error>) followed by Gateway Status: healthy, the gateway is running — the PID line is advisory only.Confirm with the health endpoint
200 healthy response confirms the gateway is up regardless of the PID-lock line.Inspect the lock file if needed
pid, host, port, timestamp, and (since PR #4197) a create_time start-time fingerprint. The 5th line may be empty on older 4-line locks or when psutil is unavailable — the lock then degrades to the previous PID-only check. A stale PID is cleaned up automatically on the next start/stop/status call.Windows: ‘charmap’ codec error from Telegram bot replies
Symptom: Telegram users receiveError: 'charmap' codec can't encode character '⚠' in position N: character maps to <undefined> instead of the real error message.
Root cause: Windows default console encoding is cp1252, not UTF-8. When agent exceptions contained warning symbols (⚠), emoji, or accented text, the error formatter crashed before the real error could be reported.
Verify your version contains the fix
Upgrade to a fixed version
Restart the gateway
Test the fix
Error: API quota exceeded. Check billing.(was: charmap crash hiding OpenAI 429)Error: Rate limit exceeded. Try again later.Error: Authentication failed. Check API key.Error: Request timeout. Try again.
PYTHONUTF8=1 / PYTHONIOENCODING=utf-8 workaround is no longer required for the bot reply path (still useful for general console output).Permission Denied Errors
Symptom: Daemon fails to start with permission errors in logs.- macOS
- Linux
- Windows
Clean Reinstall Process
When all else fails, perform a clean reinstall:Stop and uninstall
Clear configuration
Upgrade PraisonAI
Run onboarding
Verify installation
Client stops reconnecting after agent_not_found
Symptom: GatewayClient logs Connection abandoned: agent_not_found (reconnect paused; not retrying) and stops attempting to connect, even though the gateway is healthy.
Cause: The agent_id supplied in the client’s hello frame is not registered on the gateway. The server emits agent_not_found with next_step: do_not_retry, and the client now correctly stops the reconnect loop instead of backing off forever.
Check the agent_id you pass
List agents registered on the gateway
Fix the id or register the agent
agent_id, or add the agent to the gateway configuration and restart it. Then call client.connect() again — the fresh call clears any stale backoff floor from the previous cycle.Surface the failure without log scraping
client.on_reconnect_paused before connect() gives you an immediate callback with (code, next_step) so the failure surfaces without waiting for a log scrape. See Gateway Client → Terminal vs Transient Connect Errors.Cross-instance messages not being delivered / Redis pub/sub outage
Symptom: Subscribers on gateway B stop seeing messages that were published on gateway A.praisonai gateway status shows push.redis_degraded: true and a growing push.redis_dropped_writes; health()["degraded_owners"] lists route:redis-pubsub.
Cause: The Redis pub/sub connection that fans out channel messages across gateway instances dropped. Cross-instance delivery pauses until the adapter reconnects.
Confirm the degraded owner and its retry_hint
push.redis_degraded: true and a route:redis-pubsub entry whose retry_hint points you at praisonai gateway doctor.Run gateway doctor
Verify Redis reachability from the gateway host
PONG confirms Redis is reachable; if it fails, fix the Redis connection or network path.route:redis-pubsub from degraded_owners. The log line to look for is Redis push adapter reconnected (server_id=<uuid>).
See Real-Time Push Notifications → HA & cross-instance delivery for the full contract.
Reading the hello_error Envelope
When the gateway rejects a connection, it sends a structuredhello_error frame before closing. Each (code, next_step) pair maps to a specific operator action.
ConnectRecoveryStep values.
Authentication Errors
GatewayStartupError: Cannot bind to 0.0.0.0 without an auth token
Symptom: Gateway fails to start when binding to external interfaces without authentication.Use onboarding wizard
Or set token manually
UIStartupError: Cannot bind to 0.0.0.0 with default admin/admin credentials
Symptom: Chainlit UI fails to start on external interface with default credentials.Set custom credentials
Or allow defaults for demos (unsafe)
Gateway refuses to start: gateway.auth_token is weak/placeholder
Symptom: doctor or start refuses with “gateway.auth_token is a known-weak/placeholder value”.
Preview the repair, then apply it — --fix mints a strong token and re-validates:
Preview (writes nothing, exits 1)
Apply (mints, persists, re-validates)
auth_token in gateway.yaml is rewritten in place. ${ENV} references are left alone — they resolve from ~/.praisonai/.env, which --fix already updated. See Gateway CLI › Auto-repair.
My gateway logs show gw_****xxxx instead of the full token
This is intentional for security — tokens are fingerprinted in logs to prevent exposure.
Retrieve full token from environment file
Or check environment variables
Magic-link login works in WebSocket but fails over HTTP (or vice versa)
Symptom: One auth method works but the other fails, even with the same token. Cause (pre-fix): HTTP/magic-link and WebSocket used different secret sources before PR #1744.Upgrade PraisonAI
Restart the gateway
Restart After Config Change
When you update bot configuration files, restart the daemon using these OS-specific commands (matching the onboard Done panel):- macOS
- Linux
- Windows
Diagnostic Commands
Quick commands for gathering diagnostic information:Platform-Specific Notes
- macOS
- Linux
- Windows
~/Library/LaunchAgents/ai.praison.bot.plist
Log Path: ~/.praisonai/logs/bot-stderr.logConfig reload did not apply
Symptom: You editedgateway.yaml or sent SIGHUP, but channels or agents still run the old configuration.
Multi-Channel Troubleshooting
Common failure modes when using multiple bots on the same platform:Channel Supervision Issues
Channel goes silent but /health shows running: true
Symptom: Channel stops receiving messages but/health still reports "running": true.
Cause: Pre-PR-2041 behaviour, or the health: block is missing from gateway.yaml — hung sockets are not detected until an exception is raised.
Fix: Add the proactive health block:
Channel keeps restarting every 5 minutes
Symptom: Channel restarts on a regular interval visible in logs. Cause:stale_after too low for a quiet channel, or interval too aggressive for a slow remote API.
Fix: Raise stale_after to e.g. 600, or lower max_restarts_per_hour so the cap kicks in and surfaces the issue:
Every channel restarts at once — fleet crash-loop breaker tripped
Symptom: One of:- Log line
Fleet crash-loop breaker TRIPPED: holding channel restarts (...). praisonai gateway statusshowsfleet.breaker_tripped: true.list_degraded()/GET /healthshows agatewayowner withowner_id: "fleet".
max_restarts_per_hour budget.
Diagnose the shared cause
Fix the underlying fault
Wait one cooldown, then confirm recovery
breaker_cooldown_s (default 120s). The breaker re-arms cleanly and the gateway/fleet degraded entry clears on the next monitor sweep — no manual poll needed. Confirm with:Channel Shows state: failed in /health
Symptom: When checkingGET /health, a channel shows "state": "failed" with error details.
Common Causes:
- Telegram Conflict: Multiple bot instances using the same token
- Invalid Credentials: Bot token revoked or incorrect
- Permission Issues: Bot lacks required permissions
Check Error Details
last_error and last_error_time fields.Telegram Conflict Resolution
Credential Verification
Channel Keeps Retrying Forever
Symptom: Hightotal_recoveries count, constant retry attempts visible in logs.
Investigation:
Config Migration
Whenpraisonai doctor --only gateway_config_migration reports Config can be migrated, your YAML uses a legacy shape that loads correctly but can be rewritten to the canonical format.
Detect migration opportunities
Understand auto-normalisation
GatewayConfigSchema already normalises legacy formats — your bot runs without rewriting the file. Persist the canonical form when you want the on-disk YAML to match what the schema produces.Apply canonical YAML
Environment Variables in Config
Gateway and bot configs support${VAR} substitution in any string value. Resolution order:
- Process environment variables
~/.praisonai/.env(loaded automatically; override path withPRAISONAI_ENV_FILE)
gateway_env_substitution doctor check.
Best Practices
Use praisonai gateway status first
Use praisonai gateway status first
praisonai gateway status before diving into logs - it shows port, PID, and daemon state in one command.Stop before restart
Stop before restart
praisonai gateway stop before restarting - this drains active sessions and prevents data loss.Use onboard for fresh installs
Use onboard for fresh installs
praisonai onboard - it handles daemon setup, credentials, and port configuration automatically.Check logs for crash loops
Check logs for crash loops
bot-stderr.log grows rapidly, you have a crash loop - stop the daemon, upgrade PraisonAI, then restart.
