Installation guide · Run the service
Health and logs
The image's own health check, and the logs the service writes.
The image checks itself every 30 seconds, after a 90-second start period, by asking the service on 127.0.0.1 inside the container. To see the result, run:
docker inspect --format '{{.State.Health.Status}}' sequences
healthy means the service answers. At start the service may wait up to 50 seconds for the lock (.lock) that a crashed container left on the data volume to expire. See Upgrades.
Docker restarts a container only when it exits, not when it fails its health check, so the check does the rest. After the start period, when it has failed 3 times in a row, about 90 seconds, and Docker marks the container unhealthy, the check stops the service. The container exits, and its restart rule starts it again: --restart unless-stopped in this guide's commands, or the AWS kit's service unit, which starts it 10 seconds after it stops. The log says:
The health check failed 3 times in a row, so it stopped the service (SIGTERM). The container's restart rule starts it again.
A service that still fails the next check is ended (SIGKILL). A stop by the check is like any other stop for the searches the server runs. A worker gives its searches back to the queue, or, if it was ended, they go back a minute later, counted as cut off once; when it starts again it joins its coordinator, as at any start. A container started without a restart rule, such as one run with docker run --rm, stays stopped. A one-off container of the image, such as one that runs load, audit-export or a backup's tar, runs no service, so there the check only reports and stops nothing.
Measured on release 0.92.0: a service frozen in the middle of its searches, so that it stopped answering while its container still ran, was started again by the check and its restart rule 142 seconds after it froze on a worker, and 111 seconds on a coordinator. Every search of the batch completed once.
A worker opens no port, so its health check reads the state the worker writes to its data volume every 10 seconds instead. It is healthy while the worker writes it and its coordinator has not refused it. A worker that cannot reach its coordinator stays healthy, says so in its log and tries again every 20 seconds. See Several servers.
For an uptime monitor outside the container, read https://sequences.example.org/api/health with sign-in on, or http://127.0.0.1:8765/api/health on the machine itself. It needs no sign-in. It answers 200 with {"ok":true} when BLAST+ answers and a snapshot is installed, and 503 with {"ok":false} otherwise. It says nothing else, and it asks the search tools at most every 30 seconds however often it is read. With sign-in on, it also answers at the server's IP address, for a load balancer's health check, which cannot name your host. Nothing else answers there.
The service writes its log to standard output and standard error, so docker logs sequences shows it:
- At start: the host names and issuer (sign-in on) or the local address (sign-in off), the license summary, the data folder, the paper folder if you set one, whether watch emails are on and with or without details, the ROR release that applicant suggestions come from, or that they are off, the add-ons that run (
Add-ons: none.when none do), and the records it skipped because it cannot read them. - Sign-in problems, such as a provider that cannot be reached, a token that fails a check, or an account that is refused, with the reason.
- A license file or invite list that cannot be read.
- Each API token made or revoked, with the account and the token's name, never the token itself.
- On a coordinator: the worker port; each worker that joins, drains, leaves, is lost or is refused; and each search that waits in the queue again, or fails, because its worker stopped answering or sent a result that failed a check. On a worker: its coordinator, whether its copies match, and each search it runs, with its hits and time.
The log names an account by a short form of its ID, never by its email address, and leaves out any address a mail service's answer holds.
A search's job.json, a database's manifest.json or the run-time estimates (calibration.json) that cannot be read, such as one a full disk cut off, does not stop the start or empty a list. The service skips the file and leaves it on disk as it is: that search or database is not listed, and the estimates start from their first values and do not write over the file. The start log names each one, such as Skipped 1 record that cannot be read. Each stays on disk in the data folder: jobs/<id>/job.json. To get one back, restore it from a backup (see Backups): a database shows again at once, a search and the estimates at the next start.
Sign-ins, API tokens, starts, invite file changes and a coordinator's workers also go into the service's audit log on the data volume, which keeps them. See Audit export for a SIEM.
Queries, sequences and results are never written to the log. Docker keeps logs without a size limit unless you set one. These options to docker run keep five files of 10 MB:
--log-opt max-size=10m --log-opt max-file=5
Guide version 1.63.0 · For Sequences 0.155.0