{"action":"created","issue":{"url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8193","labels_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8193/labels{/name}","comments_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8193/comments","events_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8193/events","html_url":"https://github.com/gitlabhq/gitlabhq/issues/8193","id":47228561,"number":8193,"title":"Slack Notification is not working in 7.4.2","user":{"login":"amree","id":424392,"avatar_url":"https://avatars.githubusercontent.com/u/424392?v=3","gravatar_id":"","url":"https://api.github.com/users/amree","html_url":"https://github.com/amree","followers_url":"https://api.github.com/users/amree/followers","following_url":"https://api.github.com/users/amree/following{/other_user}","gists_url":"https://api.github.com/users/amree/gists{/gist_id}","starred_url":"https://api.github.com/users/amree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amree/subscriptions","organizations_url":"https://api.github.com/users/amree/orgs","repos_url":"https://api.github.com/users/amree/repos","events_url":"https://api.github.com/users/amree/events{/privacy}","received_events_url":"https://api.github.com/users/amree/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-10-30T02:59:36Z","updated_at":"2015-03-02T07:12:30Z","closed_at":"2015-03-02T07:12:30Z","body":"**Summary**\r\n\r\nSlack notification is not working in the latest version (7.4.2). It used to work in 7.2.1. I'm not sure about other versions. The main causes would be the old version of `slack-notifer` gem which was hard coded with the wrong url:\r\n\r\nhttps://github.com/stevenosloan/slack-notifier/blob/0.3.2/lib/slack-notifier.rb#L44\r\n\r\n```\r\nURI.parse \"https://#{team}.slack.com/services/hooks/#{hook_name}?token=#{token}\"\r\n```\r\n\r\nIt should be in this form:\r\n\r\n```\r\nhttps://hooks.slack.com/services/#{token}\r\n```\r\n\r\nRelated commit: https://github.com/stevenosloan/slack-notifier/commit/04006c8d2aeba4bf9086ff2524bae88919a4d424\r\n\r\nThat's why it's throwing 404 error.\r\n\r\n**Steps to reproduce**\r\n\r\nThe fastest way would be by testing `slack-notifer` gem directly since GitLab uses it to send notification to Slack.\r\n\r\n1. Get your Incoming Webhooks URL. For e.g: https://hooks.slack.com/services/sadfsad/asdfasd/asdfsadfasdf\r\n2. Open up rails console and try sending a simple ping\r\n\r\n\t$ gitlab-rails console\r\n\t\r\n\tirb> notifier = Slack::Notifier.new \"hooks\", \"sadfsad/asdfasd/asdfsadfasdf\"\r\n\tirb> notifer.ping 'hello'\r\n\t\r\n\tNet::HTTPNotFound 404 Not Found readbody=true\r\n\t\r\n**Expected behaviour**\r\n\r\nA message will be sent to Slack successfully\r\n\r\n**Observed behaviour**\r\n\r\nGetting 404 error\r\n\r\n**Relevant logs and/or screenshots**\r\n\r\nDoesn't appear when doing `gitlab-ctl tail`\r\n\r\n**Output of checks**\r\n\r\nGitLab Application Check: \r\n\r\n```\r\n$ gitlab-rake gitlab:check\r\nChecking Environment ...\r\n\r\nGit configured for git user? ... yes\r\n\r\nChecking Environment ... Finished\r\n\r\nChecking GitLab Shell ...\r\n\r\nGitLab Shell version >= 2.0.1 ? ... OK (2.0.1)\r\nRepo base directory exists? ... yes\r\nRepo base directory is a symlink? ... no\r\nRepo base owned by git:git? ... yes\r\nRepo base access is drwxrws---? ... yes\r\nSatellites access is drwxr-x---? ... yes\r\nhooks directories in repos are links: ...\r\nrepositories ... ok\r\nRunning /opt/gitlab/embedded/service/gitlab-shell/bin/check\r\nCheck GitLab API access: OK\r\nCheck directories and files:\r\n\t/var/opt/gitlab/git-data/repositories: OK\r\n\t/var/opt/gitlab/.ssh/authorized_keys: OK\r\nTest redis-cli executable: redis-cli 2.8.2\r\nSend ping to redis server: PONG\r\ngitlab-shell self-check successful\r\n\r\nChecking GitLab Shell ... Finished\r\n\r\nChecking Sidekiq ...\r\n\r\nRunning? ... yes\r\nNumber of Sidekiq processes ... 1\r\n\r\nChecking Sidekiq ... Finished\r\n\r\nChecking LDAP ...\r\n\r\nLDAP is disabled in config/gitlab.yml\r\n\r\nChecking LDAP ... Finished\r\n\r\nChecking GitLab ...\r\n\r\nDatabase config exists? ... yes\r\nDatabase is SQLite ... no\r\nAll migrations up? ... yes\r\n```\r\n\r\nGitLab version: GitLab 7.4.2 477743a\r\n\r\nSetup:\r\n\r\n```\r\n$ gitlab-rake gitlab:env:info\r\n\r\nSystem information\r\nSystem:\t\tDebian 7.6\r\nCurrent User:\tgit\r\nUsing RVM:\tno\r\nRuby Version:\t2.1.2p95\r\nGem Version:\t2.2.1\r\nBundler Version:1.5.3\r\nRake Version:\t10.3.2\r\nSidekiq Version:2.17.0\r\n\r\nGitLab information\r\nVersion:\t7.4.2\r\nRevision:\t477743a\r\nDirectory:\t/opt/gitlab/embedded/service/gitlab-rails\r\nDB Adapter:\tpostgresql\r\nURL:\t\thttp://gitlab.orgnet\r\nHTTP Clone URL:\thttp://gitlab.orgnet/some-project.git\r\nSSH Clone URL:\tgit@gitlab.orgnet:some-project.git\r\nUsing LDAP:\tno\r\nUsing Omniauth:\tno\r\n\r\nGitLab Shell\r\nVersion:\t2.0.1\r\nRepositories:\t/var/opt/gitlab/git-data/repositories\r\nHooks:\t\t/opt/gitlab/embedded/service/gitlab-shell/hooks/\r\nGit:\t\t/opt/gitlab/embedded/bin/git\r\n```\r\n\r\n**Possible fixes**\r\n\r\nI think GitLab have to upgrade `slack-notifier` gem to the latest version and change the code accordingly."},"comment":{"url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/comments/76667360","html_url":"https://github.com/gitlabhq/gitlabhq/issues/8193#issuecomment-76667360","issue_url":"https://api.github.com/repos/gitlabhq/gitlabhq/issues/8193","id":76667360,"user":{"login":"amree","id":424392,"avatar_url":"https://avatars.githubusercontent.com/u/424392?v=3","gravatar_id":"","url":"https://api.github.com/users/amree","html_url":"https://github.com/amree","followers_url":"https://api.github.com/users/amree/followers","following_url":"https://api.github.com/users/amree/following{/other_user}","gists_url":"https://api.github.com/users/amree/gists{/gist_id}","starred_url":"https://api.github.com/users/amree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amree/subscriptions","organizations_url":"https://api.github.com/users/amree/orgs","repos_url":"https://api.github.com/users/amree/repos","events_url":"https://api.github.com/users/amree/events{/privacy}","received_events_url":"https://api.github.com/users/amree/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T07:12:30Z","updated_at":"2015-03-02T07:12:30Z","body":"It's working now (v7.8.1) and some previous versions"}}