Skip to content

Running Under Docker Requires resetting proxy with http_proxy="" #155

Closed
@phantomdata

Description

@phantomdata

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions