-
Notifications
You must be signed in to change notification settings - Fork 657
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 usage is broken since v4.5.0 (switch to axios) #642
Comments
Thanks for the info and sorry for the inconvenience, @jbsil. For now, the workaround is to use an earlier version until we can fix this up. We’ll let you know if we need any more info from you. |
I just heard from another user experiencing this issue. they were able to workaround without downgrading by setting the for example, change i just want to be clear, this still sounds like a bug and we should fix it, but i wanted to make the more preferred workaround known. |
Looks like Fix #642 not working for me. I try to connect with RTMClient behind a http proxy. I use Version 4.8.0 of node-slack-sdk. The Client request fails and retries forever. No error is reported! With Version 4.4.0 everything is OK. Here is the log when I execute sample Project: https://github.com/DornieDortsch/node-slack-sdk-bug
Reproducible in:
node version: v8.11.3 OS version(s): macOS 10.14.1 Steps to reproduce:
Expected result:Connecting to Slack or log error Actual result:Not connecting to slack and not reporting error |
thanks for reporting and providing the sample code @DornieDortsch. i'm reopening the issue now. this issue will likely get attention from our team in the next week or two. as always, feel free to dig in in the meantime. |
@DornieDortsch i'm not able to reproduce this one, but let me describe what i'm doing and maybe you can help me see where your set up is different. i'm using Charles Proxy on my mac, which is using the default proxy configuration (port 8888). i clone your repo, and created a new
then i did an next, i downgraded to one random thought: if your proxy has its own self-signed certificate, you might need to use the |
@aoberoi the steps you take to reproduce the error are correct. I think it's a special problem with my proxy setup. We have to use http proxy for http and https requests. Looks like axios didn't play well with this setup. I added print to get the error message at WebClient
I take some time to get the right axios setup. |
Yeah I found the problem! There is a "automatic proxy detection" feature at axios library. Therefore axios take the You can reproduce this by setting environment variable Maybe it's a good option to disable automatic proxy detection by default.
This article bring me on the right path https://janmolak.com/node-js-axios-behind-corporate-proxies-8b17a6f31f9d PS: Logging the exact error message at debug level would help finding errors faster. |
@DornieDortsch yay! thanks for digging deeper and sharing your findings back with the rest of us. this is super helpful and it makes sense. i'm going to make another issue to discuss your suggestion of disabling the automatic proxy detection using the environment variable. in terms of logging, i'm not sure if its wise to output that level of detail, but i can be convinced. in theory, the promise would be rejected with an error that contains that detail, so you should be able to log it yourself. i think the only reason that wasn't apparent here is because automatic retries were going to occur for the next ~30 minutes before you saw the final rejected error, but this is the expected behavior. i think a good debugging step should have been to turn retries off to see what the underlying error was, but neither of us thought of that. 🤔 |
Description
I am unable to get WebClient to connect using any proxy on versions 4.5.0 or 4.6.0. Proxies work correctly on v4.4.0. I believe this is due to the change from
got
toaxios
#620Also, since RTMClient internally uses a WebClient (for initial authentication?), that also does not work. This is reliably reproducible with multiple proxies.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
@slack/client
version: 4.5.0, 4.6.0node version: 6.11.4
OS version(s): docker hub's node 6-alpine image
Steps to reproduce:
https-proxy-agent
{agent: proxyAgent}
when creating an RTMClient.on('hello')
and.start()
the clientExpected result:
Receive a
hello
event from SlackActual result:
The text was updated successfully, but these errors were encountered: