Observability: metrics, alerts, logs / Stage 8 of 9 · step 5 of 6
The site returns 500
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
- 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:25or22/Oct/2026:04:41:25; - below it — the line from the application journal that shows the cause of the 500 answers. http://booking.lab.test/answers200again, and the page comes from thelab-bookingapplication.- The site answers
200after 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-bookingand 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 goals
0 of 4-
http://booking.lab.test/ answers 200 — the page comes from the lab-booking application, its code is unchanged — not checked yet
-
The first line of ~/incident.txt holds the time the outage began, to the second — from then on the site returns 500 — not checked yet
-
~/incident.txt contains a line from the application journal that shows the cause of the 500 answers — not checked yet
-
The site answers 200 after the application restarts too: sudo systemctl restart lab-booking — not checked yet