Linux Labs

Observability: metrics, alerts, logs / Stage 8 of 9

Investigating with logs

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 6 · lab · 25 minmedium

The site returns 500

From some moment on the hotel booking site answers its guests with error 500, and the nginx error.log is empty. Work out from the logs when the outage began and what caused it, write that down and bring the site back.

Situation

The hotel booking site is http://booking.lab.test/: nginx takes the requests and passes them to the lab-booking application. Guests write that the site answers "500 Internal Server Error". The on-call engineer has already opened the site's error.log — it is empty. The team lead asks for a short report: from what moment the site has been broken and which line in the logs explains it. And the site has to be brought back.

The site logs are /var/log/nginx/booking.access.log and /var/log/nginx/booking.error.log; the application writes to the systemd journal. Both are read with sudo.

Task

  1. Write to ~/incident.txt: - as the first line — the time the outage began, to the second (from then on the site returns 500), in the form the journal or access.log uses: 2026-10-22 04:41:25 or 22/Oct/2026:04:41:25; - below it — the line from the application journal that shows the cause of the 500 answers.
  2. http://booking.lab.test/ answers 200 again, and the page comes from the lab-booking application.
  3. The site answers 200 after the application restarts too: sudo systemctl restart lab-booking.

Constraints

  • Do not change the application code /opt/booking/booking.py — look for the cause in its settings and fix it there.
  • The check itself restarts lab-booking and requests the site with a tag in the address: the answer must come from the application, not from nginx.

Visitors keep coming to the site while you investigate — new lines keep appearing in the logs.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 4
  • http://booking.lab.test/ answers 200 — the page comes from the lab-booking application, its code is unchanged — not done yet
  • The first line of ~/incident.txt holds the time the outage began, to the second — from then on the site returns 500 — not done yet
  • ~/incident.txt contains a line from the application journal that shows the cause of the 500 answers — not done yet
  • The site answers 200 after the application restarts too: sudo systemctl restart lab-booking — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 4
  • http://booking.lab.test/ answers 200 — the page comes from the lab-booking application, its code is unchanged — not done yet
  • The first line of ~/incident.txt holds the time the outage began, to the second — from then on the site returns 500 — not done yet
  • ~/incident.txt contains a line from the application journal that shows the cause of the 500 answers — not done yet
  • The site answers 200 after the application restarts too: sudo systemctl restart lab-booking — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 4
  • http://booking.lab.test/ answers 200 — the page comes from the lab-booking application, its code is unchanged — not done yet
  • The first line of ~/incident.txt holds the time the outage began, to the second — from then on the site returns 500 — not done yet
  • ~/incident.txt contains a line from the application journal that shows the cause of the 500 answers — not done yet
  • The site answers 200 after the application restarts too: sudo systemctl restart lab-booking — not done yet
Loading…