500 errors when viewing wiki pages
Some URLs are causing HTTP 500
errors.
Some examples of these are:
This is an ASCIIDOC page that renders correctly locally in gollum.
Current behaviour
This causes pages not to render, and denies access to wiki functionality. No user remediation is possible.
The following error is found in Sentry:
ActionView::Template::ErrorProjects::WikisController#show
error asciidoctor: FAILED: <stdin>: Failed to load AsciiDoc document - no implicit conversion of nil into String
Stack trace:
TypeError: no implicit conversion of nil into String
from gitlab/asciidoc/include_processor.rb:102:in `initialize'
from gitlab/asciidoc/include_processor.rb:102:in `Pathname'
from gitlab/asciidoc/include_processor.rb:102:in `resolve_relative_path'
from gitlab/asciidoc/include_processor.rb:42:in `resolve_target_path'
from asciidoctor/include_ext/include_processor.rb:48:in `process'
from asciidoctor/reader.rb:1037:in `[]'
from asciidoctor/reader.rb:1037:in `preprocess_include_directive'
from asciidoctor/reader.rb:857:in `process_line'
from asciidoctor/reader.rb:138:in `peek_line'
from asciidoctor/reader.rb:652:in `peek_line'
from asciidoctor/reader.rb:283:in `skip_blank_lines'
from asciidoctor/parser.rb:424:in `next_section'
from asciidoctor/parser.rb:364:in `next_section'
from asciidoctor/parser.rb:364:in `next_section'
from asciidoctor/parser.rb:369:in `next_section'
from asciidoctor/parser.rb:97:in `parse'
from asciidoctor/document.rb:549:in `parse'
from asciidoctor/load.rb:83:in `load'
from asciidoctor/convert.rb:78:in `convert'
from gitlab/asciidoc.rb:46:in `render'
from markup_helper.rb:264:in `asciidoc_unsafe'
from markup_helper.rb:150:in `markup_unsafe'
from markup_helper.rb:139:in `render_wiki_content'
from /opt/gitlab/embedded/service/gitlab-rails/app/views/projects/wikis/show.html.haml:30:in `_app_views_projects_wikis_show_html_haml___3792145753279234218_70089125281460'
from action_view/template.rb:159:in `block in render'
from active_support/notifications.rb:170:in `instrument'
from action_view/template.rb:354:in `instrument_render_template'
from action_view/template.rb:157:in `render'
from action_view/renderer/template_renderer.rb:54:in `block (2 levels) in render_template'
from action_view/renderer/abstract_renderer.rb:44:in `block in instrument'
from active_support/notifications.rb:168:in `block in instrument'
from active_support/notifications/instrumenter.rb:23:in `instrument'
from active_support/notifications.rb:168:in `instrument'
from action_view/renderer/abstract_renderer.rb:43:in `instrument'
from action_view/renderer/template_renderer.rb:53:in `block in render_template'
from action_view/renderer/template_renderer.rb:61:in `render_with_layout'
from action_view/renderer/template_renderer.rb:52:in `render_template'
from action_view/renderer/template_renderer.rb:16:in `render'
from action_view/renderer/renderer.rb:44:in `render_template'
from action_view/renderer/renderer.rb:25:in `render'
from action_view/rendering.rb:103:in `_render_template'
from action_controller/metal/streaming.rb:219:in `_render_template'
from action_view/rendering.rb:84:in `render_to_body'
from action_controller/metal/rendering.rb:52:in `render_to_body'
from action_controller/metal/renderers.rb:142:in `render_to_body'
from abstract_controller/rendering.rb:25:in `render'
from action_controller/metal/rendering.rb:36:in `render'
from action_controller/metal/instrumentation.rb:46:in `block (2 levels) in render'
from active_support/core_ext/benchmark.rb:14:in `block in ms'
from benchmark.rb:308:in `realtime'
from active_support/core_ext/benchmark.rb:14:in `ms'
from action_controller/metal/instrumentation.rb:46:in `block in render'
from action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
from active_record/railties/controller_runtime.rb:31:in `cleanup_view_runtime'
from elasticsearch/rails/instrumentation/controller_runtime.rb:20:in `cleanup_view_runtime'
from action_controller/metal/instrumentation.rb:45:in `render'
from application_controller.rb:121:in `render'
from projects/wikis_controller.rb:42:in `show'
This appears to indicate that an include fails to load.
Expected behaviour
This should render correctly, or allow user remediation
Edited by Alex Kalderimis