Pages "auto" configuration source doesn't work as expected
After 13.7
some people started to have problems with gitlab-pages. Most common symptom: pages are available 50% of the time.
The problem is only present if people have multiple servers running both pages and gitlab-rails
(see below)
Consider this setup
- client has gitlab instance "gitlab.example.com"
- and multiple servers running both
gitlab-rails
andgitlab-pages
simultaneously
How "auto" currently works
- During startup
gitlab-pages
checks if the API is available multiple times until it gets200 OK
in response. Which it eventually does because there is a load balancer for "gitlab.example.com" and eventuallygitlab-pages
hits the same server as one it's running on. - Then
gitlab-pages
remembers thatAPI is functioning
and will serve502
errors if it isn't.
Workaround
- run steps 8-10 in https://docs.gitlab.com/13.7/ee/administration/pages/index.html#running-gitlab-pages-on-a-separate-server
- or explicitly set
gitlab_pages['domain_config_source'] = "disk"
as described in https://docs.gitlab.com/ee/administration/pages/#gitlab-api-based-configuration (not recommended, because in %14.0 this option will be removed and you'll need to do the first option anyway)
Suggested fix
change "auto" behavior: if we ever fail to access API with unauthorized error - fallback to disk. (do not do this if gitlab
is set explicitly).
Edited by Vladimir Shushlin