Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #7313

Closed
Open
Created Jul 16, 2014 by Administrator@rootOwner

using markdown header in issue description cause 500 error on show.

Created by: aleiphoenix

Summary

Using any markdown header in issue description cause 500 error on showing the issue.

Only projects' issue in groups seems affected. Any project under user namespace cannot reproduce.

Environment:

  • ubuntu server 12.04.4
  • gitlab 7.0.0 (d1e424bd) installed with deb package (version 7.0.0-omnibus-1) .

Just for record, another instance setup by checking out from git (for testing purpose) can reproduce this issue too. git commit sha: d1e424bd

Steps to reproduce

  1. create a group (in my case, scm)
  2. create a project (in my case, gitlab-guideline)
  3. create a issue with any title (in my case 123)and markdown header in description

#1 will be rendered as

<div class="wiki">
<p><a class="gfm gfm-issue " href="http://my.domain/_scm/gitlab-guideline/issues/1" title="Issue: 123">#1</a></p>
</div>

#header will be rendered as

<div class="wiki">
<p>#header</p>
</div>

# (a sharp following with a space) will be rendered as

<div class="wiki">
</div>

# 1 or # anything will cause 500 on showing page. error message, stack trace

Started GET "/_scm/gitlab-guideline/issues/1" for 127.0.0.1 at 2014-07-16 11:13:19 +0800
Processing by Projects::IssuesController#show as HTML
  Parameters: {"project_id"=>"_scm/gitlab-guideline", "id"=>"1"}
Completed 500 Internal Server Error in 211ms

ActionView::Template::Error (undefined method `sha' for nil:NilClass):
    48:     .description
    49:       .wiki
    50:         = preserve do
    51:           = markdown @issue.description
    52:   .context
    53:     %cite.cgray
    54:       = render partial: 'issue_context', locals: { issue: @issue }
  app/helpers/gitlab_markdown_helper.rb:173:in `current_sha'
  app/helpers/gitlab_markdown_helper.rb:158:in `file_exists?'
  app/helpers/gitlab_markdown_helper.rb:149:in `path_with_ref'
  app/helpers/gitlab_markdown_helper.rb:110:in `rebuild_path'
  app/helpers/gitlab_markdown_helper.rb:66:in `block in create_relative_links'
  app/helpers/gitlab_markdown_helper.rb:65:in `each'
  app/helpers/gitlab_markdown_helper.rb:65:in `create_relative_links'
  lib/redcarpet/render/gitlab_html.rb:48:in `postprocess'
  app/helpers/gitlab_markdown_helper.rb:51:in `render'
  app/helpers/gitlab_markdown_helper.rb:51:in `markdown'
  app/views/projects/issues/show.html.haml:51:in `block in _app_views_projects_issues_show_html_haml___1089947713873513300_69936712251040'
  app/views/projects/issues/show.html.haml:50:in `_app_views_projects_issues_show_html_haml___1089947713873513300_69936712251040'
  app/controllers/projects/issues_controller.rb:58:in `show'

Suggestions

Could use some other notations for relative links. Native markdown syntax should not be changed IMHO.

Assignee
Assign to
Time tracking