Error 500 when .gitmodules contains invalid characters of a namespace

If the .gitmodules contains a URL entry of the form:

        url = git@gitlab.com:<fork>/internal.git

<fork> will be interpreted as a namespace, which is not allowed. We should be ignoring these invalid namespaces.

https://sentry.gitlap.com/gitlab/gitlabcom/issues/34906/

ActionController::UrlGenerationError: No route matches {:action=>"show", :controller=>"projects", :id=>"internal", :namespace_id=>"<fork>"} missing required keys: [:namespace_id]
  app/helpers/submodule_helper.rb:31:in `submodule_links'
    [namespace_project_path(namespace, project),
  app/helpers/diff_helper.rb:91:in `submodule_link'
    tree, commit = submodule_links(blob, ref, repository)
  app/views/projects/tree/_submodule_item.html.haml:4:in `_app_views_projects_tree__submodule_item_html_haml___1108542384982106369_69942426556000'
    = submodule_link(submodule_item, @ref)
  app/views/projects/tree/_tree_row.html.haml:6:in `_app_views_projects_tree__tree_row_html_haml___889434624970704751_69942426086340'
    = render partial: 'projects/tree/submodule_item', object: tree_row, as: 'submodule_item'
  app/helpers/tree_helper.rb:11:in `render_tree'
    tree << render(partial: "projects/tree/tree_row", collection: items) if items.present?
...
(211 additional frame(s) were not displayed)

ActionView::Template::Error: No route matches {:action=>"show", :controller=>"projects", :id=>"internal", :namespace_id=>"<fork>"} missing required keys: [:namespace_id]

ActionView::Template::Error: No route matches {:action=>"show", :controller=>"projects", :id=>"internal", :namespace_id=>"<fork>"} missing required keys: [:namespace_id]
Edited Jun 26, 2017 by Stan Hu
Assignee Loading
Time tracking Loading