-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Running Under Docker Requires resetting proxy with http_proxy=""
#155
Comments
What's the proxy value specified? |
Oh hai!
I suspect that the port changes depending on environmental factors. If it wasn't clear in my Issue; I am literally passing an empty value in to override the declare'd value.
I'll get a chance to test if this happens on Docker in Linux either tonight or tomorrow night. NOTE: I don't think its a bug in |
What's the configuration in the bot? Are you setting |
Nope. That was the weirdest part and what ultimately threw me for a gigantic loop. #!/usr/bin/env ruby
require "slack-ruby-bot"
class CookieBot < SlackRubyBot::Bot; end
CookieBot.run |
It's actually documented, https://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html#class-Net::HTTP-label-Proxies. I wouldn't assume that the problem is parsing and debug it. If it's a full proxy it should work, so I would try figuring out whether it's an SSL proxy, whether it supports websockets, etc., then potentially prefixing it with |
http_proxy=""
to be passedhttp_proxy=""
Hehe, I was actually caught off guard because the proxy environment variable was set by Docker without my knowledge or intervention - hence having to track down what Ultimately, in tracing it down I found out that the specific value that Docker was setting it to resulted in I guess, the crux of it is that I had no idea an As soon as I unset that environment variable, everything was happy days. Its solved for me, but I was generally hoping this Issue might save someone else from having to figure out "Why doesn't this work on Docker for Mac?". :) I guess; 3 possible outcomes:
(btw, thanks for being so responsive. I love your library and have gotten a great deal of use out of it over the last 6 months or so) |
I think we should update the README around proxy configuration saying that the default is not |
Sounds like a plan! If you don't mind, can you assign this issue to me? |
Hey @phantomdata, I'm running into this same problem. I'm trying to get a bot dockerized and deployed to kubernetes. The image starts fine but I'm seeing the same Did you ever get this resolved? I'm pretty new to docker/k8s and have a pretty basic docker file at the moment.
Where did you end up nilling out the proxy? EDIT: My start script does something like this |
I might be running into an issue with my cluster configuration actually... Might be unrelated. |
👋 @jasonwc That's exactly what I did to get mine up and running ( Let us know what you find out. I'll probably update that README over the next few days, so if there's another reason for that Thanks for reminding me about this issue, heh. It had totally slipped my mind to update the README. |
Thanks for the docs @phantomdata, updated in c9ed355. |
Thanks @phantomdata and @dblock! It turned out that I was running into an issue with my Kubernetes cluster. I basically did what you had suggested @phantomdata and tried to ping Google and Slack and wasn't able to get out. I then realized that my kube-dns pods were in a CrashLoopBackOff cycle and that was causing my networking issues. I'll make sure to verify that the Regardless, this issue was helpful in giving me a few things to try so thanks for the README update! This library has been super helpful for our internal slackbot and I'm hoping to find a chance to contribute back soon. I've been tooling around on a blog post about combining this library, docker, and kubernetes to make a sweet sweet bot cluster for interfacing with a lot of different services. Happy New Year to both of you and thanks again for your help! |
Here here to the usefulness. Thanks for all the hard work @dblock and everyone else contributing! I'm glad you got the reason for your issues tracked down @jasonwc. Feel free to re-open this issue if you run into it once your cluster is working and my suggested fix doesn't resolve it for you. The README has been updated with helpful instructions over in c9ed355, so I'm going to go ahead and close this out. 🎉 |
I came across this issue when investigating a similar error in a library that uses net/http so I wanted to leave a breadcrumb for others. This error: Is caused by http_proxy missing the |
Its late, and I wanted to make sure to get this logged in case I forgot. I haven't seen this with anything else I've Dockerized, but recently Dockerizing a bot of mine I ran into a unique issue:
ERROR -- : Failed to open TCP connection to : (getaddrinfo: Name or service not known) (Faraday::ConnectionFailed)
An hour or so of sleuthing through slack-ruby-bot, slack-ruby-client, faraday and finally ruby (2.3)'s own net/http library led me to an interesting realization; it was using an HTTP proxy. The problem was, the HTTP proxy specified by Docker was unrecognizable by Ruby's net libraries and consequently failed to determine its hostname... which unexpectedly didn't error out, but just returned nil for the entire proxy address. 🎉
Ultimately, I temporarily got around this by including
http_proxy=""
in my command to start my bot. This was Docker CE 17.06.1 on a Mac. I'm uncertain as to if it affects any other platforms.I'll try to track down where this would properly go; but figured that if nothing else - dropping a line in this project's README would help someone out if they stumbled upon this later.
I admit, my Docker knowledge is not very advanced and I may be mis-interpreting something - but again; wanted this searchable somewhere in case anyone else ran into it. Feel free to close, I won't feel bad.
The text was updated successfully, but these errors were encountered: