Slack Integration - Wrong sidekiq behaviour with proxy without http prefix.
Summary
If you will set http_proxy
, https_proxy
in gitlab.rb
(Omnibus) with format proxy.example.com:3128
(without http://
or https://
then you will not receive notification to Slack.
Example:
gitlab_rails['env'] = {
"http_proxy" => "proxy.example.com:3128",
}
Sending notification with Test settings
button in UI works.
Steps to reproduce
- Put proxy settings without
http://
orhttps://
prefix togitlab.rb
and rungitlab-ctl reconfigure
; - Enable Slack notifications for any repository;
- Push something to kick Slack notification.
What is the current bug behavior?
Not sending notifications for pushes.
What is the expected correct behavior?
Sending notifications for pushes.
Relevant logs and/or screenshots
2018-06-25T09:36:07.817Z 19522 TID-oqw5cj38g WARN: SocketError: Failed to open TCP connection to : (getaddrinfo: Name or service not known)
2018-06-25T09:36:07.817Z 19522 TID-oqw5cj38g WARN: /opt/gitlab/embedded/lib/ruby/2.3.0/net/http.rb:882:in `rescue in block in connect'
/opt/gitlab/embedded/lib/ruby/2.3.0/net/http.rb:879:in `block in connect'
/opt/gitlab/embedded/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
/opt/gitlab/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
/opt/gitlab/embedded/lib/ruby/2.3.0/net/http.rb:878:in `connect'
/opt/gitlab/embedded/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
/opt/gitlab/embedded/lib/ruby/2.3.0/net/http.rb:852:in `start'
/opt/gitlab/embedded/lib/ruby/2.3.0/net/http.rb:1384:in `request'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier/default_http_client.rb:21:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier/default_http_client.rb:8:in `post'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier.rb:41:in `ping'
/opt/gitlab/embedded/service/gitlab-rails/app/models/project_services/chat_notification_service.rb:98:in `notify'
/opt/gitlab/embedded/service/gitlab-rails/app/models/project_services/chat_notification_service.rb:74:in `execute'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `block in execute'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/method_call.rb:36:in `measure'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/instrumentation.rb:159:in `execute'
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
# gitlab-rake gitlab:env:infoSystem information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.7p456 Gem Version: 2.6.14 Bundler Version:1.13.7 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.16.4 Sidekiq Version:5.0.5 Go Version: go1.6.2 linux/amd64
GitLab information Version: 10.8.4 Revision: 2268d0c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://gitlab.ozon.ru HTTP Clone URL: https://gitlab.ozon.ru/some-group/some-project.git SSH Clone URL: git@gitlab.ozon.ru:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 7.1.2 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)