Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-31179

Gitlab web hook is not working.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: gitlab-hook-plugin
    • Labels:
      None
    • Environment:
      Jenkins version: 1.573
      Gitlab hook plugin: 1.3.1
      GIT plugin: 2.3.5
      GIT client plugin: 1.9.0
    • Similar Issues:

      Description

      Previous, I added a web hooks http://jenkins.my.domain/gitlab/build_now in my project on gitlab site, then I access to Settings > Web hooks > and press Test hook button. My Jenkins server run build my app.
      However, a week ago ( on monday, Oct 19, 2015), my Jenkins could not auto build when having a new commit to gitlab. And, I tried to test it by pressing Test hook button on gitlab site, It spent a very long time and returned a error 500
      Then I checked log in production.log and got:
      Completed 500 Internal Server Error in 10158ms

      _{{Timeout::Error (execution expired):
      app/models/web_hook.rb:31:in `execute'
      app/services/test_hook_service.rb:4:in `execute'
      app/controllers/projects/hooks_controller.rb:27:in `test'
      app/controllers/application_controller.rb:57:in `set_current_user_for_thread'}}_

      I have been google and find that https://gitlab.com/gitlab-org/gitlab-ce/issues/520
      and he said that edit app/models/web_hook.rb file and change

      {{# HTTParty timeout
      default_timeout 10}}

      to
      {{# HTTParty timeout
      default_timeout 100}}

      Unfortunate, It bypass this error and display an other error: (502 Proxy error.)

      Proxy Error

      The proxy server received an invalid response from an upstream server.
      The proxy server could not handle the request GET /myproject/hooks/207/test.

      Reason: Error reading from remote server

      I continuos google with error and find out the link https://groups.google.com/forum/#!topic/gitlabhq/Ji0ub1iQw-o

      Then i tried to edit by add this line to app/models/web_hook.rb
      {{
      WebHook.http_proxy('127.0.0.1', 8080)}}

      Then, I got the error:
      ActionController::RoutingError (No route matches [POST] "/gitlab/build_now"):
      vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
      vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
      vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/rack/logger.rb:38:in `call_app'
      vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in `block in call'
      vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:67:in `block in tagged'
      vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:25:in `tagged'
      vendor/bundle/ruby/1.9.1/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:67:in `tagged'
      vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in `call'
      vendor/bundle/ruby/1.9.1/gems/actionpack-4.0.3/lib/action_dispatch/middleware/request_id.rb:21:in `call'
      vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
      vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
      vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
      vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
      vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/engine.rb:511:in `call'
      vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/application.rb:97:in `call'
      vendor/bundle/ruby/1.9.1/gems/railties-4.0.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
      vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
      vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
      vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
      vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
      vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552:in `process_client'
      vendor/bundle/ruby/1.9.1/gems/unicorn-worker-killer-0.4.2/lib/unicorn/worker_killer.rb:51:in `process_client'
      vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632:in `worker_loop'
      vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
      vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142:in `start'
      vendor/bundle/ruby/1.9.1/gems/unicorn-4.6.3/bin/unicorn_rails:209:in `<top (required)>'
      vendor/bundle/ruby/1.9.1/bin/unicorn_rails:23:in `load'
      vendor/bundle/ruby/1.9.1/bin/unicorn_rails:23:in `<main>'

      What should I do?

      Thank in advance.

        Attachments

          Activity

          Hide
          mmorejon Manuel Morejon added a comment -

          The plugins doesn't work on Jenkins 1.635. When I try install it, the console said that this plugin cannot be deployed.

          Show
          mmorejon Manuel Morejon added a comment - The plugins doesn't work on Jenkins 1.635. When I try install it, the console said that this plugin cannot be deployed.
          Hide
          bjoernsen Björn Hammesfahr added a comment -

          This plugin does not work with Jenkins 1.635, 1.636, 1.637, 1.638, and 1.639.
          1.638 was an important security release, so it is not a good idea to use an older version.

          Show
          bjoernsen Björn Hammesfahr added a comment - This plugin does not work with Jenkins 1.635, 1.636, 1.637, 1.638, and 1.639. 1.638 was an important security release, so it is not a good idea to use an older version.
          Hide
          javiplx Javier Palacios added a comment -

          You could check with 1.4.0 or latest snapshot (from http://repo.jenkins-ci.org/snapshots/org/jenkins-ci/ruby-plugins/gitlab-hook/1.4.1-SNAPSHOT/), but I don't believe it makes a change, and looks like an issue with proxy settings. All your info seems related to gitlab part, and until the communication doesn't hit jenkins, I cannot say anything. Assuming you are using your own gitlab instance, it could be faster test connectivity from command line.

          Regarding the uncompatible working versions, I've added recent builds to travisci. It works on latest LTS (1.625.3), and also on latest release (1.643). Looks like it was an issue related to jruby-jenkins integration.

          Show
          javiplx Javier Palacios added a comment - You could check with 1.4.0 or latest snapshot (from http://repo.jenkins-ci.org/snapshots/org/jenkins-ci/ruby-plugins/gitlab-hook/1.4.1-SNAPSHOT/ ), but I don't believe it makes a change, and looks like an issue with proxy settings. All your info seems related to gitlab part, and until the communication doesn't hit jenkins, I cannot say anything. Assuming you are using your own gitlab instance, it could be faster test connectivity from command line. Regarding the uncompatible working versions, I've added recent builds to travisci. It works on latest LTS (1.625.3), and also on latest release (1.643). Looks like it was an issue related to jruby-jenkins integration.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            biolinh linh nguyen
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: