Fix health checks routes incorrectly intercepting errors
While investigating gitlab#22975 (closed) I discovered that gitlab-workhorse is configured to respond to errors with static html pages.
In case of the health check endpoints, we actually want plain text (for /-/health
) and json (for /-/readiness
and /-/liveness
).
This MR does two things:
- Removes the static error page middleware for health endpoints, now errors returned by upstream are passed to the user
- Intercepts health endpoints in the 502 handler, called when gitlab itself is down, and return the correct JSON instead of text
An additional MR is open to propagate the same fix to the nginx configuration: omnibus-gitlab!3594 (merged)
Edited by 🤖 GitLab Bot 🤖