Snippets containing partial URLs return 500 error after upgrade
Summary
Pre-existing snippet which contains partial URL results in 500 error when visiting in front-end, used to work but now fails after upgrade of gitlab. Possibly something to do with marking up the content, and being confused by incomplete URLs.
Steps to reproduce
Run gitlab omnibus 11.7.0-ce.0 Create a snippet containing a partial URL - here's some of the snippet content causing the issue:
SET rewards_system_url_c = replace(rewards_system_url_c, 'https:// ', 'http://stage.');\r+
SET rewards_system_url_c = replace(rewards_system_url_c, 'https:// ', 'http://stage.');
Upgrade gitlab omnibus to 11.7.5-ce.0
Visit the snippet page (it is listed fine in the snippets explore view)
What is the current bug behavior?
Visiting the snippet results in a 500 error
What is the expected correct behavior?
The snippet page should be shown without error
Relevant logs
Relevant logs
Started GET "/snippets/45" for 127.0.0.1 at 2019-02-13 10:40:05 +1300 Processing by SnippetsController#show as HTML Parameters: {"id"=>"45"} Completed 500 Internal Server Error in 37ms (ActiveRecord: 4.2ms)ActionView::Template::Error (Absolute URI missing hierarchical segment: 'https://'): 18: 19: .snippet-header.limited-header-width 20: %h2.snippet-title.prepend-top-0.append-bottom-0 21: = markdown_field(@snippet, :title) 22: 23: - if @snippet.description.present? 24: .description
lib/banzai/filter/autolink_filter.rb:117:in
autolink_match' lib/banzai/filter/autolink_filter.rb:127:in
block in autolink_filter' lib/gitlab/string_range_marker.rb:39:inblock in mark' lib/gitlab/string_range_marker.rb:35:in
each' lib/gitlab/string_range_marker.rb:35:ineach_with_index' lib/gitlab/string_range_marker.rb:35:in
mark' lib/gitlab/string_regex_marker.rb:15:inmark' lib/banzai/filter/autolink_filter.rb:126:in
autolink_filter' lib/banzai/filter/autolink_filter.rb:63:inblock in call' lib/banzai/filter/autolink_filter.rb:58:in
call' lib/banzai/pipeline/base_pipeline.rb:23:inblock (2 levels) in singleton class' lib/banzai/renderer.rb:110:in
render_result' lib/banzai/renderer.rb:141:inblock in cacheless_render' lib/gitlab/metrics/influx_db.rb:100:in
measure' lib/banzai/renderer.rb:140:incacheless_render' lib/banzai/renderer.rb:52:in
cacheless_render_field' app/models/concerns/cache_markdown_field.rb:87:inblock in refresh_markdown_cache' app/models/concerns/cache_markdown_field.rb:84:in
map' app/models/concerns/cache_markdown_field.rb:84:inrefresh_markdown_cache' app/models/concerns/cache_markdown_field.rb:96:in
refresh_markdown_cache!' lib/banzai/renderer.rb:42:inrender_field' lib/banzai.rb:16:in
render_field' app/helpers/markup_helper.rb:111:inmarkdown_field' app/views/shared/snippets/_header.html.haml:21:in
_app_views_shared_snippets__header_html_haml___1921799186928429406_70342155656620' app/views/snippets/show.html.haml:7:in_app_views_snippets_show_html_haml___2258449966983203307_70342157207860' app/controllers/application_controller.rb:113:in
render' app/controllers/snippets_controller.rb:76:inblock (2 levels) in show' app/controllers/snippets_controller.rb:74:in
show' lib/gitlab/i18n.rb:55:inwith_locale' lib/gitlab/i18n.rb:61:in
with_user_locale' app/controllers/application_controller.rb:417:inset_locale' lib/gitlab/middleware/multipart.rb:103:in
call' lib/gitlab/request_profiler/middleware.rb:16:incall' lib/gitlab/middleware/go.rb:20:in
call' lib/gitlab/etag_caching/middleware.rb:13:incall' lib/gitlab/middleware/correlation_id.rb:16:in
block in call' lib/gitlab/correlation_id.rb:15:inuse_id' lib/gitlab/middleware/correlation_id.rb:15:in
call' lib/gitlab/middleware/read_only/controller.rb:40:incall' lib/gitlab/middleware/read_only.rb:18:in
call' lib/gitlab/middleware/basic_health_check.rb:25:incall' lib/gitlab/request_context.rb:20:in
call' lib/gitlab/metrics/requests_rack_middleware.rb:29:incall' lib/gitlab/middleware/release_env.rb:13:in
call'
Details of package version
Provide the package version installation details
ii gitlab-ce 11.7.5-ce.0 amd64 GitLab Community Edition (including NGINX, Postgres, Redis)
Environment details
- Operating System: debian 8.11
- Installation Target, remove incorrect values:
- VM: Other
libvirt/kvm
- VM: Other
- Installation Type, remove incorrect values:
- Upgrade from version
11.7.0-ce.0
- Upgrade from version
- Is there any other software running on the machine:
no
- Is this a single or multiple node installation?
single
- Resources
- CPU:
3xQEMU Virtual
- Memory total:
6GB
- CPU:
Configuration details
Provide the relevant sections of `/etc/gitlab/gitlab.rb`
gitlab_rails['time_zone'] = 'Pacific/Auckland' nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/*.conf;"