Skip to content

Disable gitlab-workhorse static error page on health endpoints

Adrien Kohlbecker requested to merge ak/health-check-custom-error into master

What does this MR do?

Additional fix to #23927 (closed)

When the health probes raise an error, they return an HTTP error 503 accompanied by JSON detailing which probe has failed.

Unfortunately, gitlab-workhorse intercepts any HTTP error and substitutes a static, HTML error page. The expected behavior is for workhorse to not overwrite this response, so users can see probe results.

This MR makes use of the X-Gitlab-Custom-Error header, supported by workhorse here https://gitlab.com/gitlab-org/gitlab-workhorse/blob/master/internal%2Fstaticpages%2Ferror_pages.go#L57 to disable rewriting of the response and pass the probe results to the user.

It also adds a detailed spec of the readiness error case, which was absent until now

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports