Addressable::URI::InvalidURIError: Invalid port number: "NAME"

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

Addressable::URI::InvalidURIError: Invalid port number: "GROUP"
  lib/gitlab/url_sanitizer.rb:22:in `initialize'
    @url = Addressable::URI.parse(url.strip)
  app/models/remote_mirror.rb:93:in `new'
    mirror_url = Gitlab::UrlSanitizer.new(value)
  app/models/remote_mirror.rb:93:in `url='
    mirror_url = Gitlab::UrlSanitizer.new(value)
  app/controllers/projects/mirrors_controller.rb:13:in `update'
    if @project.update_attributes(mirror_params)
  lib/gitlab/middleware/multipart.rb:93:in `call'
    return @app.call(env) if encoded_message.blank?
...
(140 additional frame(s) were not displayed)

Addressable::URI::InvalidURIError: Invalid port number: "GROUP"

This error happens if you specify https://gitlab.example.com:GROUP/PROJECT.git as the URL at mirror page. This can happen by accident if you, for example, just copy the project URL from the project page.

If we have a malformed URL, we should not see 500 page.

Edited Sep 02, 2020 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading