title: Gitlab webhook get error: 500 Internal Server Error - URI::InvalidURIError
body: <p>With Gitlab <em>(10.6.2)</em> and Jenkins installed on local machine, and trying to auto build via gitlab's webhook, according to <a href="https://github.com/jenkinsci/gitlab-plugin/wiki/Setup-Example" rel="nofollow noreferrer">https://github.com/jenkinsci/gitlab-plugin/wiki/Setup-Example</a></p>
  
  <p>But, when test push, gitlab get error:</p>
  
  <blockquote>
    <p>500 Internal Server Error - URI::InvalidURIError</p>
  </blockquote>
  
  <p>The detailed log in <code>production.log</code> is:</p>
  
  <blockquote>
    <p>Started GET "/laiwan/laiwan-parent/hooks/2/test?trigger=push_events"
    for 127.0.0.1 at 2018-04-03 17:11:07 +0800 Processing by
    Projects::HooksController#test as HTML    Parameters:
    {"trigger"=>"push_events", "namespace_id"=>"laiwan",
    "project_id"=>"laiwan-parent", "id"=>"2"} Completed 500 Internal
    Server Error in 27ms (ActiveRecord: 2.3ms)</p>
    
    <p>URI::InvalidURIError (URI::InvalidURIError):<br>
    lib/gitlab/proxy_http_connection_adapter.rb:14:in <code>connection'<br>
    app/services/web_hook_service.rb:73:in</code>make_request'<br>
    app/services/web_hook_service.rb:26:in <code>execute'<br>
    app/models/hooks/web_hook.rb:10:in</code>execute'<br>
    app/services/test_hooks/base_service.rb:22:in <code>block in execute'<br>
    app/services/test_hooks/base_service.rb:19:in</code>catch'<br>
    app/services/test_hooks/base_service.rb:19:in <code>execute'<br>
    app/controllers/projects/hooks_controller.rb:41:in</code>test'<br>
    lib/gitlab/i18n.rb:50:in <code>with_locale'   lib/gitlab/i18n.rb:56:in
    </code>with_user_locale'   app/controllers/application_controller.rb:330:in
    <code>set_locale'   lib/gitlab/middleware/multipart.rb:95:in</code>call'<br>
    lib/gitlab/request_profiler/middleware.rb:14:in <code>call'<br>
    lib/gitlab/middleware/go.rb:17:in</code>call'<br>
    lib/gitlab/etag_caching/middleware.rb:11:in <code>call'<br>
    lib/gitlab/middleware/read_only/controller.rb:28:in</code>call'<br>
    lib/gitlab/middleware/read_only.rb:16:in <code>call'<br>
    lib/gitlab/request_context.rb:18:in</code>call'<br>
    lib/gitlab/metrics/requests_rack_middleware.rb:27:in <code>call'<br>
    lib/gitlab/middleware/release_env.rb:10:in</code>call'</p>
  </blockquote>
  
  <p>Gitlab webhook's url is <code>http://localhost:8282/project/laiwan-parent</code>, it's valid.</p>
  
  <p>Seems someone asked similar issue on gitlab's issues page, but didn't get any respond yet: 
  <a href="https://gitlab.com/gitlab-org/gitlab-ee/issues/5375" rel="nofollow noreferrer">https://gitlab.com/gitlab-org/gitlab-ee/issues/5375</a></p>
  
  <p>Any help?</p>