Skip to content

Slack Hook proxy configuration no longer supported by slack-ruby-client #3534

@captainfalcon23

Description

@captainfalcon23

Describe the bug
We discovered that our slack hooks from Oxidized broke some time back in January, noting at that time [0.31.0 – 2024-11-29] change log shows:

Updated slackdiff.rb to use slack_ruby_client instead of slack-api (@Punicaa)
Updated slackdiff.rb to use new files.getUploadURLExternal slack file upload API instead of deprecated files.upload (@varesa)

As per the current documentation and old behaviour, the slack hook exposed a "proxy" configuration item. In our case, we must set an explicit proxy to reach slack. See https://github.com/ytti/oxidized/blob/master/docs/Hooks.md#hook-type-slackdiff:~:text=A%20proxy%20can%20optionally%20be%20specified%20if%20needed%20to%20reach%20the%20Slack%20API%20endpoint.

Noting also, after the slack upload method has changed, it takes 3 calls to upload a file to slack:

  1. https://slack.com/api/files.getUploadURLExternal
  2. https://files.slack.com/upload/v1
  3. < finalize upload - didn't get to this part, don't have the specific URL handy >

What we identified is, when we set the proxy configuration to use a HTTPS proxy, we get an error like:

E, [2025-06-06T03:46:39.623018 #32] ERROR -- : Hook slack (#<SlackDiff:0x00007f8ef4b92c58>) failed (#<Faraday::SSLError wrapped=#<OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 peeraddr=10.255.254.1:8888 state=error: unexpected eof while reading>>) for event :post_store

This is likely because it is trying to talk HTTP to HTTPS proxy.

When we set the proxy configuration to use HTTP proxy, it completes the first step to slack.com, then gets stuck on files.slack.com - My guess here is because it's not using the proxy configuration and there's no outbound route to the internet in our case (hence explicit proxy is needed).

When we make an adjustment and expose and set "http_proxy" and "https_proxy" OS variables and DO NOT set the oxidized hook proxy, everything magically works!

This makes sense as per: https://github.com/slack-ruby/slack-ruby-client#:~:text=You%20can%20also%20control%20what%20proxy%20options%20are%20used%20by%20modifying%20the%20http_proxy%20environment%20variable%20per%20Net%3A%3AHTTP%27s%20documentation.

Expected behavior
The proxy setting in oxidized hook config should flow all the way through to the utilized gem.

Running environment (please complete the following information):
Latest version 0.33.0 on official docker image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions