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
  • #3257

Closed
Open
Created Mar 19, 2013 by Administrator@rootOwner

wiki page fails with error 500 if source code highlighter language doesn't exist

Created by: rriemann

I used gollum to push this wiki markdown to the gitlab instance:

```yml
  ## Backup settings
  backup:
    # path: "tmp/backups"   
    keep_time: 604800   # default: 0 (forever) (in seconds)
```

I would expect that a fallback of no highlighting at all would be used instead of raising an error.

The page could not be rendered. production.log gives:

  Completed 500 Internal Server Error in 1908ms

  ActionView::Template::Error (Traceback (most recent call last):
    File "/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/gitlab-pygments.rb-0.3.2/lib/pygments/mentos.py", line
  303, in start
      res = self.get_data(method, lexer, args, kwargs, text)
    File "/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/gitlab-pygments.rb-0.3.2/lib/pygments/mentos.py", line
  171, in get_data
      res = self.highlight_text(text, lexer, formatter_name, args, _convert_keys(opts))
    File "/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/gitlab-pygments.rb-0.3.2/lib/pygments/mentos.py", line
  122, in highlight_text
      lexer = self.return_lexer(lexer, args, kwargs, code)
    File "/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/gitlab-pygments.rb-0.3.2/lib/pygments/mentos.py", line 79, in return_lexer
      return lexers.get_lexer_by_name(lexer, **inputs)
    File "/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/gitlab-pygments.rb-0.3.2/vendor/pygments-main/pygments/lexers/__init__.py", line 80, in get_lexer_by_name
      raise ClassNotFound('no lexer for alias %r found' % _alias)
  ClassNotFound: no lexer for alias 'yml' found
  ):
      11: .file_holder
      12:   .file_content.wiki
      13:     = preserve do
      14:       = render_wiki_content(@wiki)
      15: 
      16: - commit = CommitDecorator.new(@wiki.version)
      17: %p.time Last edited by #{commit.author_link(avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago
    lib/redcarpet/render/gitlab_html.rb:25:in `block_code'
    app/helpers/gitlab_markdown_helper.rb:50:in `render'
    app/helpers/gitlab_markdown_helper.rb:50:in `markdown'
    app/helpers/gitlab_markdown_helper.rb:55:in `render_wiki_content'
    app/views/wikis/show.html.haml:14:in `block in _app_views_wikis_show_html_haml__547832907_100044020'
    app/views/wikis/show.html.haml:13:in `_app_views_wikis_show_html_haml__547832907_100044020'
    app/controllers/wikis_controller.rb:15:in `show'
Assignee
Assign to
Time tracking