[go: up one dir, main page]

Skip to content

Middleware incorrectly treats healthcheck URL as project namespace

Summary

When the namespace-in-path=true option is enabled, the middleware incorrectly treats the healthcheck URL as a project namespace. This behavior is incorrect because the healthcheck URL should not be considered a part of any project’s namespace.

Steps to reproduce

  1. Install Gitlab with official helm chart.
  2. Set up GitLab Pages with namespace-in-path=true.
  3. Ensure the healthcheck endpoint is set (pages-status=/-/readiness or similar). Access the healthcheck URL (e.g., http://pages.example.com/-/readiness).

What is the current bug behavior?

As namespaceInPath middleware has higher priority than health one, it produces error message.

What is the expected correct behavior?

Readiness probes shouldn't be treated as project namespace.

Relevant logs and/or screenshots

{"error":"URL does not match pages domain","level":"error","msg":"can't convert URL","orig_host":"10.111.2.130:9090","orig_path":"/-/readiness","pages_domain":"pages.example.com","time":"2024-09-25T08:49:25Z"} {"content_type":"","correlation_id":"01J8M5XY8X14PCHB42HCGTWQWX","duration_ms":0,"host":"10.111.2.130:9090","level":"info","method":"GET","msg":"access","pages_https":false,"proto":"HTTP/1.1","referrer":"","remote_addr":"10.111.2.1:37160","remote_ip":"10.111.2.1","status":200,"system":"http","time":"2024-09-25T08:49:25Z","ttfb_ms":0,"uri":"/-/readiness","user_agent":"kube-probe/1.29","written_bytes":8}

Possible fixes

May be reordering this particular middlewares could solve the issue.

Implementation guide

Either bypass namespace in path logic for healthcheck url or investigate a better approach after debugging. This can be tested in local GDK setup.

Edited by Naman Jagdish Gala