-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
When running sameersbn/docker-gitlab, the generated file:
/home/git/gitlab/gitlab-pages-config
contains an unresolved template placeholder:
internal-gitlab-server=http://127.0.0.1:8080{{GITLAB_RELATIVE_URL_ROOT}}
api-secret-key=/home/git/gitlab/.gitlab_pages_secret
Because {{GITLAB_RELATIVE_URL_ROOT}} is not replaced during configuration rendering, gitlab-pages fails to start with a URL parsing error.
Even when GITLAB_RELATIVE_URL_ROOT is explicitly set to an empty value, the placeholder is not rendered and remains in the generated config file.
Error
gitlab-pages fails with:
parse "http://127.0.0.1:8080{{GITLAB_RELATIVE_URL_ROOT}}/api/v4": invalid port ":8080{{GITLAB_RELATIVE_URL_ROOT}}" after host
Supervisor log:
invalid config settings:
* parse "http://127.0.0.1:8080{{GITLAB_RELATIVE_URL_ROOT}}/api/v4": invalid port ":8080{{GITLAB_RELATIVE_URL_ROOT}}" after host
Steps to Reproduce
- Deploy
sameersbn/docker-gitlab - Enable GitLab Pages
- Do NOT use a relative URL root (standard root deployment)
- Start the container
- Inspect the generated file:
cat /home/git/gitlab/gitlab-pages-config
The placeholder {{GITLAB_RELATIVE_URL_ROOT}} remains unresolved.
gitlab-pagesfails to start.
Environment
- Image:
sameersbn/gitlab:18.8.4 - Deployment method: Docker (compose)
- No
GITLAB_RELATIVE_URL_ROOTneeded (root deployment) - Also tested with:
GITLAB_RELATIVE_URL_ROOT=
Same issue.
Mounted volumes:
/home/git/data (bind mount)
/var/log/gitlab (volume)
Investigation
Template files contain the placeholder:
/etc/docker-gitlab/runtime/config/gitlab-pages/config
The generated file:
/home/git/gitlab/gitlab-pages-config
is copied but the placeholder is not rendered or replaced.
Other config files appear to handle GITLAB_RELATIVE_URL_ROOT correctly (some remove lines containing the placeholder), but this one does not.
Temporary Workaround
Manually patching the generated file resolves the issue:
sed -i "s/{{GITLAB_RELATIVE_URL_ROOT}}//g" /home/git/gitlab/gitlab-pages-config
supervisorctl restart gitlab-pages
After this, gitlab-pages starts correctly.
However, this must be reapplied after container restart.
Expected Behavior
If GITLAB_RELATIVE_URL_ROOT is:
- undefined → placeholder should resolve to empty
- explicitly set to empty → placeholder should resolve to empty
- set to
/gitlab→ placeholder should resolve to/gitlab
The placeholder should never remain literal in generated runtime config.