docs/en/others/diagnostics.md
This page provides a general checklist for diagnosing AstrBot issues. When something goes wrong, first identify which stage is affected, then collect the relevant logs. This makes issue reports easier to reproduce and investigate.
Start with the main AstrBot log:
data/logs/astrbot.log
For Docker deployments, also check container logs:
docker logs <container-name>
If the issue involves slow tasks, abnormal CPU usage, or multiple sessions becoming slow at the same time, also check the event loop diagnostic logs:
data/logs/event_loop_watchdog.log
data/logs/event_loop_watchdog.log.1
event_loop_watchdog.log rotates to .1 after it exceeds 1 MB.
The event loop schedules messages, plugins, scheduled jobs, model requests, and tool calls. If it is blocked by synchronous code, many features can look delayed at once.
Common symptoms:
ready to request llm provider, acquired session lock for llm request, or a tool result, then continue much later.If the main log contains the following entry, the event loop experienced visible scheduling delay:
Event loop lag detected: 18.432s (threshold 15.000s).
If the event loop does not resume for a long time, AstrBot writes Python thread stacks to:
data/logs/event_loop_watchdog.log
When reading this file, focus on the top frames. Useful clues often include plugin functions, platform adapters, MCP tools, synchronous network requests, time.sleep(), subprocess.run(), or CPU-heavy loops.
When filing an issue, include as much of the following as possible:
data/logs/astrbot.log for 1 to 3 minutes around the incident.data/logs/event_loop_watchdog.log and data/logs/event_loop_watchdog.log.1.docker logs output.Before sharing logs, redact API keys, tokens, cookies, private chat content, and other sensitive information.