Issue contents dynamically replaced with stale version after saving or refreshing (relative external_url only)
When a GitLab 9.2.2 instance is configured with a relative URL via external_url
e.g. external_url 'http://localhost:8081/test'
, issue edits appear not to save correctly. After clicking "Save changes", the new description briefly appears, but is then replaced by the old description. This behavior does not occur when a relative URL is not used.
The .../issues/N/rendered_title
resource appears to be at fault. The browser continuously fetches it, but receives a 304 response even if the issue has changed, so it continues to use the old issue data. To prevent this one must clear the browser cache or do a hard-refresh e.g. Ctrl-Shift-R, Shift-F5.
docker-compose.yml that works correctly:
gitlab:
image: gitlab/gitlab-ce:9.2.2-ce.0
ports: ['8081:80']
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost:8081'
nginx['listen_port'] = 80
volumes:
- /home/user/test/etc:/etc/gitlab
- /home/user/test/log:/var/log/gitlab
- /home/user/test/data:/var/opt/gitlab
docker-compose.yml that reproduces issue:
gitlab:
image: gitlab/gitlab-ce:9.2.2-ce.0
ports: ['8081:80']
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost:8081/test'
nginx['listen_port'] = 80
volumes:
- /home/user/test/etc:/etc/gitlab
- /home/user/test/log:/var/log/gitlab
- /home/user/test/data:/var/opt/gitlab
Steps to reproduce
docker-compose down
rm -rf etc log data
mkdir etc log data
docker-compose up -d --build
- Browse to configured
external_url
- Set root ("Administrator") password
- Log in as root ("Administrator")
- Create project
- Create issue
- Save issue
- Wait a few seconds for
rendered_title
request to occur - Edit issue description
- Save issue
- Observe described behavior
- Refresh page
- Observe described behavior
Speculation
- Cached ETag for
rendered_title
not being invalidated in Redis? - Related: !10865 (merged) #31947 (closed)
Workaround
Prevent the browser from caching rendered_title
at all:
gitlab:
image: gitlab/gitlab-ce:9.2.2-ce.0
ports: ['8081:80']
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost:8081/test'
nginx['listen_port'] = 80
nginx['custom_gitlab_server_config'] = <<EOF
location ~ /rendered_title$$ {
add_header Cache-Control "no-cache, no-store, must-revalidate";
proxy_pass http://gitlab-workhorse;
}
EOF
volumes:
- /home/user/test/etc:/etc/gitlab
- /home/user/test/log:/var/log/gitlab
- /home/user/test/data:/var/opt/gitlab
Edited by Sam Harada