Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy configuration is ignored when using bot token #204

Closed
4 of 10 tasks
raihle opened this issue May 30, 2023 · 3 comments · Fixed by #205
Closed
4 of 10 tasks

Proxy configuration is ignored when using bot token #204

raihle opened this issue May 30, 2023 · 3 comments · Fixed by #205
Assignees
Labels
question Further information is requested

Comments

@raihle
Copy link
Contributor

raihle commented May 30, 2023

Description

This issue is similar to #131, but applies when using a bot instead of a webhook. When using the action behind a corporate proxy (e.g. on self-hosted runners), connection will time out because the proxy configuration is not respected.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • example code related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Reproducible in:

package version: 1.24.0

node version: 16

OS version(s): Ubuntu 22.04

Steps to reproduce:

  1. Set up a proxy for outgoing HTTPS traffic, and block all other outgoing HTTPS traffic
  2. Point HTTPS_PROXY / https_proxy to the proxy
  3. Run the action using bot token and channel ID

Expected result:

The message is sent

Actual result:

The actions fails due to connection timeout

Attachments:

Run slackapi/slack-github-action@v1.24.0
  with:
    channel-id: xxxxxxxxx
    slack-message: XXXXXXXXX
  env:
    SLACK_BOT_TOKEN: ***
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT xxx.xxx.xxx.xxx:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT yyy.yyy.yyy.yyy:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT yyy.yyy.yyy.yyy:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT zzz.zzz.zzz.zzz:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT www.www.www.www:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT yyy.yyy.yyy.yyy:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT yyy.yyy.yyy.yyy:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT www.www.www.www:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT yyy.yyy.yyy.yyy:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT xxx.xxx.xxx.xxx:443
[WARN]  web-api:WebClient:0 http request failed connect ETIMEDOUT www.www.www.www:443
Error: Error: A request error occurred: connect ETIMEDOUT yyy.yyy.yyy.yyy:443

@slack/web-api's WebClient already supports sending a custom agent (and intentionally disables Axios' proxy detection). I don't think this is a hard problem to fix, but I couldn't figure out how to write satisfactory tests for it.

@hello-ashleyintech hello-ashleyintech self-assigned this May 30, 2023
@hello-ashleyintech hello-ashleyintech added the question Further information is requested label May 30, 2023
@hello-ashleyintech
Copy link
Contributor

Hi, @raihle! Thanks so much for submitting this question! 🙌

A few quick questions so I can get a better picture of what's happening:

  1. Have you verified that your HTTPS_PROXY / https_proxy environment variables are getting set correctly with the desired proxy URL?
  2. Have you tested the proxy to determine it works as desired to handle incoming connections and doesn't time out on its own?

Additionally, you mentioned having an idea of how this issue might be resolved based on the @slack/web-api WebClient - if you'd like to open a PR for this repo that fixes this issue, I can take a look and help provide some direction on writing tests for it! 😄

@raihle
Copy link
Contributor Author

raihle commented May 30, 2023

Thanks @hello-ashleyintech!

Yes, I am sure that the environment variables are set. Actually, we were using an (old) fork of this repository until recently with the proxy functionality hacked in. I took some time to do that again (based on the current main) in #205. I managed to add some rudimentary tests as well, but I'm very open to suggestions.

@hello-ashleyintech
Copy link
Contributor

@raihle Wonderful, thank you so much for opening that PR 🙌 I will take a look either later today or first thing tomorrow and will be sure to leave some feedback if needed 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants