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

Closed
Open
Created Jul 01, 2013 by Administrator@rootOwner

Wiki codeblock lexer causing 500 errors (introduced since v5.3)

Created by: ajvwhite

Summary

When attempting to write a block similar to:

    ```text
    Some text to highlight in a text only code block
    ```

It causes a 500 error, but this worked fine in v5.2.

Steps to reproduce

  1. Make sure you are using v5.3
  2. Create or edit a wiki page
  3. In the page attempt to utilise the "text" lexer (as shown in the summary above)
  4. Try the view the page

Expected behaviour

For the wiki page to display with the code block highlight with no syntax highlighting as per the "text" lexer (e.g. the code blocks on this issue page is using the same lexer)

Relevant logs and/or screen shots

The log output for the error is below:

Started GET "/general/wiki/wikis/home" for  at 2013-07-01 16:08:55 +0100
Processing by WikisController#show as HTML
  Parameters: {"project_id"=>"general/wiki", "id"=>"home"}
  Rendered wikis/_new.html.haml (1.9ms)
  Rendered wikis/_nav.html.haml (17.8ms)
  Rendered wikis/_main_links.html.haml (12.9ms)
  Rendered wikis/show.html.haml within layouts/project_resource (38.1ms)
  Rendered layouts/_head.html.haml (2.7ms)
  Rendered layouts/_search.html.haml (42.7ms)
  Rendered layouts/_head_panel.html.haml (49.7ms)
  Rendered layouts/_init_auto_complete.html.haml (11.3ms)
  Rendered layouts/_flash.html.haml (0.2ms)
  Rendered shared/_no_ssh.html.haml (1.5ms)
  Rendered layouts/nav/_project.html.haml (37.8ms)
Completed 200 OK in 245ms (Views: 154.9ms | ActiveRecord: 10.3ms)
Started GET "/assets/logo-white.png" for  at 2013-07-01 16:08:56 +0100
Served asset /logo-white.png - 304 Not Modified (0ms)
Started GET "/assets/icon-search.png" for  at 2013-07-01 16:08:56 +0100
Served asset /icon-search.png - 304 Not Modified (0ms)
Started GET "/general/wiki/wikis/merge-request-procedure" for  at 2013-07-01 16:08:58 +0100
Processing by WikisController#show as HTML
  Parameters: {"project_id"=>"general/wiki", "id"=>"merge-request-procedure"}
  Rendered wikis/_new.html.haml (1.4ms)
  Rendered wikis/_nav.html.haml (16.1ms)
  Rendered wikis/_main_links.html.haml (12.6ms)
  Rendered wikis/show.html.haml within layouts/project_resource (234.0ms)
Completed 500 Internal Server Error in 1519ms

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 'text only' found
):
    11: .file_holder
    12:   .file_content.wiki
    13:     = preserve do
    14:       = render_wiki_content(@wiki)
    15:
    16: %p.time Last edited by #{commit_author_link(@wiki.version, avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago
  lib/redcarpet/render/gitlab_html.rb:26: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__1795298575698105037_70024758236480'
  app/views/wikis/show.html.haml:13:in `_app_views_wikis_show_html_haml__1795298575698105037_70024758236480'
  app/controllers/wikis_controller.rb:15:in `show'

Output of checks

Results of GitLab Application Check

Checking Environment ...

Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.4.0 ? ... OK (1.4.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ...
ALL RETURNED... ok

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes

Checking Sidekiq ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ...
ALL RETURNED... yes
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.7.11)

Checking GitLab ... Finished

Version of GitLab you are running & Commit SHA

5-3-stable (v5.3.0 -- Commit SHA: e1c473c1)

Describe your setup

System information
System:         CentOS Linux release 6.0 (Final)
Current User:   git
Using RVM:      yes
RVM Version:    1.19.5
Ruby Version:   1.9.3p392
Gem Version:    1.8.25
Bundler Version:1.3.5
Rake Version:   10.0.4

GitLab information
Version:        5.3.0
Revision:       e1c473c
Directory:      /home/git/gitlab
DB Adapter:     mysql2
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        1.4.0
Repositories:   /home/git/repositories/
Hooks:          /home/git/gitlab-shell/hooks/
Git:            /usr/bin/git

Possible Fixes

Not as of yet sources any fixes.

Assignee
Assign to
Time tracking