Intermittent 502 errors or after a few days
If you run Pages on a system that uses systemd and tmpfiles.d, you may encounter intermittent 502 errors trying to serve Pages with an error similar to:
dial tcp: lookup gitlab.example.com on [::1]:53: dial udp [::1]:53: connect: no route to host"
GitLab Pages creates a bind mount inside /tmp/gitlab-pages-* that includes files like /etc/hosts. However, systemd may clean the /tmp/ directory on a regular basis so the DNS configuration may be lost.
- To stop systemd from cleaning the Pages related content: 1. Tell tmpfiles.d to not remove the Pages /tmp directory:
echo 'x /tmp/gitlab-pages-*' >> /etc/tmpfiles.d/gitlab-pages-jail.conf
- Restart GitLab Pages:
sudo gitlab-ctl restart gitlab-pages