Error logs
For platform operators. These tasks affect the whole deployment. Have server access or platform admin rights as the task requires. Start with the administrator manual.
OpenBot writes a log line at level Error when something fails on the server.
OpenBot does not send these logs to other services. You can add this yourself
with an Effect logger.
What OpenBot logs
Section titled “What OpenBot logs”| Source | When |
|---|---|
http |
A request ends with a status of 500 or higher. |
turn |
A Turn ends with the status Failed. |
startup |
OpenBot fails to start, for example because of bad configuration. |
Normal request errors, such as 400, 401, 404, or 409, are not logged as
errors. Work that a person interrupts on purpose is not logged either.
Each error log has the message OpenBot operation failed and these annotations.
An annotation is a named value that is attached to a log line.
| Annotation | Meaning |
|---|---|
source, operation |
Which part of OpenBot failed. |
errorType |
A short name for the error, when OpenBot knows one. |
requestId, method, route, status |
For HTTP failures. route is the route pattern, not the real path. |
chatId, turnId |
For Turn failures. |
The log also has the cause of the failure. The cause can hold error messages and other private data.
An inside failure, such as a database error, is often the reason for a 503.
OpenBot does not send the inside failure to the client. It writes it first in a
log line at level Warn, with the cause and the place in the code where it
happened. Every log line of a request has the same requestId as the error log
of that request. Use it to find the reason for a failed request.
When a Turn fails, the client gets only a short message. A model error, such as
input that is too large for the model, keeps its message and has the code
model_error. Every other failure, such as a database error, has the code
internal_error and a fixed message. The full cause is in a log line at level
Warn with the message A Turn failed. It has the same chatId and turnId
as the error log.
Background work
Section titled “Background work”OpenBot also does work in the background. For example, it fires the Triggers that are due, deletes old files, pauses idle Computers, checks Apps for the App Index, and listens for changes to the settings. It also pauses delegated work at its time limit, sends reminders, sends the messages of Channels, and listens for calls from its other instances.
When one run of this work fails, OpenBot writes a log line at level Warn with
the cause. Then it runs the work again at the next time. The work does not stop.
These lines are at level Warn, not Error, because the work goes on. A few
steps often fail for a reason that does no harm, for example a Chat that another
instance works on. The next run does them again, so their lines are at level
Debug.
When the server stops, the background work stops too. This is not logged as a failure.
Send errors to your own service
Section titled “Send errors to your own service”For this development task, see Add an error logger.